Merge branch 'bugfix/wifi_prov_mgr_conn_issue' into 'master'

NimBLE: Fixed device disconnection issue of wifi prov mgr

Closes IDF-4655

See merge request espressif/esp-idf!17236
This commit is contained in:
Isha Pardikar
2022-03-24 15:35:49 +05:30
committed by Rahul Tank
parent 8075f44178
commit e751cbe6c0
7 changed files with 49 additions and 14 deletions
@@ -269,11 +269,12 @@ esp_err_t simple_ble_start(simple_ble_cfg_t *cfg)
ESP_LOGD(TAG, "Free mem at end of simple_ble_init %d", esp_get_free_heap_size());
/* set the security iocap & auth_req & key size & init key response key parameters to the stack*/
esp_ble_auth_req_t auth_req;
esp_ble_auth_req_t auth_req= ESP_LE_AUTH_REQ_MITM;
if (cfg->ble_bonding) {
auth_req = ESP_LE_AUTH_REQ_SC_MITM_BOND; //bonding with peer device after authentication
} else {
auth_req = ESP_LE_AUTH_REQ_SC_MITM;
auth_req |= ESP_LE_AUTH_BOND; //bonding with peer device after authentication
}
if (cfg->ble_sm_sc) {
auth_req |= ESP_LE_AUTH_REQ_SC_ONLY;
}
esp_ble_io_cap_t iocap = ESP_IO_CAP_NONE; //set the IO capability to No output No input
uint8_t key_size = 16; //the key size should be 7~16 bytes
@@ -49,8 +49,10 @@ typedef struct {
simple_ble_cb_t *connect_fn;
/** MTU set callback */
simple_ble_cb_t *set_mtu_fn;
/* BLE bonding */
unsigned ble_bonding:1;
/** BLE bonding */
unsigned ble_bonding:1;
/** BLE Secure Connection flag */
unsigned ble_sm_sc:1;
} simple_ble_cfg_t;