From 1437bb1206e8acc87d70796ac915d6908faad417 Mon Sep 17 00:00:00 2001 From: Zhang Hai Peng Date: Mon, 23 Sep 2024 11:13:26 +0800 Subject: [PATCH 1/3] fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(e9ae856) - Fixed BLE scan assert in lld_scan.c 1728 (cherry picked from commit 32c7694f5657938c7b853a234586ff3887424aed) Co-authored-by: zhanghaipeng --- 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 b8ef2c474d..5c91317136 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit b8ef2c474d392a88ea7e6626f89acf1fa5f30e4a +Subproject commit 5c913171361dac0821e15e83cc0cf604149e1b84 From 34771563b95b87b16215abf6409a7df81b208cf2 Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Thu, 30 May 2024 14:37:04 +0800 Subject: [PATCH 2/3] test(bt/bluedroid): Support to disable BLE address resolution --- .../bt/host/bluedroid/stack/btm/btm_ble_addr.c | 12 ++++++++++++ components/bt/host/bluedroid/stack/btm/btm_main.c | 8 ++++++++ .../bt/host/bluedroid/stack/btm/include/btm_int.h | 1 + 3 files changed, 21 insertions(+) diff --git a/components/bt/host/bluedroid/stack/btm/btm_ble_addr.c b/components/bt/host/bluedroid/stack/btm/btm_ble_addr.c index d7ed2095cd..60548a76ba 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_ble_addr.c +++ b/components/bt/host/bluedroid/stack/btm/btm_ble_addr.c @@ -384,6 +384,10 @@ static BOOLEAN btm_ble_match_random_bda(tBTM_SEC_DEV_REC *p_dev_rec) void btm_ble_resolve_random_addr(BD_ADDR random_bda, tBTM_BLE_RESOLVE_CBACK *p_cback, void *p) { #if (SMP_INCLUDED == TRUE) + if (btm_cb.addr_res_en == FALSE) { + return; + } + tBTM_LE_RANDOM_CB *p_mgnt_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb; list_node_t *p_node = NULL; tBTM_SEC_DEV_REC *p_dev_rec = NULL; @@ -458,6 +462,10 @@ tBTM_SEC_DEV_REC *btm_find_dev_by_identity_addr(BD_ADDR bd_addr, UINT8 addr_type BOOLEAN btm_identity_addr_to_random_pseudo(BD_ADDR bd_addr, UINT8 *p_addr_type, BOOLEAN refresh) { #if BLE_PRIVACY_SPT == TRUE + if (btm_cb.addr_res_en == FALSE) { + return TRUE; + } + tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev_by_identity_addr(bd_addr, *p_addr_type); BTM_TRACE_EVENT ("%s", __func__); @@ -491,6 +499,10 @@ BOOLEAN btm_identity_addr_to_random_pseudo(BD_ADDR bd_addr, UINT8 *p_addr_type, BOOLEAN btm_random_pseudo_to_identity_addr(BD_ADDR random_pseudo, UINT8 *p_static_addr_type) { #if BLE_PRIVACY_SPT == TRUE + if (btm_cb.addr_res_en == FALSE) { + return TRUE; + } + tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (random_pseudo); if (p_dev_rec != NULL) { diff --git a/components/bt/host/bluedroid/stack/btm/btm_main.c b/components/bt/host/bluedroid/stack/btm/btm_main.c index 8e49aa3e6d..c7b5b8b6c0 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_main.c +++ b/components/bt/host/bluedroid/stack/btm/btm_main.c @@ -84,6 +84,7 @@ void btm_init (void) #if BLE_INCLUDED == TRUE btm_ble_lock_init(); btm_ble_sem_init(); + btm_cb.addr_res_en = TRUE; #endif btm_sec_dev_init(); #if (BLE_50_FEATURE_SUPPORT == TRUE) @@ -133,3 +134,10 @@ uint8_t btm_acl_active_count(void) return count; } + +void btm_ble_addr_resolve_enable(bool enable) +{ +#if (BLE_INCLUDED == TRUE) + btm_cb.addr_res_en = enable; +#endif +} diff --git a/components/bt/host/bluedroid/stack/btm/include/btm_int.h b/components/bt/host/bluedroid/stack/btm/include/btm_int.h index da2f9ebbb9..b5766dbf87 100644 --- a/components/bt/host/bluedroid/stack/btm/include/btm_int.h +++ b/components/bt/host/bluedroid/stack/btm/include/btm_int.h @@ -884,6 +884,7 @@ typedef struct { UINT16 ediv; /* received ediv value from LTK request */ UINT8 key_size; tBTM_BLE_VSC_CB cmn_ble_vsc_cb; + BOOLEAN addr_res_en; /* internal use for test: address resolution enable/disable */ #endif /* Packet types supported by the local device */ From 7e31cdd75e2727cb883de09dee9c233a085b66c8 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Sat, 21 Sep 2024 10:43:16 +0800 Subject: [PATCH 3/3] fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(63eb54d) - Fixed issue where RPA is not updated after BLE RPA timeout --- 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 5c91317136..061e70c319 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit 5c913171361dac0821e15e83cc0cf604149e1b84 +Subproject commit 061e70c319576bf28b5695f5478dbe01ad18b18d