diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2020-12-22 13:06:16 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-12-23 10:08:00 +1100 |
commit | f7aafc0628f2008d015b32b0c0253a13f748d436 (patch) | |
tree | c74fc3a0fa169d4bf41eb555e72ea7f2e7358833 | |
parent | f42a190247661e1e5aa18e0ce93c627fd7676d8e (diff) |
extmod/nimble: Don't assert on save-IRK failure.
-rw-r--r-- | extmod/nimble/modbluetooth_nimble.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/extmod/nimble/modbluetooth_nimble.c b/extmod/nimble/modbluetooth_nimble.c index 843886d00..9ceeab7d7 100644 --- a/extmod/nimble/modbluetooth_nimble.c +++ b/extmod/nimble/modbluetooth_nimble.c @@ -227,7 +227,9 @@ STATIC int load_irk(void) { } 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)) { - 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"); rc = ble_hs_pvcy_set_our_irk(rand_irk); |