Skip to content

Commit 69b535d

Browse files
fix(ble): fixed the connect issue when rx error aa on ESP32-C6
1 parent 32b5359 commit 69b535d

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

components/bt/controller/esp32c6/Kconfig.in

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

components/bt/controller/esp32c6/esp_bt_cfg.h

Lines changed: 6 additions & 1 deletion
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
@@ -218,7 +224,6 @@ extern "C" {
218224

219225
#define BLE_LL_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF)
220226

221-
222227
#define RUN_BQB_TEST (0)
223228
#define RUN_QA_TEST (0)
224229
#define NIMBLE_DISABLE_SCAN_BACKOFF (0)

components/bt/include/esp32c6/include/esp_bt.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
156156
*/
157157
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
158158

159-
#define CONFIG_VERSION 0x20240422
159+
#define CONFIG_VERSION 0x20241121
160160
#define CONFIG_MAGIC 0x5A5AA5A5
161161

162162
/**
@@ -213,6 +213,8 @@ typedef struct {
213213
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the whitelist for direct advertising */
214214
uint8_t enable_pcl; /*!< Enable power control */
215215
uint8_t csa2_select; /*!< Select CSA#2*/
216+
uint8_t enable_csr; /*!< Enable CSR */
217+
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 */
216218
uint32_t config_magic; /*!< Magic number for configuration validation */
217219
} esp_bt_controller_config_t;
218220

@@ -262,6 +264,8 @@ typedef struct {
262264
.ignore_wl_for_direct_adv = 0, \
263265
.enable_pcl = DEFAULT_BT_LE_POWER_CONTROL_ENABLED, \
264266
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
267+
.enable_csr = 0, \
268+
.ble_aa_check = DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS, \
265269
.config_magic = CONFIG_MAGIC, \
266270
}
267271
#elif CONFIG_IDF_TARGET_ESP32C61
@@ -309,6 +313,8 @@ typedef struct {
309313
.ignore_wl_for_direct_adv = 0, \
310314
.enable_pcl = DEFAULT_BT_LE_POWER_CONTROL_ENABLED, \
311315
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
316+
.enable_csr = 0, \
317+
.ble_aa_check = DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS, \
312318
.config_magic = CONFIG_MAGIC, \
313319
}
314320
#endif

0 commit comments

Comments
 (0)