From d2ebe4e7bb8277086c6b74d992806dde5430d395 Mon Sep 17 00:00:00 2001 From: zwj Date: Fri, 30 Sep 2022 15:07:24 +0800 Subject: [PATCH 1/3] Fixed ESP32 BLE assert(32 0) --- components/bt/controller/lib_esp32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32 b/components/bt/controller/lib_esp32 index eac5f09163..6ca6561fe5 160000 --- a/components/bt/controller/lib_esp32 +++ b/components/bt/controller/lib_esp32 @@ -1 +1 @@ -Subproject commit eac5f0916361e7809af4b65144a8a7f0cc44b9c8 +Subproject commit 6ca6561fe525171cbb96eb9d98b7db91137982dc From 94c74bd866a638d1ac6007df57fff3c4d69536d4 Mon Sep 17 00:00:00 2001 From: zwj Date: Fri, 30 Sep 2022 15:45:37 +0800 Subject: [PATCH 2/3] Fixed BLE lld_per_adv.c line 401 assert --- components/bt/controller/lib_esp32c3_family | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32c3_family b/components/bt/controller/lib_esp32c3_family index 420ae1726d..43b48d75e7 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit 420ae1726dede6bbd4f3393744a8f3a252330b6a +Subproject commit 43b48d75e7e468c0cccd038721e1184dae6aabac From 290a6c8ade4fa33ee7c779475e8d93d51cdb8f78 Mon Sep 17 00:00:00 2001 From: zwj Date: Thu, 22 Sep 2022 22:01:58 +0800 Subject: [PATCH 3/3] allow bluedroid host to report adv_ind separately --- components/bt/host/bluedroid/Kconfig.in | 2 +- .../bt/host/bluedroid/stack/btm/btm_ble_gap.c | 29 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/components/bt/host/bluedroid/Kconfig.in b/components/bt/host/bluedroid/Kconfig.in index a1ed479b7f..23c7a99b69 100644 --- a/components/bt/host/bluedroid/Kconfig.in +++ b/components/bt/host/bluedroid/Kconfig.in @@ -1022,7 +1022,7 @@ config BT_SMP_ENABLE config BT_BLE_ACT_SCAN_REP_ADV_SCAN bool "Report adv data and scan response individually when BLE active scan" - depends on BT_BLUEDROID_ENABLED && (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) + depends on BT_BLUEDROID_ENABLED && BT_BLE_ENABLED default n help Originally, when doing BLE active scan, Bluedroid will not report adv to application layer 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 ef332e836c..1b96d93773 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c +++ b/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c @@ -3675,21 +3675,20 @@ static void btm_ble_process_adv_pkt_cont(BD_ADDR bda, UINT8 addr_type, UINT8 evt 0x04 Scan Response (SCAN_RSP) 0x05-0xFF Reserved for future use */ - //if scan duplicate is enabled, the adv packet without scan response is allowed to report to higher layer - if(p_le_inq_cb->scan_duplicate_filter == BTM_BLE_SCAN_DUPLICATE_ENABLE) { - /* - Bluedroid will put the advertising packet and scan response into a packet and send it to the higher layer. - If two advertising packets are not with the same address, or can't be combined into a packet, then the first advertising - packet will be discarded. So we added the following judgment: - 1. For different addresses, send the last advertising packet to higher layer - 2. For same address and same advertising type (not scan response), send the last advertising packet to higher layer - 3. For same address and scan response, do nothing - */ - int same_addr = memcmp(bda, p_le_inq_cb->adv_addr, BD_ADDR_LEN); - if (same_addr != 0 || (same_addr == 0 && evt_type != BTM_BLE_SCAN_RSP_EVT)) { - btm_ble_process_last_adv_pkt(); - } - } + // The adv packet without scan response is allowed to report to higher layer + /* + Bluedroid will put the advertising packet and scan response into a packet and send it to the higher layer. + If two advertising packets are not with the same address, or can't be combined into a packet, then the first advertising + packet will be discarded. So we added the following judgment: + 1. For different addresses, send the last advertising packet to higher layer + 2. For same address and same advertising type (not scan response), send the last advertising packet to higher layer + 3. For same address and scan response, do nothing + */ + int same_addr = memcmp(bda, p_le_inq_cb->adv_addr, BD_ADDR_LEN); + if (same_addr != 0 || (same_addr == 0 && evt_type != BTM_BLE_SCAN_RSP_EVT)) { + btm_ble_process_last_adv_pkt(); + } + p_i = btm_inq_db_find (bda);