File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
features/FEATURE_BLE/ble/services Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 27
27
* Service: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.link_loss.xml
28
28
* Alertness Level Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.alert_level.xml
29
29
*/
30
- class LinkLossService {
30
+ class LinkLossService : public ble ::Gap::EventHandler
31
+ {
31
32
public:
32
33
enum AlertLevel_t {
33
34
NO_ALERT = 0 ,
@@ -59,7 +60,7 @@ class LinkLossService {
59
60
ble.gattServer ().addService (linkLossService);
60
61
serviceAdded = true ;
61
62
62
- ble.gap ().onDisconnection (this , &LinkLossService::onDisconnectionFilter );
63
+ ble.gap ().setEventHandler (this );
63
64
ble.gattServer ().onDataWritten (this , &LinkLossService::onDataWritten);
64
65
}
65
66
@@ -90,7 +91,7 @@ class LinkLossService {
90
91
}
91
92
}
92
93
93
- void onDisconnectionFilter (const Gap::DisconnectionCallbackParams_t *params ) {
94
+ virtual void onDisconnectionComplete (const ble::DisconnectionCompleteEvent & ) {
94
95
if (alertLevel != NO_ALERT) {
95
96
callback (alertLevel);
96
97
}
You can’t perform that action at this time.
0 commit comments