Skip to content

Commit c122f72

Browse files
committed
Merge branch 'bugfix/lmp_trans_collision_v5.4' into 'release/v5.4'
fix(bt/controller): Fixed some controller bugs on ESP32 (v5.4) See merge request espressif/esp-idf!34944
2 parents 438c063 + 5cd5ede commit c122f72

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

components/bt/controller/esp32/Kconfig.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,15 @@ config BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
444444
minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active
445445
scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU.
446446

447+
config BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
448+
bool "Enable enhanced Access Address check in CONNECT_IND"
449+
default n
450+
help
451+
Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU.
452+
This improves security by ensuring that only connection requests with valid Access Addresses are accepted.
453+
If disabled, only basic checks are applied, improving compatibility.
454+
455+
447456
config BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
448457
bool "BLE adv report flow control supported"
449458
depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY)

components/bt/controller/lib_esp32

components/bt/include/esp32/include/esp_bt.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extern "C" {
5555
*
5656
* @note Please do not modify this value
5757
*/
58-
#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20240926
58+
#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20241015
5959

6060
/**
6161
* @brief Bluetooth Controller mode
@@ -193,6 +193,12 @@ the advertising packet will be discarded until the memory is restored. */
193193

194194
#define BTDM_BLE_LLCP_DISC_FLAG (BTDM_BLE_LLCP_CONN_UPDATE | BTDM_BLE_LLCP_CHAN_MAP_UPDATE)
195195

196+
#ifdef CONFIG_BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
197+
#define BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED CONFIG_BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
198+
#else
199+
#define BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED 0
200+
#endif
201+
196202
/**
197203
* @brief Default Bluetooth Controller configuration
198204
*/
@@ -222,6 +228,7 @@ the advertising packet will be discarded until the memory is restored. */
222228
.dup_list_refresh_period = SCAN_DUPL_CACHE_REFRESH_PERIOD, \
223229
.ble_scan_backoff = BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX, \
224230
.ble_llcp_disc_flag = BTDM_BLE_LLCP_DISC_FLAG, \
231+
.ble_aa_check = BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED, \
225232
.magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \
226233
}
227234

@@ -275,6 +282,7 @@ typedef struct {
275282
uint16_t dup_list_refresh_period; /*!< Scan duplicate filtering list refresh period in seconds. Configurable in menuconfig */
276283
bool ble_scan_backoff; /*!< True if BLE scan backoff is enabled; false otherwise. Configurable in menuconfig */
277284
uint8_t ble_llcp_disc_flag; /*!< BLE disconnect flag when instant passed. Configurable in menuconfig */
285+
bool ble_aa_check; /*!< True if adds a verification step for the Access Address within the CONNECT_IND PDU; false otherwise. Configurable in menuconfig */
278286
uint32_t magic; /*!< Magic number */
279287
} esp_bt_controller_config_t;
280288

components/esp_rom/esp32/ld/esp32.rom.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ PROVIDE ( ld_acl_rsw_frm_cbk = 0x40033bb0 );
663663
PROVIDE ( ld_sco_modify = 0x40031778 );
664664
PROVIDE ( lm_cmd_cmp_send = 0x40051838 );
665665
PROVIDE ( ld_sco_frm_cbk = 0x400349dc );
666+
PROVIDE ( ld_sco_evt_stop_cbk = 0x40031d78 );
666667
PROVIDE ( ld_acl_sco_rsvd_check = 0x4002fa94 );
667668
PROVIDE ( ld_acl_sniff_frm_cbk = 0x4003482c );
668669
PROVIDE ( ld_inq_end = 0x4003ab48 );

examples/bluetooth/bluedroid/classic_bt/hfp_ag/main/bt_app_hf.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Unlicense OR CC0-1.0
55
*/
@@ -32,7 +32,7 @@ const char *c_hf_evt_str[] = {
3232
"AUDIO_STATE_EVT", /*!< AUDIO CONNECTION STATE CONTROL */
3333
"VR_STATE_CHANGE_EVT", /*!< VOICE RECOGNITION CHANGE */
3434
"VOLUME_CONTROL_EVT", /*!< AUDIO VOLUME CONTROL */
35-
"UNKNOW_AT_CMD", /*!< UNKNOW AT COMMAND RECIEVED */
35+
"UNKNOW_AT_CMD", /*!< UNKNOWN AT COMMAND RECEIVED */
3636
"IND_UPDATE", /*!< INDICATION UPDATE */
3737
"CIND_RESPONSE_EVT", /*!< CALL & DEVICE INDICATION */
3838
"COPS_RESPONSE_EVT", /*!< CURRENT OPERATOR EVENT */
@@ -355,7 +355,7 @@ void bt_app_hf_cb(esp_hf_cb_event_t event, esp_hf_cb_param_t *param)
355355

356356
case ESP_HF_IND_UPDATE_EVT:
357357
{
358-
ESP_LOGI(BT_HF_TAG, "--UPDATE INDCATOR!");
358+
ESP_LOGI(BT_HF_TAG, "--UPDATE INDICATOR!");
359359
esp_hf_call_status_t call_state = 1;
360360
esp_hf_call_setup_status_t call_setup_state = 2;
361361
esp_hf_network_state_t ntk_state = 1;
@@ -460,6 +460,7 @@ void bt_app_hf_cb(esp_hf_cb_event_t event, esp_hf_cb_param_t *param)
460460
if (param->out_call.type == ESP_HF_DIAL_NUM) {
461461
// dia_num
462462
ESP_LOGI(BT_HF_TAG, "--Dial number \"%s\".", param->out_call.num_or_loc);
463+
esp_hf_ag_cmee_send(param->out_call.remote_addr, ESP_HF_AT_RESPONSE_CODE_OK, ESP_HF_CME_AG_FAILURE);
463464
esp_hf_ag_out_call(param->out_call.remote_addr,1,0,1,0,param->out_call.num_or_loc,0);
464465
} else if (param->out_call.type == ESP_HF_DIAL_MEM) {
465466
// dia_mem

0 commit comments

Comments
 (0)