Lancaster University's fork of the mbed BLE API. Lives on github, https://github.com/lancaster-university/BLE_API
Dependents: microbit-dal microbit-dal microbit-ble-open microbit-dal ... more
Fork of BLE_API by
Diff: ble/services/LinkLossService.h
- Revision:
- 912:f728aa46e7df
- Parent:
- 907:f9a79127973a
- Child:
- 1000:409fdc9db5f8
diff -r 885ee648c6ab -r f728aa46e7df ble/services/LinkLossService.h --- a/ble/services/LinkLossService.h Thu Nov 26 12:52:03 2015 +0000 +++ b/ble/services/LinkLossService.h Thu Nov 26 12:52:03 2015 +0000 @@ -17,7 +17,7 @@ #ifndef __BLE_LINK_LOSS_SERVICE_H__ #define __BLE_LINK_LOSS_SERVICE_H__ -#include "Gap.h" +#include "ble/Gap.h" /** * @class LinkLossService @@ -52,11 +52,11 @@ GattCharacteristic *charTable[] = {&alertLevelChar}; GattService linkLossService(GattService::UUID_LINK_LOSS_SERVICE, charTable, sizeof(charTable) / sizeof(GattCharacteristic *)); - ble.addService(linkLossService); + ble.gattServer().addService(linkLossService); serviceAdded = true; - ble.addToDisconnectionCallChain(this, &LinkLossService::onDisconnectionFilter); - ble.onDataWritten(this, &LinkLossService::onDataWritten); + ble.gap().onDisconnection(this, &LinkLossService::onDisconnectionFilter); + ble.gattServer().onDataWritten(this, &LinkLossService::onDataWritten); } /** @@ -86,7 +86,7 @@ } } - void onDisconnectionFilter(void) { + void onDisconnectionFilter(const Gap::DisconnectionCallbackParams_t *params) { if (alertLevel != NO_ALERT) { callback(alertLevel); }