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/GattServer.h
- Revision:
- 695:b1ae3b0a69e8
- Parent:
- 694:02882efc6e88
- Child:
- 697:a14056489984
--- a/public/GattServer.h Fri Jun 19 15:53:04 2015 +0100 +++ b/public/GattServer.h Fri Jun 19 15:53:04 2015 +0100 @@ -38,7 +38,7 @@ dataWrittenCallChain(), dataReadCallChain(), updatesEnabledCallback(NULL), - onUpdatesDisabled(NULL), + updatesDisabledCallback(NULL), onConfirmationReceived(NULL) { /* empty */ } @@ -230,9 +230,14 @@ * Setup a callback for when notifications/indications are enabled for a * characteristic on the local GattServer. */ - void onUpdatesEnabled(EventCallback_t callback) {updatesEnabledCallback = callback;} + void onUpdatesEnabled(EventCallback_t callback) {updatesEnabledCallback = callback;} - void setOnUpdatesDisabled(EventCallback_t callback) {onUpdatesDisabled = callback;} + /** + * Setup a callback for when notifications/indications are disabled for a + * characteristic on the local GattServer. + */ + void onUpdatesDisabled(EventCallback_t callback) {updatesDisabledCallback = callback;} + void setOnConfirmationReceived(EventCallback_t callback) {onConfirmationReceived = callback;} protected: @@ -256,8 +261,8 @@ } break; case GattServerEvents::GATT_EVENT_UPDATES_DISABLED: - if (onUpdatesDisabled) { - onUpdatesDisabled(charHandle); + if (updatesDisabledCallback) { + updatesDisabledCallback(charHandle); } break; case GattServerEvents::GATT_EVENT_CONFIRMATION_RECEIVED: @@ -285,7 +290,7 @@ CallChainOfFunctionPointersWithContext<const GattWriteCallbackParams *> dataWrittenCallChain; CallChainOfFunctionPointersWithContext<const GattReadCallbackParams *> dataReadCallChain; EventCallback_t updatesEnabledCallback; - EventCallback_t onUpdatesDisabled; + EventCallback_t updatesDisabledCallback; EventCallback_t onConfirmationReceived; private: