mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-12-20 16:22:03 +03:00
Enable/disable notifications for motion service.
This commit is contained in:
parent
31badd2eb3
commit
2c5015add7
@ -221,12 +221,15 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
|
||||
|
||||
if(event->subscribe.reason == BLE_GAP_SUBSCRIBE_REASON_TERM) {
|
||||
heartRateService.UnsubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
|
||||
motionService.UnsubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
|
||||
}
|
||||
else if(event->subscribe.prev_notify == 0 && event->subscribe.cur_notify == 1) {
|
||||
heartRateService.SubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
|
||||
motionService.SubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
|
||||
}
|
||||
else if(event->subscribe.prev_notify == 1 && event->subscribe.cur_notify == 0) {
|
||||
heartRateService.UnsubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
|
||||
motionService.UnsubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user