BLE Host - Don't crash if no store package.

Prior to this change: the host asserted that IRK restoration succeeds at
sync time.  A common reason for failure was the lack of any host store
package in the build.

After change: If IRK restoration at startup fails for any reason, a
message is logged and the app continues running.

X-Original-Commit: 3e6ff4de76f6cc486ad7c7a545c3f8b4aac01e82
This commit is contained in:
Christopher Collins
2017-12-19 11:18:02 -08:00
parent 5dc94ac602
commit 93d58b045a
+4 -1
View File
@@ -313,7 +313,10 @@ ble_hs_sync(void)
if (rc == 0) {
rc = ble_hs_misc_restore_irks();
assert(rc == 0);
if (rc != 0) {
BLE_HS_LOG(INFO, "Failed to restore IRKs from store; status=%d",
rc);
}
if (ble_hs_cfg.sync_cb != NULL) {
ble_hs_cfg.sync_cb();