aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ble
diff options
context:
space:
mode:
authorHunman <sanyi.exe@gmail.com>2025-11-08 21:58:23 +0100
committerGitHub <noreply@github.com>2025-11-08 20:58:23 +0000
commit716deff7d0456cdd9eb1d152d3b29f1f39c7a231 (patch)
tree8cb2e940071bf3a0db4219b326038ad85b30be68 /src/components/ble
parent9093d18efc1df0be5366444fd72129dae19b2f20 (diff)
Step counter history
Store 2 days steps history and display yesterday's steps on the Steps screen
Diffstat (limited to 'src/components/ble')
-rw-r--r--src/components/ble/MotionService.cpp4
1 files changed, 2 insertions, 2 deletions
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();