High level Bluetooth Low Energy API and radio abstraction layer

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Revision:
550:35b3962903af
Parent:
548:623e4c0f0b6e
Child:
551:d79a7933a6d1
--- a/public/GattServer.h	Fri Jun 19 15:52:09 2015 +0100
+++ b/public/GattServer.h	Fri Jun 19 15:52:10 2015 +0100
@@ -37,7 +37,7 @@
         dataSentCallChain(),
         dataWrittenCallChain(),
         onDataRead(),
-        onUpdatesEnabled(NULL),
+        updatesEnabledCallback(NULL),
         onUpdatesDisabled(NULL),
         onConfirmationReceived(NULL) {
         /* empty */
@@ -205,7 +205,13 @@
         onDataRead.add(objPtr, memberPtr);
         return BLE_ERROR_NONE;
     }
-    void setOnUpdatesEnabled(EventCallback_t callback)       {onUpdatesEnabled       = callback;}
+
+    /**
+     * Setup a callback for when notifications/indications are enabled for a
+     * characteristic on the local GattServer.
+     */
+    void onUpdatesEnabled(EventCallback_t callback)          {updatesEnabledCallback = callback;}
+
     void setOnUpdatesDisabled(EventCallback_t callback)      {onUpdatesDisabled      = callback;}
     void setOnConfirmationReceived(EventCallback_t callback) {onConfirmationReceived = callback;}
 
@@ -225,8 +231,8 @@
     void handleEvent(GattServerEvents::gattEvent_e type, GattAttribute::Handle_t charHandle) {
         switch (type) {
             case GattServerEvents::GATT_EVENT_UPDATES_ENABLED:
-                if (onUpdatesEnabled) {
-                    onUpdatesEnabled(charHandle);
+                if (updatesEnabledCallback) {
+                    updatesEnabledCallback(charHandle);
                 }
                 break;
             case GattServerEvents::GATT_EVENT_UPDATES_DISABLED:
@@ -258,7 +264,7 @@
     CallChainOfFunctionPointersWithContext<unsigned>                        dataSentCallChain;
     CallChainOfFunctionPointersWithContext<const GattWriteCallbackParams *> dataWrittenCallChain;
     CallChainOfFunctionPointersWithContext<const GattReadCallbackParams *>  onDataRead;
-    EventCallback_t                                                         onUpdatesEnabled;
+    EventCallback_t                                                         updatesEnabledCallback;
     EventCallback_t                                                         onUpdatesDisabled;
     EventCallback_t                                                         onConfirmationReceived;