BLE_API_Tiny_BLE

Dependents:   CSSE4011_BLE_IMU

Fork of BLE_API by Bluetooth Low Energy

Revision:
244:aa639ef2f290
Parent:
230:2c414d3240a8
Child:
257:7a50601356cc
--- a/public/BLEDevice.h	Tue Dec 09 13:15:19 2014 +0000
+++ b/public/BLEDevice.h	Thu Dec 11 11:52:32 2014 +0000
@@ -216,6 +216,14 @@
     void onDisconnection(Gap::DisconnectionEventCallback_t disconnectionCallback);
 
     /**
+     * Append to a chain of callbacks to be invoked upon disconnection; these
+     * callbacks receive no context and are therefore different from the
+     * onDisconnection callback.
+     */
+    template<typename T>
+    void addToDisconnectionCallChain(T *tptr, void (T::*mptr)(void));
+
+    /**
      * Setup a callback for the GATT event DATA_SENT.
      */
     void onDataSent(GattServer::ServerEventCallbackWithCount_t callback);
@@ -510,6 +518,12 @@
     transport->getGap().setOnDisconnection(disconnectionCallback);
 }
 
+template<typename T>
+inline void
+BLEDevice::addToDisconnectionCallChain(T *tptr, void (T::*mptr)(void)) {
+    transport->getGap().addToDisconnectionCallChain(tptr, mptr);
+}
+
 inline void
 BLEDevice::onDataSent(GattServer::ServerEventCallbackWithCount_t callback)
 {