10000 extmod/nimble: Don't assert on save-IRK failure. · jimmo/micropython@f7aafc0 · GitHub
[go: up one dir, main page]

Skip to content

Commit f7aafc0

Browse files
jimmodpgeorge
authored andcommitted
extmod/nimble: Don't assert on save-IRK failure.
1 parent f42a190 commit f7aafc0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extmod/nimble/modbluetooth_nimble.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ STATIC int load_irk(void) {
227227
}
228228
DEBUG_printf("load_irk: Saving new IRK.\n");
229229
if (!mp_bluetooth_gap_on_set_secret(SECRET_TYPE_OUR_IRK, key, sizeof(key), rand_irk, 16)) {
230-
return BLE_HS_EINVAL;
230+
// Code that doesn't implement pairing/bonding won't support set/get secret.
231+
// So they'll just get the default fixed IRK.
232+
return 0;
231233
}
232234
DEBUG_printf("load_irk: Applying new IRK.\n");
233235
rc = ble_hs_pvcy_set_our_irk(rand_irk);

0 commit comments

Comments
 (0)
0