From 716deff7d0456cdd9eb1d152d3b29f1f39c7a231 Mon Sep 17 00:00:00 2001 From: Hunman Date: Sat, 8 Nov 2025 21:58:23 +0100 Subject: Step counter history Store 2 days steps history and display yesterday's steps on the Steps screen --- src/components/ble/MotionService.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/ble/MotionService.cpp') diff --git a/src/components/ble/MotionService.cpp b/src/components/ble/MotionService.cpp index 4b223c1e..44ad755f 100644 --- a/src/components/ble/MotionService.cpp +++ b/src/components/ble/MotionService.cpp @@ -64,7 +64,7 @@ int MotionService::OnStepCountRequested(uint16_t attributeHandle, ble_gatt_acces NRF_LOG_INFO("Motion-stepcount : handle = %d", stepCountHandle); uint32_t buffer = motionController.NbSteps(); - int res = os_mbuf_append(context->om, &buffer, 4); + int res = os_mbuf_append(context->om, &buffer, sizeof(buffer)); return (res == 0) ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; } if (attributeHandle == motionValuesHandle) { @@ -82,7 +82,7 @@ void MotionService::OnNewStepCountValue(uint32_t stepCount) { } uint32_t buffer = stepCount; - auto* om = ble_hs_mbuf_from_flat(&buffer, 4); + auto* om = ble_hs_mbuf_from_flat(&buffer, sizeof(buffer)); uint16_t connectionHandle = nimble.connHandle(); -- cgit v1.2.3-70-g09d2