aboutsummaryrefslogtreecommitdiffstats
path: root/src/Components/Ble/NimbleController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Components/Ble/NimbleController.cpp')
-rw-r--r--src/Components/Ble/NimbleController.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Components/Ble/NimbleController.cpp b/src/Components/Ble/NimbleController.cpp
index d2ee4801..7a7753b1 100644
--- a/src/Components/Ble/NimbleController.cpp
+++ b/src/Components/Ble/NimbleController.cpp
@@ -33,7 +33,9 @@ NimbleController::NimbleController(Pinetime::System::SystemTask& systemTask,
spiNorFlash{spiNorFlash},
dfuService{systemTask, bleController, spiNorFlash},
currentTimeClient{dateTimeController},
- alertNotificationClient{systemTask, notificationManager} {
+ alertNotificationClient{systemTask, notificationManager},
+ anService{systemTask, notificationManager},
+ currentTimeService{dateTimeController} {
}
@@ -76,6 +78,11 @@ void NimbleController::Init() {
ble_svc_gatt_init();
deviceInformationService.Init();
+ currentTimeClient.Init();
+ currentTimeService.Init();
+
+ anService.Init();
+
dfuService.Init();
int res;
res = ble_hs_util_ensure_addr(0);
@@ -131,7 +138,12 @@ void NimbleController::StartAdvertising() {
res = ble_gap_adv_start(addrType, NULL, 10000,
&adv_params, GAPEventCallback, this);
-// ASSERT(res == 0);
+// ASSERT(res == 0);// TODO I've disabled these ASSERT as they sometime asserts and reset the mcu.
+ // For now, the advertising is restarted as soon as it ends. There may be a race condition
+ // that prevent the advertising from restarting reliably.
+ // I remove the assert to prevent this uncesseray crash, but in the long term, the management of
+ // the advertising should be improve (better error handling, and advertise for 3 minutes after
+ // the application has been woken up, for example.
}
int OnAllSvrDisco(uint16_t conn_handle,