New call to onDisconnection callback in LinkLossService

This commit is contained in:
xcrespo 2015-10-05 10:37:46 +02:00
parent da2b104e16
commit 13a9c192d7

View file

@ -52,11 +52,12 @@ public:
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 +87,7 @@ protected:
}
}
void onDisconnectionFilter(void) {
void onDisconnectionFilter(const Gap::DisconnectionCallbackParams_t *params) {
if (alertLevel != NO_ALERT) {
callback(alertLevel);
}