High level Bluetooth Low Energy API and radio abstraction layer

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Fri Jun 19 15:53:00 2015 +0100
Parent:
664:1624b24837d0
Child:
666:b4a737539c2c
Commit message:
Synchronized with git rev bc4233f2
Author: Rohit Grover
white space and cosmetic changes.

Changed in this revision

services/DFUService.h Show annotated file Show diff for this revision Revisions of this file
services/HeartRateService.h Show annotated file Show diff for this revision Revisions of this file
services/URIBeaconConfigService.h Show annotated file Show diff for this revision Revisions of this file
--- a/services/DFUService.h	Fri Jun 19 15:53:00 2015 +0100
+++ b/services/DFUService.h	Fri Jun 19 15:53:00 2015 +0100
@@ -54,11 +54,11 @@
     */
     DFUService(BLEDevice &_ble, ResetPrepare_t _handoverCallback = NULL) :
         ble(_ble),
-        controlBytes(),
-        packetBytes(),
         controlPoint(DFUServiceControlCharacteristicUUID, controlBytes, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
         packet(DFUServicePacketCharacteristicUUID, packetBytes, SIZEOF_PACKET_BYTES, SIZEOF_PACKET_BYTES,
-               GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE) {
+               GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE),
+        controlBytes(),
+        packetBytes() {
         static bool serviceAdded = false; /* We should only ever need to add the DFU service once. */
         if (serviceAdded) {
             return;
@@ -109,12 +109,8 @@
     static const unsigned SIZEOF_CONTROL_BYTES = 2;
     static const unsigned SIZEOF_PACKET_BYTES  = 20;
 
-    static ResetPrepare_t handoverCallback;  /**< application specific handover callback. */
-
 protected:
     BLEDevice          &ble;
-    uint8_t             controlBytes[SIZEOF_CONTROL_BYTES];
-    uint8_t             packetBytes[SIZEOF_PACKET_BYTES];
 
     /**< Writing to the control characteristic triggers the handover to dfu-
       *  bootloader. At present, writing anything will do the trick--this needs
@@ -127,6 +123,11 @@
       *  FOTA clients might get confused as service definitions change after
       *  handing control over to the bootloader. */
     GattCharacteristic  packet;
+
+    uint8_t             controlBytes[SIZEOF_CONTROL_BYTES];
+    uint8_t             packetBytes[SIZEOF_PACKET_BYTES];
+
+    static ResetPrepare_t handoverCallback;  /**< application specific handover callback. */
 };
 
 #endif /* #ifndef __BLE_DFU_SERVICE_H__*/
\ No newline at end of file
--- a/services/HeartRateService.h	Fri Jun 19 15:53:00 2015 +0100
+++ b/services/HeartRateService.h	Fri Jun 19 15:53:00 2015 +0100
@@ -174,7 +174,7 @@
             return 1 + ((valueBytes[FLAGS_BYTE_INDEX] & VALUE_FORMAT_FLAG) ? sizeof(uint16_t) : sizeof(uint8_t));
         }
 
-private:
+    private:
         /* First byte = 8-bit values, no extra info, Second byte = uint8_t HRM value */
         /* See --> https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml */
         uint8_t valueBytes[MAX_VALUE_BYTES];
--- a/services/URIBeaconConfigService.h	Fri Jun 19 15:53:00 2015 +0100
+++ b/services/URIBeaconConfigService.h	Fri Jun 19 15:53:00 2015 +0100
@@ -305,7 +305,7 @@
                                       reinterpret_cast<uint8_t *>(params.advPowerLevels), sizeof(PowerLevels_t));
     }
 
-  private:
+private:
     void lockAuthorizationCallback(GattCharacteristicWriteAuthCBParams *authParams) {
         if (lockedState) {
             authParams->authorizationReply = AUTH_CALLBACK_REPLY_ATTERR_INSUF_AUTHORIZATION;
@@ -392,7 +392,7 @@
     ReadWriteGattCharacteristic<uint16_t>      beaconPeriodChar;
     WriteOnlyGattCharacteristic<uint8_t>       resetChar;
 
-  public:
+public:
     /*
      *  Encode a human-readable URI into the binary format defined by URIBeacon spec (https://github.com/google/uribeacon/tree/master/specification).
      */