fix(ble/bluedroid): Fixed issue with resetting BLE security parameters during initialization

This commit is contained in:
zhanghaipeng 2024-06-04 15:49:33 +08:00
parent 04220bda1b
commit 1df847e2a0
3 changed files with 16 additions and 0 deletions

View File

@ -52,6 +52,18 @@ tBTE_APPL_CFG bte_appl_cfg = {
BTM_BLE_ONLY_ACCEPT_SPECIFIED_SEC_AUTH_DISABLE,
BTM_BLE_OOB_DISABLE,
};
void bta_dm_co_security_param_init(void)
{
bte_appl_cfg.ble_auth_req = BTA_LE_AUTH_REQ_SC_MITM_BOND;
bte_appl_cfg.ble_io_cap = BTM_LOCAL_IO_CAPS_BLE;
bte_appl_cfg.ble_init_key = BTM_BLE_INITIATOR_KEY_SIZE;
bte_appl_cfg.ble_resp_key = BTM_BLE_RESPONDER_KEY_SIZE;
bte_appl_cfg.ble_max_key_size = BTM_BLE_MAX_KEY_SIZE;
bte_appl_cfg.ble_min_key_size = BTM_BLE_MIN_KEY_SIZE;
bte_appl_cfg.ble_accept_auth_enable = BTM_BLE_ONLY_ACCEPT_SPECIFIED_SEC_AUTH_DISABLE;
bte_appl_cfg.oob_support = BTM_BLE_OOB_DISABLE;
};
#endif
#if (defined CLASSIC_BT_INCLUDED && CLASSIC_BT_INCLUDED == TRUE)

View File

@ -1797,6 +1797,9 @@ extern void bta_dm_ble_set_scan_rsp_raw (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_broadcast (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data);
extern void bta_dm_ble_update_duplicate_exceptional_list(tBTA_DM_MSG *p_data);
#if SMP_INCLUDED == TRUE
extern void bta_dm_co_security_param_init(void);
#endif
#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
extern void bta_dm_cfg_filter_cond (tBTA_DM_MSG *p_data);
extern void bta_dm_scan_filter_param_setup (tBTA_DM_MSG *p_data);

View File

@ -60,6 +60,7 @@ static void btc_init_bluetooth(void)
#if (BLE_INCLUDED == TRUE)
//load the ble local key which has been stored in the flash
btc_dm_load_ble_local_keys();
bta_dm_co_security_param_init();
#endif ///BLE_INCLUDED == TRUE
#endif /* #if (SMP_INCLUDED) */
#if BTA_DYNAMIC_MEMORY