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:
Thu Nov 26 12:52:04 2015 +0000
Parent:
921:ea542e6519bb
Child:
923:ca1964e56ddf
Commit message:
Synchronized with git rev 0383194a
Author: Vincent Coubard
Add DisconnectionEventCAllbackChain accessor

Changed in this revision

ble/Gap.h Show annotated file Show diff for this revision Revisions of this file
--- a/ble/Gap.h	Thu Nov 26 12:52:04 2015 +0000
+++ b/ble/Gap.h	Thu Nov 26 12:52:04 2015 +0000
@@ -146,7 +146,9 @@
     typedef FunctionPointerWithContext<const ConnectionCallbackParams_t *> ConnectionEventCallback_t;
     typedef CallChainOfFunctionPointersWithContext<const ConnectionCallbackParams_t *> ConnectionEventCallbackChain_t;
 
-    typedef void (*DisconnectionEventCallback_t)(const DisconnectionCallbackParams_t *params);
+    typedef FunctionPointerWithContext<const DisconnectionCallbackParams_t*> DisconnectionEventCallback_t;
+    typedef CallChainOfFunctionPointersWithContext<const DisconnectionCallbackParams_t*> DisconnectionEventCallbackChain_t;    
+
     typedef FunctionPointerWithContext<bool> RadioNotificationEventCallback_t;
 
     /*
@@ -924,6 +926,10 @@
     template<typename T>
     void onDisconnection(T *tptr, void (T::*mptr)(const DisconnectionCallbackParams_t*)) {disconnectionCallChain.add(tptr, mptr);}
 
+    DisconnectionEventCallbackChain_t& onDisconnection() {
+        return disconnectionCallChain;
+    }
+
     /**
      * Set the application callback for radio-notification events.
      *
@@ -1034,7 +1040,7 @@
     RadioNotificationEventCallback_t radioNotificationCallback;
     AdvertisementReportCallback_t    onAdvertisementReport;
     ConnectionEventCallbackChain_t connectionCallChain;
-    CallChainOfFunctionPointersWithContext<const DisconnectionCallbackParams_t*> disconnectionCallChain;
+    DisconnectionEventCallbackChain_t disconnectionCallChain;
 
 private:
     /* Disallow copy and assignment. */