mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 00:50:24 +08:00
extmod/nimble: Don't assert on save-IRK failure.
This commit is contained in:
parent
f42a190247
commit
f7aafc0628
@ -227,7 +227,9 @@ STATIC int load_irk(void) {
|
|||||||
}
|
}
|
||||||
DEBUG_printf("load_irk: Saving new IRK.\n");
|
DEBUG_printf("load_irk: Saving new IRK.\n");
|
||||||
if (!mp_bluetooth_gap_on_set_secret(SECRET_TYPE_OUR_IRK, key, sizeof(key), rand_irk, 16)) {
|
if (!mp_bluetooth_gap_on_set_secret(SECRET_TYPE_OUR_IRK, key, sizeof(key), rand_irk, 16)) {
|
||||||
return BLE_HS_EINVAL;
|
// Code that doesn't implement pairing/bonding won't support set/get secret.
|
||||||
|
// So they'll just get the default fixed IRK.
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
DEBUG_printf("load_irk: Applying new IRK.\n");
|
DEBUG_printf("load_irk: Applying new IRK.\n");
|
||||||
rc = ble_hs_pvcy_set_our_irk(rand_irk);
|
rc = ble_hs_pvcy_set_our_irk(rand_irk);
|
||||||
|
Loading…
Reference in New Issue
Block a user