summaryrefslogtreecommitdiff
path: root/src/components/ble/NimbleController.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-01-17 15:34:14 (GMT)
committerJean-François Milants <jf@codingfield.com>2021-01-17 15:34:14 (GMT)
commit68674cec53e2e2add1c0a0b109e5a0e7d9ed5479 (patch)
tree42adc40feadce3b1503ef2f4e736cf95a005b3ca /src/components/ble/NimbleController.cpp
parent3a3a14115a81b9dd2c6f839c0ad1b14d04367642 (diff)
Add heart rate BLE service.
Diffstat (limited to 'src/components/ble/NimbleController.cpp')
-rw-r--r--src/components/ble/NimbleController.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp
index a6f3cc3..608e230 100644
--- a/src/components/ble/NimbleController.cpp
+++ b/src/components/ble/NimbleController.cpp
@@ -22,7 +22,8 @@ NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask,
DateTime& dateTimeController,
Pinetime::Controllers::NotificationManager& notificationManager,
Controllers::Battery& batteryController,
- Pinetime::Drivers::SpiNorFlash& spiNorFlash) :
+ Pinetime::Drivers::SpiNorFlash& spiNorFlash,
+ Controllers::HeartRateController& heartRateController) :
systemTask{systemTask},
bleController{bleController},
dateTimeController{dateTimeController},
@@ -36,7 +37,8 @@ NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask,
musicService{systemTask},
batteryInformationService{batteryController},
immediateAlertService{systemTask, notificationManager},
- serviceDiscovery({&currentTimeClient, &alertNotificationClient}) {
+ serviceDiscovery({&currentTimeClient, &alertNotificationClient}),
+ heartRateService{systemTask, heartRateController} {
}
int GAPEventCallback(struct ble_gap_event *event, void *arg) {
@@ -58,6 +60,7 @@ void NimbleController::Init() {
dfuService.Init();
batteryInformationService.Init();
immediateAlertService.Init();
+ heartRateService.Init();
int res;
res = ble_hs_util_ensure_addr(0);
ASSERT(res == 0);