diff options
| author | apilat <github@tmp.pegazy.org> | 2022-06-30 15:52:57 +0100 |
|---|---|---|
| committer | FintasticMan <finlay.neon.kid@gmail.com> | 2024-01-23 14:58:21 +0100 |
| commit | a6cd3679eb1219865a215d0600c9703b198f9157 (patch) | |
| tree | 63aaf5b936818bb95633b47a78f2664a75590281 /src/components | |
| parent | 074df0526fb1b6b6a18a4a28416837c122fbef8b (diff) | |
Only inhibit sleep if motion notifications are enabled, not just Bluetooth
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/ble/MotionService.cpp | 4 | ||||
| -rw-r--r-- | src/components/ble/MotionService.h | 1 | ||||
| -rw-r--r-- | src/components/motion/MotionController.h | 4 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/components/ble/MotionService.cpp b/src/components/ble/MotionService.cpp index 029be894..1626a5bf 100644 --- a/src/components/ble/MotionService.cpp +++ b/src/components/ble/MotionService.cpp @@ -120,3 +120,7 @@ void MotionService::UnsubscribeNotification(uint16_t attributeHandle) { else if (attributeHandle == motionValuesHandle) motionValuesNoficationEnabled = false; } + +bool MotionService::IsMotionNotificationSubscribed() const { + return motionValuesNoficationEnabled; +} diff --git a/src/components/ble/MotionService.h b/src/components/ble/MotionService.h index e15cffe3..acc91e8d 100644 --- a/src/components/ble/MotionService.h +++ b/src/components/ble/MotionService.h @@ -21,6 +21,7 @@ namespace Pinetime { void SubscribeNotification(uint16_t attributeHandle); void UnsubscribeNotification(uint16_t attributeHandle); + bool IsMotionNotificationSubscribed() const; private: NimbleController& nimble; diff --git a/src/components/motion/MotionController.h b/src/components/motion/MotionController.h index 0aa7823e..b2e7e7fe 100644 --- a/src/components/motion/MotionController.h +++ b/src/components/motion/MotionController.h @@ -62,6 +62,10 @@ namespace Pinetime { this->service = service; } + Pinetime::Controllers::MotionService* GetService() const { + return service; + } + private: uint32_t nbSteps = 0; uint32_t currentTripSteps = 0; |
