Skip to content

Commit b7c6717

Browse files
committed
MotionService: Fix step notification on sleep
Send btuetooth step notifications in sleep state just like motion notifications. Rename check function from IsMotionNotificationSubscribed to IsAnyNotificationSubscribed for clarity.
1 parent c0638c6 commit b7c6717

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/components/ble/MotionService.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ void MotionService::UnsubscribeNotification(uint16_t attributeHandle) {
121121
motionValuesNoficationEnabled = false;
122122
}
123123

124-
bool MotionService::IsMotionNotificationSubscribed() const {
125-
return motionValuesNoficationEnabled;
124+
bool MotionService::IsAnyNotificationSubscribed() const {
125+
return stepCountNoficationEnabled || motionValuesNoficationEnabled;
126126
}

src/components/ble/MotionService.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Pinetime {
2121

2222
void SubscribeNotification(uint16_t attributeHandle);
2323
void UnsubscribeNotification(uint16_t attributeHandle);
24-
bool IsMotionNotificationSubscribed() const;
24+
bool IsAnyNotificationSubscribed() const;
2525

2626
private:
2727
NimbleController& nimble;

src/systemtask/SystemTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ void SystemTask::UpdateMotion() {
434434
// AOD needs motion on to show up to date step counts
435435
if (state == SystemTaskState::Sleeping && !(settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::RaiseWrist) ||
436436
settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::Shake) ||
437-
motionController.GetService()->IsMotionNotificationSubscribed())) {
437+
motionController.GetService()->IsAnyNotificationSubscribed())) {
438438
return;
439439
}
440440

0 commit comments

Comments
 (0)