software update service now registered with NimBLE

This commit is contained in:
geeksville
2020-07-24 11:39:30 -07:00
parent a5b7501a4e
commit 204f2c1a68
6 changed files with 164 additions and 102 deletions

View File

@@ -136,8 +136,15 @@ void bluetoothRebootCheck()
See bluetooth-api.md
*/
void createUpdateService()
void reinitUpdateService()
{
if (!updateLock)
updateLock = new concurrency::Lock();
auto res = ble_gatts_count_cfg(gatt_update_svcs); // assigns handles? see docstring for note about clearing the handle list
// before calling SLEEP SUPPORT
assert(res == 0);
res = ble_gatts_add_svcs(gatt_update_svcs);
assert(res == 0);
}