Lightly modified version of the BLE stack, that doesn't bring up a DFUService by default... as we have our own.

Fork of BLE_API by Bluetooth Low Energy

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Wed Apr 15 09:05:09 2015 +0100
Parent:
327:8c645f5694b2
Child:
329:2e082a9c7c13
Commit message:
Synchronized with git rev 7e9fc2ae
Author: Rohit Grover
minor parameter renames and removal of un-necessary consts

Changed in this revision

public/BLEDevice.h Show annotated file Show diff for this revision Revisions of this file
public/GattServer.h Show annotated file Show diff for this revision Revisions of this file
--- a/public/BLEDevice.h	Fri Mar 27 13:03:37 2015 +0000
+++ b/public/BLEDevice.h	Wed Apr 15 09:05:09 2015 +0100
@@ -299,13 +299,13 @@
      *     input:  Length in bytes to be read,
      *     output: Total length of attribute value upon successful return.
      */
-    ble_error_t readCharacteristicValue(GattAttribute::Handle_t handle, uint8_t *const buffer, uint16_t *const lengthP);
+    ble_error_t readCharacteristicValue(GattAttribute::Handle_t attributeHandle, uint8_t *buffer, uint16_t *lengthP);
 
     /**
      * @param  localOnly
      *         Only update the characteristic locally regardless of notify/indicate flags in the CCCD.
      */
-    ble_error_t updateCharacteristicValue(GattAttribute::Handle_t handle, const uint8_t *value, uint16_t size, bool localOnly = false);
+    ble_error_t updateCharacteristicValue(GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size, bool localOnly = false);
 
     /**
      * Yield control to the BLE stack or to other tasks waiting for events. This
@@ -653,15 +653,15 @@
     return transport->getGap().getState();
 }
 
-inline ble_error_t BLEDevice::readCharacteristicValue(GattAttribute::Handle_t handle, uint8_t *const buffer, uint16_t *const lengthP)
+inline ble_error_t BLEDevice::readCharacteristicValue(GattAttribute::Handle_t attributeHandle, uint8_t *buffer, uint16_t *lengthP)
 {
-    return transport->getGattServer().readValue(handle, buffer, lengthP);
+    return transport->getGattServer().readValue(attributeHandle, buffer, lengthP);
 }
 
 inline ble_error_t
-BLEDevice::updateCharacteristicValue(GattAttribute::Handle_t handle, const uint8_t *value, uint16_t size, bool localOnly)
+BLEDevice::updateCharacteristicValue(GattAttribute::Handle_t attributeHandle, const uint8_t *value, uint16_t size, bool localOnly)
 {
-    return transport->getGattServer().updateValue(handle, const_cast<uint8_t *>(value), size, localOnly);
+    return transport->getGattServer().updateValue(attributeHandle, const_cast<uint8_t *>(value), size, localOnly);
 }
 
 inline void
--- a/public/GattServer.h	Fri Mar 27 13:03:37 2015 +0000
+++ b/public/GattServer.h	Wed Apr 15 09:05:09 2015 +0100
@@ -44,10 +44,10 @@
     friend class BLEDevice;
 private:
     /* These functions must be defined in the sub-class */
-    virtual ble_error_t addService(GattService &)                                                            = 0;
-    virtual ble_error_t readValue(GattAttribute::Handle_t handle, uint8_t buffer[], uint16_t *const lengthP) = 0;
-    virtual ble_error_t updateValue(GattAttribute::Handle_t, uint8_t[], uint16_t, bool localOnly = false)    = 0;
-    virtual ble_error_t initializeGATTDatabase(void)                                                         = 0;
+    virtual ble_error_t addService(GattService &)                                                               = 0;
+    virtual ble_error_t readValue(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP) = 0;
+    virtual ble_error_t updateValue(GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false) = 0;
+    virtual ble_error_t initializeGATTDatabase(void)                                                            = 0;
 
     // ToDo: For updateValue, check the CCCD to see if the value we are
     // updating has the notify or indicate bits sent, and if BOTH are set