From 65a1e6c272f23aa93cf865c0ecbaae650c7a298a Mon Sep 17 00:00:00 2001 From: Zhang Hai Peng Date: Wed, 30 Oct 2024 15:24:32 +0800 Subject: [PATCH 1/2] fix(ble/bluedroid): Support enable BLE topology check by API (cherry picked from commit dbc94c70562ad1f9734424a8cf20787d72d37a3d) Co-authored-by: zhanghaipeng --- components/bt/host/bluedroid/stack/btm/btm_ble_gap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c b/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c index b34676c68c..5fdd3a5614 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c +++ b/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c @@ -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; From 9f4d895143a315855c74994523b0b0973ce26d0b Mon Sep 17 00:00:00 2001 From: Zhang Hai Peng Date: Wed, 30 Oct 2024 15:24:49 +0800 Subject: [PATCH 2/2] fix(ble/bluedroid): Fixed crash issue in BLE SMP when a disconnection process is ongoing (cherry picked from commit 76e1650161a019bca22c2855ab37f11608f130bd) Co-authored-by: zhanghaipeng --- components/bt/host/bluedroid/stack/smp/smp_utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/bt/host/bluedroid/stack/smp/smp_utils.c b/components/bt/host/bluedroid/stack/smp/smp_utils.c index 2e9fac77c9..48ba6c0ae3 100644 --- a/components/bt/host/bluedroid/stack/smp/smp_utils.c +++ b/components/bt/host/bluedroid/stack/smp/smp_utils.c @@ -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;