diff options
| author | JF <jf@codingfield.com> | 2020-05-24 16:51:50 +0200 |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-05-24 16:51:50 +0200 |
| commit | 073717980f5c00f553ac3b58a50b792b32a14c7a (patch) | |
| tree | 8eeafef1f4150a1cf238ee80e53c8901b0ec67af /src/Components/Ble/NimbleController.cpp | |
| parent | 331481cd0c6ba804860f7cdbd5110a87ff0160fe (diff) | |
| parent | be1ad9b07083e656a649d223750ff4b14b781b7b (diff) | |
Merge develop
Diffstat (limited to 'src/Components/Ble/NimbleController.cpp')
| -rw-r--r-- | src/Components/Ble/NimbleController.cpp | 16 |
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, |
