summaryrefslogtreecommitdiff
path: root/src/components/ble/HeartRateService.cpp
diff options
context:
space:
mode:
authorFinlay Davidson <finlay.davidson@coderclass.nl>2022-05-09 17:16:08 +0200
committerRiku Isokoski <riksu9000@gmail.com>2022-06-05 09:15:46 +0300
commit7f45538eb53235ab4015fcf13533796c8759c7bc (patch)
tree79d9a2f60e8fb13cb5356bcc5c6e93259449530b /src/components/ble/HeartRateService.cpp
parent718fbdab98ae80923a548ac03b7843f5d618a4f6 (diff)
Apply clang-format to all C++ files
Diffstat (limited to 'src/components/ble/HeartRateService.cpp')
-rw-r--r--src/components/ble/HeartRateService.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/ble/HeartRateService.cpp b/src/components/ble/HeartRateService.cpp
index 4824a6b3..d49a02c8 100644
--- a/src/components/ble/HeartRateService.cpp
+++ b/src/components/ble/HeartRateService.cpp
@@ -57,7 +57,8 @@ int HeartRateService::OnHeartRateRequested(uint16_t connectionHandle, uint16_t a
}
void HeartRateService::OnNewHeartRateValue(uint8_t heartRateValue) {
- if(!heartRateMeasurementNotificationEnable) return;
+ if (!heartRateMeasurementNotificationEnable)
+ return;
uint8_t buffer[2] = {0, heartRateController.HeartRate()}; // [0] = flags, [1] = hr value
auto* om = ble_hs_mbuf_from_flat(buffer, 2);
@@ -72,11 +73,11 @@ void HeartRateService::OnNewHeartRateValue(uint8_t heartRateValue) {
}
void HeartRateService::SubscribeNotification(uint16_t connectionHandle, uint16_t attributeHandle) {
- if(attributeHandle == heartRateMeasurementHandle)
+ if (attributeHandle == heartRateMeasurementHandle)
heartRateMeasurementNotificationEnable = true;
}
void HeartRateService::UnsubscribeNotification(uint16_t connectionHandle, uint16_t attributeHandle) {
- if(attributeHandle == heartRateMeasurementHandle)
+ if (attributeHandle == heartRateMeasurementHandle)
heartRateMeasurementNotificationEnable = false;
} \ No newline at end of file