Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_API by
Diff: public/BLEDevice.h
- 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) {