diff options
author | Jean-François Milants <jf@codingfield.com> | 2021-10-17 08:42:49 +0200 |
---|---|---|
committer | Jean-François Milants <jf@codingfield.com> | 2021-10-17 08:42:49 +0200 |
commit | 2c5015add7a67f950e7f5f33e5bc84b7275b4ced (patch) | |
tree | f15bae3239f6a671f350e30ada0dadc43fa35d9a /src/components/ble/NimbleController.cpp | |
parent | 31badd2eb3a46ed75a752f7b30015a1eaa205cc6 (diff) |
Enable/disable notifications for motion service.
Diffstat (limited to 'src/components/ble/NimbleController.cpp')
-rw-r--r-- | src/components/ble/NimbleController.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index 09a9b99f..1bcae1bc 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -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; |