Skip to content

Commit 2c5015a

Browse files
committed
Enable/disable notifications for motion service.
1 parent 31badd2 commit 2c5015a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/components/ble/NimbleController.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,15 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
221221

222222
if(event->subscribe.reason == BLE_GAP_SUBSCRIBE_REASON_TERM) {
223223
heartRateService.UnsubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
224+
motionService.UnsubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
224225
}
225226
else if(event->subscribe.prev_notify == 0 && event->subscribe.cur_notify == 1) {
226227
heartRateService.SubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
228+
motionService.SubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
227229
}
228230
else if(event->subscribe.prev_notify == 1 && event->subscribe.cur_notify == 0) {
229231
heartRateService.UnsubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
232+
motionService.UnsubscribeNotification(event->subscribe.conn_handle, event->subscribe.attr_handle);
230233
}
231234
break;
232235

0 commit comments

Comments
 (0)