Skip to content

Commit 093b65e

Browse files
fix(ble): fixed the connect issue when rx error aa on ESP32-H2
1 parent 69b535d commit 093b65e

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

components/bt/controller/esp32h2/Kconfig.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,3 +690,11 @@ config BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF
690690
default 18 if BT_LE_DFT_TX_POWER_LEVEL_P18
691691
default 20 if BT_LE_DFT_TX_POWER_LEVEL_P20
692692
default 0
693+
694+
config BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
695+
bool "Enable enhanced Access Address check in CONNECT_IND"
696+
default n
697+
help
698+
Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU.
699+
This improves security by ensuring that only connection requests with valid Access Addresses are accepted.
700+
If disabled, only basic checks are applied, improving compatibility.

components/bt/controller/esp32h2/esp_bt_cfg.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ extern "C" {
148148

149149
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
150150

151+
#ifdef CONFIG_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
152+
#define DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS (CONFIG_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS)
153+
#else
154+
#define DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS (0)
155+
#endif
156+
151157
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
152158
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
153159
#else

components/bt/include/esp32h2/include/esp_bt.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
161161
*/
162162
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
163163

164-
#define CONFIG_VERSION 0x20240422
164+
#define CONFIG_VERSION 0x20241121
165165
#define CONFIG_MAGIC 0x5A5AA5A5
166166

167167
/**
@@ -214,7 +214,9 @@ typedef struct {
214214
uint8_t cpu_freq_mhz; /*!< CPU frequency in megahertz */
215215
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the white list for directed advertising */
216216
uint8_t enable_pcl; /*!< Enable power control */
217-
uint8_t csa2_select; /*!< Select CSA#2*/
217+
uint8_t csa2_select; /*!< Select CSA#2*/
218+
uint8_t enable_csr; /*!< Enable CSR */
219+
uint8_t ble_aa_check; /*!< True if adds a verification step for the Access Address within the CONNECT_IND PDU; false otherwise. Configurable in menuconfig */
218220
uint32_t config_magic; /*!< Configuration magic value */
219221
} esp_bt_controller_config_t;
220222

@@ -262,7 +264,9 @@ typedef struct {
262264
.cpu_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, \
263265
.ignore_wl_for_direct_adv = 0, \
264266
.enable_pcl = 0, \
265-
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
267+
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
268+
.enable_csr = 0, \
269+
.ble_aa_check = DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS, \
266270
.config_magic = CONFIG_MAGIC, \
267271
}
268272

0 commit comments

Comments
 (0)