summaryrefslogtreecommitdiff
path: root/src/components/ble/MotionService.cpp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2022-12-30 23:31:31 +0200
committerRiku Isokoski <riksu9000@gmail.com>2023-01-24 10:43:17 +0200
commita3e14c012d76fc8f7ad4c16ad9dc67e8995ce10e (patch)
treeefd8d89f0d222d5db30e3cbd193e6d5f6111795b /src/components/ble/MotionService.cpp
parent8b0d888952bb3cfbf587ab20d5096f2e578a6107 (diff)
src: Enable unused parameter warning
Fix warnings. Some clang-formatting was necessary. DebugPins is unused and was removed.
Diffstat (limited to 'src/components/ble/MotionService.cpp')
-rw-r--r--src/components/ble/MotionService.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/ble/MotionService.cpp b/src/components/ble/MotionService.cpp
index a7e95923..604f22d5 100644
--- a/src/components/ble/MotionService.cpp
+++ b/src/components/ble/MotionService.cpp
@@ -21,9 +21,9 @@ namespace {
constexpr ble_uuid128_t stepCountCharUuid {CharUuid(0x01, 0x00)};
constexpr ble_uuid128_t motionValuesCharUuid {CharUuid(0x02, 0x00)};
- int MotionServiceCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt, void* arg) {
+ int MotionServiceCallback(uint16_t /*conn_handle*/, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt, void* arg) {
auto* motionService = static_cast<MotionService*>(arg);
- return motionService->OnStepCountRequested(conn_handle, attr_handle, ctxt);
+ return motionService->OnStepCountRequested(attr_handle, ctxt);
}
}
@@ -59,7 +59,7 @@ void MotionService::Init() {
ASSERT(res == 0);
}
-int MotionService::OnStepCountRequested(uint16_t connectionHandle, uint16_t attributeHandle, ble_gatt_access_ctxt* context) {
+int MotionService::OnStepCountRequested(uint16_t attributeHandle, ble_gatt_access_ctxt* context) {
if (attributeHandle == stepCountHandle) {
NRF_LOG_INFO("Motion-stepcount : handle = %d", stepCountHandle);
uint32_t buffer = motionController.NbSteps();
@@ -95,7 +95,7 @@ void MotionService::OnNewMotionValues(int16_t x, int16_t y, int16_t z) {
if (!motionValuesNoficationEnabled)
return;
- int16_t buffer[3] = {motionController.X(), motionController.Y(), motionController.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();
@@ -107,14 +107,14 @@ void MotionService::OnNewMotionValues(int16_t x, int16_t y, int16_t z) {
ble_gattc_notify_custom(connectionHandle, motionValuesHandle, om);
}
-void MotionService::SubscribeNotification(uint16_t connectionHandle, uint16_t attributeHandle) {
+void MotionService::SubscribeNotification(uint16_t attributeHandle) {
if (attributeHandle == stepCountHandle)
stepCountNoficationEnabled = true;
else if (attributeHandle == motionValuesHandle)
motionValuesNoficationEnabled = true;
}
-void MotionService::UnsubscribeNotification(uint16_t connectionHandle, uint16_t attributeHandle) {
+void MotionService::UnsubscribeNotification(uint16_t attributeHandle) {
if (attributeHandle == stepCountHandle)
stepCountNoficationEnabled = false;
else if (attributeHandle == motionValuesHandle)