11#include " components/ble/MotionService.h"
22#include " components/motion/MotionController.h"
3- #include " systemtask/SystemTask .h"
3+ #include " components/ble/NimbleController .h"
44#include < nrf_log.h>
55
66using namespace Pinetime ::Controllers;
@@ -28,8 +28,8 @@ namespace {
2828}
2929
3030// TODO Refactoring - remove dependency to SystemTask
31- MotionService::MotionService (Pinetime::System::SystemTask& system , Controllers::MotionController& motionController)
32- : system {system },
31+ MotionService::MotionService (NimbleController& nimble , Controllers::MotionController& motionController)
32+ : nimble {nimble },
3333 motionController {motionController},
3434 characteristicDefinition {{.uuid = &stepCountCharUuid.u ,
3535 .access_cb = MotionServiceCallback,
@@ -82,7 +82,7 @@ void MotionService::OnNewStepCountValue(uint32_t stepCount) {
8282 uint32_t buffer = stepCount;
8383 auto * om = ble_hs_mbuf_from_flat (&buffer, 4 );
8484
85- uint16_t connectionHandle = system. nimble () .connHandle ();
85+ uint16_t connectionHandle = nimble.connHandle ();
8686
8787 if (connectionHandle == 0 || connectionHandle == BLE_HS_CONN_HANDLE_NONE) {
8888 return ;
@@ -98,7 +98,7 @@ void MotionService::OnNewMotionValues(int16_t x, int16_t y, int16_t z) {
9898 int16_t buffer[3 ] = {x, y, z};
9999 auto * om = ble_hs_mbuf_from_flat (buffer, 3 * sizeof (int16_t ));
100100
101- uint16_t connectionHandle = system. nimble () .connHandle ();
101+ uint16_t connectionHandle = nimble.connHandle ();
102102
103103 if (connectionHandle == 0 || connectionHandle == BLE_HS_CONN_HANDLE_NONE) {
104104 return ;
0 commit comments