aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ble/MotionService.cpp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2023-03-15 10:26:12 +0200
committerRiku Isokoski <riksu9000@gmail.com>2023-03-19 12:41:01 +0200
commit7c98f26f1294b7f78156be5682c9633d69ba983d (patch)
tree2fd9e291802bb6241264ad58451296687a4946d6 /src/components/ble/MotionService.cpp
parentca5e7d1adfda9426065b182571e8ed1f0b1184e3 (diff)
MotionService: Remove SystemTask dependency
Diffstat (limited to 'src/components/ble/MotionService.cpp')
-rw-r--r--src/components/ble/MotionService.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/ble/MotionService.cpp b/src/components/ble/MotionService.cpp
index 604f22d5..029be894 100644
--- a/src/components/ble/MotionService.cpp
+++ b/src/components/ble/MotionService.cpp
@@ -1,6 +1,6 @@
#include "components/ble/MotionService.h"
#include "components/motion/MotionController.h"
-#include "systemtask/SystemTask.h"
+#include "components/ble/NimbleController.h"
#include <nrf_log.h>
using namespace Pinetime::Controllers;
@@ -28,8 +28,8 @@ namespace {
}
// TODO Refactoring - remove dependency to SystemTask
-MotionService::MotionService(Pinetime::System::SystemTask& system, Controllers::MotionController& motionController)
- : system {system},
+MotionService::MotionService(NimbleController& nimble, Controllers::MotionController& motionController)
+ : nimble {nimble},
motionController {motionController},
characteristicDefinition {{.uuid = &stepCountCharUuid.u,
.access_cb = MotionServiceCallback,
@@ -82,7 +82,7 @@ void MotionService::OnNewStepCountValue(uint32_t stepCount) {
uint32_t buffer = stepCount;
auto* om = ble_hs_mbuf_from_flat(&buffer, 4);
- uint16_t connectionHandle = system.nimble().connHandle();
+ uint16_t connectionHandle = nimble.connHandle();
if (connectionHandle == 0 || connectionHandle == BLE_HS_CONN_HANDLE_NONE) {
return;
@@ -98,7 +98,7 @@ void MotionService::OnNewMotionValues(int16_t x, int16_t y, int16_t z) {
int16_t buffer[3] = {x, y, z};
auto* om = ble_hs_mbuf_from_flat(buffer, 3 * sizeof(int16_t));
- uint16_t connectionHandle = system.nimble().connHandle();
+ uint16_t connectionHandle = nimble.connHandle();
if (connectionHandle == 0 || connectionHandle == BLE_HS_CONN_HANDLE_NONE) {
return;