Merge branch 'bugfix/fix_ble_adv_start_fail_v5.2' into 'release/v5.2'

fix(ble/bluedroid): Fixed crash issue in BLE SMP when a disconnection process is ongoing(v5.2)

See merge request espressif/esp-idf!34527
This commit is contained in:
Island 2024-11-05 16:37:02 +08:00
commit 36dffb8f25
2 changed files with 9 additions and 3 deletions

View File

@ -4617,6 +4617,12 @@ void btm_ble_free (void)
#endif
}
static bool enable_topology_check_flag = true;
void esp_qa_enable_topology_check(bool enable)
{
// This is a workaround: If the topology check is disabled, the 'Supported States' will not be checked.
enable_topology_check_flag = enable;
}
/*******************************************************************************
**
** Function btm_ble_topology_check
@ -4629,6 +4635,7 @@ void btm_ble_free (void)
*******************************************************************************/
BOOLEAN btm_ble_topology_check(tBTM_BLE_STATE_MASK request_state_mask)
{
if(!enable_topology_check_flag) return TRUE;
BOOLEAN rt = FALSE;
UINT8 state_offset = 0;

View File

@ -331,8 +331,7 @@ BOOLEAN smp_send_msg_to_L2CAP(BD_ADDR rem_bda, BT_HDR *p_toL2CAP)
if ((l2cap_ret = L2CA_SendFixedChnlData (fixed_cid, rem_bda, p_toL2CAP)) == L2CAP_DW_FAILED) {
smp_cb.total_tx_unacked -= 1;
SMP_TRACE_ERROR("SMP failed to pass msg:0x%0x to L2CAP",
*((UINT8 *)(p_toL2CAP + 1) + p_toL2CAP->offset));
SMP_TRACE_ERROR("SMP failed to pass msg to L2CAP");
return FALSE;
} else {
return TRUE;
@ -1125,7 +1124,7 @@ BOOLEAN smp_pairing_request_response_parameters_are_valid(tSMP_CB *p_cb)
SMP_TRACE_DEBUG("%s for cmd code 0x%02x\n", __func__, p_cb->rcvd_cmd_code);
if (io_caps >= BTM_IO_CAP_MAX) {
SMP_TRACE_WARNING("Rcvd from the peer cmd 0x%02x with IO Capabilty \
SMP_TRACE_WARNING("Rcvd from the peer cmd 0x%02x with IO Capability \
value (0x%02x) out of range).\n",
p_cb->rcvd_cmd_code, io_caps);
return FALSE;