I am using the WROVER-B dev kit and I'm trying to get my application to bond with various devices.
The initial bonding works fine (linux, android, ios).
The problem comes when I try to reconnect with ios and android.
Android manages to connect fine the second time, but in the logs I can see that the bonding operation was repeated, and it was not recognized as the previously bonded device.
With ios the second connection just fails until you manually remove the bond from within ios.
I can see that the mac address is different each time an android or ios device connects, and my understanding is that this is normal, and these addresses should be translated using the key information stored during bonding.
What I don't understand is why this isn't working. I assume this is something that should work automatically, or is there some callback I need to implement?
I am using the NIMBle bluetooth backend.
Here is the configuration:
Code: Select all
ble_hs_cfg.sync_cb = ble_periph_on_sync;
ble_hs_cfg.store_status_cb = ble_store_status_cb;
ble_hs_cfg.sm_io_cap = BLE_SM_IO_CAP_NO_IO;
ble_hs_cfg.sm_sc = 1;
ble_hs_cfg.sm_bonding = 1;
ble_hs_cfg.sm_mitm = 1;
ble_hs_cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC;
ble_hs_cfg.sm_their_key_dist = BLE_SM_PAIR_KEY_DIST_ENC;