Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 20, 2017

Conversation

ccollins476ad
Copy link
Contributor

Prior to this change: the host asserted that IRK restoration succeeds at sync time.

After change: If IRK restoration at startup fails because there is no store package present, don't crash.

@@ -313,7 +313,7 @@ ble_hs_sync(void)

if (rc == 0) {
rc = ble_hs_misc_restore_irks();
assert(rc == 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could add some info log saying that storage is not present?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rymanluk. I agree that we should log something on failure. I also think the assert() is a bit extreme, so I changed the code to log on failure but never crash.

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.
@ccollins476ad ccollins476ad merged commit 12b1b90 into apache:master Dec 20, 2017
@ccollins476ad ccollins476ad deleted the ble-hs-no-store branch December 20, 2017 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants