From bd77f3d43624071466f321dc7a5b9c752ee9901e Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Thu, 13 Apr 2023 21:36:14 +0800 Subject: [PATCH 1/8] Update bt lib for ESP32-C3 and ESP32-S3 - Fixed non-connectable and non-scannable directed adv can't be scanned --- components/bt/controller/lib_esp32c3_family | 2 +- components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld | 2 ++ components/esp_rom/esp32s3/ld/esp32s3.rom.ld | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32c3_family b/components/bt/controller/lib_esp32c3_family index d83f7d618a..688cc3e5db 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit d83f7d618a7a86f4703b909f8fc0ddcf8fd48a89 +Subproject commit 688cc3e5db392cd8e80c84c20b86b5ad5a7eff64 diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld index 60fa15b7ea..a1d52e64ee 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld @@ -55,7 +55,9 @@ r_lld_ext_adv_dynamic_pti_get = 0x40001b40; r_lld_ext_adv_dynamic_aux_pti_process = 0x40001b44; r_lld_ext_adv_dynamic_pti_process = 0x40001b48; r_lld_adv_ext_pkt_prepare_set = 0x40001b4c; +/* r_lld_adv_ext_chain_none_construct = 0x40001b50; +*/ r_lld_adv_ext_chain_connectable_construct = 0x40001b54; /* r_lld_adv_ext_chain_scannable_construct = 0x40001b58; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld index 55b04b8111..372fd9ddeb 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -1667,7 +1667,9 @@ r_lld_ext_adv_dynamic_pti_get = 0x4000510c; r_lld_ext_adv_dynamic_aux_pti_process = 0x40005118; r_lld_ext_adv_dynamic_pti_process = 0x40005124; r_lld_adv_ext_pkt_prepare_set = 0x40005130; +/* r_lld_adv_ext_chain_none_construct = 0x4000513c; +*/ r_lld_adv_ext_chain_connectable_construct = 0x40005148; /* r_lld_adv_ext_chain_scannable_construct = 0x40005154; From 509fedeed09921ba7a8499cfe0f0b0f4fb052abc Mon Sep 17 00:00:00 2001 From: zwj Date: Fri, 14 Apr 2023 16:48:05 +0800 Subject: [PATCH 2/8] improve scan performance when scan and sync coexist on ESP32-C3 and ESP32-S3 --- 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 688cc3e5db..4f71ee7fab 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit 688cc3e5db392cd8e80c84c20b86b5ad5a7eff64 +Subproject commit 4f71ee7fab59e3114d0ac0144b38df973c90261e From f886e3c05727f61bf2be599e38d4ab630a302c4d Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Thu, 20 Apr 2023 14:46:05 +0800 Subject: [PATCH 3/8] Disable controller 5.0 feature bits if host 5.0 feature is not enabled --- components/bt/include/esp32c3/include/esp_bt.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/bt/include/esp32c3/include/esp_bt.h b/components/bt/include/esp32c3/include/esp_bt.h index 985e4181e3..3b62cf0215 100644 --- a/components/bt/include/esp32c3/include/esp_bt.h +++ b/components/bt/include/esp32c3/include/esp_bt.h @@ -157,13 +157,17 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status); #if defined (CONFIG_BT_BLE_50_FEATURES_SUPPORTED) || defined (CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT) #ifdef CONFIG_BT_BLE_50_FEATURES_SUPPORTED #define BT_CTRL_50_FEATURE_SUPPORT (CONFIG_BT_BLE_50_FEATURES_SUPPORTED) -#endif +#endif // CONFIG_BT_BLE_50_FEATURES_SUPPORTED #ifdef CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT #define BT_CTRL_50_FEATURE_SUPPORT (CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT) -#endif +#endif // CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT +#else +#if defined (CONFIG_BT_BLUEDROID_ENABLED) || defined (CONFIG_BT_NIMBLE_ENABLED) +#define BT_CTRL_50_FEATURE_SUPPORT (0) #else #define BT_CTRL_50_FEATURE_SUPPORT (1) -#endif +#endif // (CONFIG_BT_BLUEDROID_ENABLED) || (CONFIG_BT_NIMBLE_ENABLED) +#endif // (CONFIG_BT_BLE_50_FEATURES_SUPPORTED) || (CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT) #define AGC_RECORRECT_EN ((BT_CTRL_AGC_RECORRECT_EN << 0) | (BT_CTRL_CODED_AGC_RECORRECT <<1)) From 1ddc3a1d5c3d2936fd3672d9306cff4c2af50ef3 Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Fri, 28 Apr 2023 14:10:17 +0800 Subject: [PATCH 4/8] Update bt lib for ESP32-C3 and ESP32-S3 - Fixed ble hopping selection for connection when disabled 5.0 feature --- 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 4f71ee7fab..a17e093350 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit 4f71ee7fab59e3114d0ac0144b38df973c90261e +Subproject commit a17e093350f31d09b8bcbfaad40b5b35535ea97b From 31166e0884afde745b8b47af48c3e9182cd5da83 Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Fri, 5 May 2023 21:54:01 +0800 Subject: [PATCH 5/8] Update bt lib for ESP32-C3 and ESP32-S3 - Fixed remote mic error during encryption procedure --- 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 a17e093350..d7513ebe88 160000 --- a/components/bt/controller/lib_esp32c3_family +++ b/components/bt/controller/lib_esp32c3_family @@ -1 +1 @@ -Subproject commit a17e093350f31d09b8bcbfaad40b5b35535ea97b +Subproject commit d7513ebe88d7d207f6c062ce9381d347a0a70918 From ecc2cc1be0a2ef7952b57c2136b0aa1c04d96897 Mon Sep 17 00:00:00 2001 From: zwj Date: Sun, 23 Apr 2023 16:01:36 +0800 Subject: [PATCH 6/8] Fixed no error report when own address type is rpa_random and no random address setting --- components/bt/host/bluedroid/stack/btm/btm_ble_gap.c | 11 +++++++++++ 1 file changed, 11 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 1a5b482be5..573751dbf7 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c +++ b/components/bt/host/bluedroid/stack/btm/btm_ble_gap.c @@ -1068,7 +1068,18 @@ uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK * #else uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK *cb) { + if((*own_bda_type == BLE_ADDR_RANDOM) || (*own_bda_type == BLE_ADDR_RANDOM_ID)) { + if((btm_cb.ble_ctr_cb.addr_mgnt_cb.exist_addr_bit & BTM_BLE_GAP_ADDR_BIT_RANDOM) != BTM_BLE_GAP_ADDR_BIT_RANDOM) { + BTM_TRACE_ERROR("No random address yet, please set random address and try\n"); + if(cb) { + (* cb)(HCI_ERR_ESP_VENDOR_FAIL); + } + return BTM_ILLEGAL_VALUE; + } + } + btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type = *own_bda_type; + return BTM_SUCCESS; } #endif From c76c6508a12489671580d40a0d9156693b932af3 Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Sun, 23 Apr 2023 11:15:57 +0800 Subject: [PATCH 7/8] Fixed battery profile wrong condition --- .../btc/profile/std/battery/battery_prf.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/components/bt/host/bluedroid/btc/profile/std/battery/battery_prf.c b/components/bt/host/bluedroid/btc/profile/std/battery/battery_prf.c index 5a03aab553..cca2faa95c 100644 --- a/components/bt/host/bluedroid/btc/profile/std/battery/battery_prf.c +++ b/components/bt/host/bluedroid/btc/profile/std/battery/battery_prf.c @@ -112,12 +112,13 @@ static void bas_gatts_callback(esp_gatts_evt_t event, tBTA_GATTS *p_data) p_data->add_result.char_uuid.uu.uuid16); UINT16 char_uuid = p_data->add_result.char_uuid.uu.uuid16; UINT16 service_id = p_data->add_result.service_id; - if (char_uuid == GATT_UUID_BATTERY_LEVEL) { - bas_AddCharDescr(service_id, p_data->add_result.attr_id); - } - if (char_uuid == GATT_UUID_SYSTEM_ID | GATT_UUID_MODEL_NUMBER_STR | GATT_UUID_PNP_ID | - GATT_UUID_SERIAL_NUMBER_STR | GATT_UUID_FW_VERSION_STR | GATT_UUID_HW_VERSION_STR | - GATT_UUID_SW_VERSION_STR | GATT_UUID_MANU_NAME | GATT_UUID_IEEE_DATA) { + UINT16 uuid_len = p_data->add_result.char_uuid.len; + + if (uuid_len == ESP_UUID_LEN_16) { + if (char_uuid == GATT_UUID_BATTERY_LEVEL) { + bas_AddCharDescr(service_id, p_data->add_result.attr_id); + } + switch (char_uuid) { case GATT_UUID_SYSTEM_ID: dis_cb.dis_attr[0].handle = service_id; break; @@ -138,6 +139,8 @@ static void bas_gatts_callback(esp_gatts_evt_t event, tBTA_GATTS *p_data) case GATT_UUID_PNP_ID: dis_cb.dis_attr[8].handle = service_id; break; } + default: + break; } } break; From 1c2e8f41f3e0258ecfeaad26078f4b54f8025d9c Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Tue, 9 May 2023 18:56:08 +0800 Subject: [PATCH 8/8] fix blufi doc error --- docs/en/api-guides/blufi.rst | 2 +- docs/zh_CN/api-guides/blufi.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/api-guides/blufi.rst b/docs/en/api-guides/blufi.rst index cb5fcfd3a5..8a691609e3 100644 --- a/docs/en/api-guides/blufi.rst +++ b/docs/en/api-guides/blufi.rst @@ -61,8 +61,8 @@ The Flow Chart of BluFi Phone <- {IDF_TARGET_NAME} [label="Advertising"]; Phone -> {IDF_TARGET_NAME} [label="Create GATT connection"]; - Phone <- {IDF_TARGET_NAME} [label="Negotiate key procedure"]; Phone -> {IDF_TARGET_NAME} [label="Negotiate key procedure"]; + Phone <- {IDF_TARGET_NAME} [label="Negotiate key procedure"]; Phone -> {IDF_TARGET_NAME} [label="CTRL: Set {IDF_TARGET_NAME} to Phone Security mode"]; Phone -> {IDF_TARGET_NAME} [label="DATA: SSID"]; Phone -> {IDF_TARGET_NAME} [label="DATA: Password"]; diff --git a/docs/zh_CN/api-guides/blufi.rst b/docs/zh_CN/api-guides/blufi.rst index aa232c8811..2e2276348f 100644 --- a/docs/zh_CN/api-guides/blufi.rst +++ b/docs/zh_CN/api-guides/blufi.rst @@ -61,8 +61,8 @@ BluFi 流程图 Phone <- {IDF_TARGET_NAME} [label="广播"]; Phone -> {IDF_TARGET_NAME} [label="建立 GATT 链接"]; - Phone <- {IDF_TARGET_NAME} [label="协商密钥"]; Phone -> {IDF_TARGET_NAME} [label="协商密钥"]; + Phone <- {IDF_TARGET_NAME} [label="协商密钥"]; Phone -> {IDF_TARGET_NAME} [label="CTRL: 设置 {IDF_TARGET_NAME} 为手机安全模式"]; Phone -> {IDF_TARGET_NAME} [label="DATA: SSID"]; Phone -> {IDF_TARGET_NAME} [label="DATA: Password"];