Fix failure to reconnect to device when bonded.

iOS devices specifically expect to receive the ID key of the bonded device even when RPA is not used.
This sets the default value of the key distribution config to provide the ID key as well as the encryption key.
This commit is contained in:
h2zero 2024-06-02 09:00:07 -06:00 committed by h2zero
parent f36929963d
commit 44daa3c687

View file

@ -908,8 +908,8 @@ void NimBLEDevice::init(const std::string &deviceName) {
ble_hs_cfg.sm_bonding = 0; ble_hs_cfg.sm_bonding = 0;
ble_hs_cfg.sm_mitm = 0; ble_hs_cfg.sm_mitm = 0;
ble_hs_cfg.sm_sc = 1; ble_hs_cfg.sm_sc = 1;
ble_hs_cfg.sm_our_key_dist = 1; ble_hs_cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC | BLE_SM_PAIR_KEY_DIST_ID;
ble_hs_cfg.sm_their_key_dist = 3; ble_hs_cfg.sm_their_key_dist = BLE_SM_PAIR_KEY_DIST_ENC | BLE_SM_PAIR_KEY_DIST_ID;
ble_hs_cfg.store_status_cb = ble_store_util_status_rr; /*TODO: Implement handler for this*/ ble_hs_cfg.store_status_cb = ble_store_util_status_rr; /*TODO: Implement handler for this*/