From 93d58b045a12e27b5de8ab2a0d36e4aa503469fd Mon Sep 17 00:00:00 2001 From: Christopher Collins Date: Mon, 18 Dec 2017 14:13:07 -0800 Subject: [PATCH] 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 --- nimble/host/src/ble_hs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nimble/host/src/ble_hs.c b/nimble/host/src/ble_hs.c index 46c086533..bcbb0382e 100644 --- a/nimble/host/src/ble_hs.c +++ b/nimble/host/src/ble_hs.c @@ -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();