mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
feat(ble): add channel assessment and enhanced connect function on ESP32-H2
This commit is contained in:
parent
821e587fda
commit
0ffac92586
@ -658,7 +658,7 @@ config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
|
||||
again.
|
||||
|
||||
config BT_LE_MSYS_INIT_IN_CONTROLLER
|
||||
bool
|
||||
bool "Msys Mbuf Init in Controller"
|
||||
default y
|
||||
|
||||
config BT_LE_TX_CCA_ENABLED
|
||||
@ -749,3 +749,48 @@ config BT_CTRL_RUN_IN_FLASH_ONLY
|
||||
Move most IRAM into flash. This will increase the usage of flash and reduce ble performance.
|
||||
Because the code is moved to the flash, the execution speed of the code is reduced.
|
||||
To have a small impact on performance, you need to enable flash suspend (SPI_FLASH_AUTO_SUSPEND).
|
||||
|
||||
menu "BLE disconnects when Instant Passed (0x28) occurs"
|
||||
config BT_LE_CTRL_LLCP_CONN_UPDATE
|
||||
bool "BLE ACL connection update procedure"
|
||||
default n
|
||||
help
|
||||
If this option is enabled, Controller will terminate the connection
|
||||
when Instant Passed (0x28) error occurs during connection update procedure.
|
||||
|
||||
config BT_LE_CTRL_LLCP_CHAN_MAP_UPDATE
|
||||
bool "BLE ACL channel map update procedure"
|
||||
default n
|
||||
help
|
||||
If this option is enabled, Controller will terminate the connection
|
||||
when Instant Passed (0x28) error occurs in channel map update procedure.
|
||||
|
||||
config BT_LE_CTRL_LLCP_PHY_UPDATE
|
||||
bool "BLE ACL PHY update procedure"
|
||||
default n
|
||||
help
|
||||
If this option is enabled, Controller will terminate the connection
|
||||
when Instant Passed (0x28) error occurs in PHY update procedure.
|
||||
endmenu
|
||||
|
||||
config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
|
||||
int "The value of upperlimitmax during scan backoff procedure"
|
||||
range 1 256
|
||||
default 32
|
||||
help
|
||||
The value of upperlimitmax needs to be a power of 2.
|
||||
|
||||
config BT_LE_CTRL_CHAN_ASS_EN
|
||||
bool "Enable channel assessment"
|
||||
default n
|
||||
help
|
||||
If this option is enabled, The Controller will records the communication quality
|
||||
for each channel and then start a timer to check and update the channel map every 4 seconds.
|
||||
|
||||
config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
|
||||
bool "Enable aux packet when ext adv data length is zero"
|
||||
default y
|
||||
help
|
||||
When this option is enabled, auxiliary packets will be present in the events of
|
||||
'Non-Connectable and Non-Scannable' regardless of whether the advertising length is 0.
|
||||
If this option is not enabled, auxiliary packets will only be present when the advertising length is not 0.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -154,6 +154,44 @@ extern "C" {
|
||||
#define DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_CTRL_LLCP_CONN_UPDATE
|
||||
#define BT_CTRL_BLE_LLCP_CONN_UPDATE (1<<0)
|
||||
#else
|
||||
#define BT_CTRL_BLE_LLCP_CONN_UPDATE (0<<0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_CTRL_LLCP_CHAN_MAP_UPDATE
|
||||
#define BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE (1<<1)
|
||||
#else
|
||||
#define BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE (0<<1)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_CTRL_LLCP_PHY_UPDATE
|
||||
#define BT_CTRL_BLE_LLCP_PHY_UPDATE (1<<2)
|
||||
#else
|
||||
#define BT_CTRL_BLE_LLCP_PHY_UPDATE (0<<2)
|
||||
#endif
|
||||
|
||||
#define BT_LE_CTRL_LLCP_DISC_FLAG (BT_CTRL_BLE_LLCP_CONN_UPDATE | BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE | BT_CTRL_BLE_LLCP_PHY_UPDATE)
|
||||
|
||||
#ifdef CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
|
||||
#define BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX (CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX)
|
||||
#else
|
||||
#define BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX (256)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_LE_CTRL_CHAN_ASS_EN)
|
||||
#define DEFAULT_BT_LE_CTRL_CHAN_ASS_EN (CONFIG_BT_LE_CTRL_CHAN_ASS_EN)
|
||||
#else
|
||||
#define DEFAULT_BT_LE_CTRL_CHAN_ASS_EN (0)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX)
|
||||
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (CONFIG_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX)
|
||||
#else
|
||||
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#else
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -109,14 +109,6 @@ typedef enum {
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_MAX,
|
||||
} esp_ble_enhanced_power_type_t;
|
||||
|
||||
/**
|
||||
* @brief Address type and address value.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t type; /*!< Type of the Bluetooth address (public, random, etc.) */
|
||||
uint8_t val[6]; /*!< Array containing the 6-byte Bluetooth address value */
|
||||
} esp_ble_addr_t;
|
||||
|
||||
/**
|
||||
* @brief Select buffers
|
||||
*/
|
||||
@ -125,6 +117,14 @@ typedef enum {
|
||||
ESP_BLE_LOG_BUF_CONTROLLER = 0x05,
|
||||
} esp_ble_log_buf_t;
|
||||
|
||||
/**
|
||||
* @brief Address type and address value.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t type; /*!< Type of the Bluetooth address (public, random, etc.) */
|
||||
uint8_t val[6]; /*!< Array containing the 6-byte Bluetooth address value */
|
||||
} esp_ble_addr_t;
|
||||
|
||||
/**
|
||||
* @brief Set BLE TX power
|
||||
* Connection Tx power should only be set after connection created.
|
||||
@ -161,7 +161,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
|
||||
|
||||
#define CONFIG_VERSION 0x20241121
|
||||
#define CONFIG_VERSION 0x20250104
|
||||
#define CONFIG_MAGIC 0x5A5AA5A5
|
||||
|
||||
/**
|
||||
@ -217,7 +217,16 @@ typedef struct {
|
||||
uint8_t csa2_select; /*!< Select CSA#2*/
|
||||
uint8_t enable_csr; /*!< Enable CSR */
|
||||
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 */
|
||||
uint32_t config_magic; /*!< Configuration magic value */
|
||||
uint8_t ble_llcp_disc_flag; /*!< Flag indicating whether the Controller disconnects after Instant Passed (0x28) error occurs. Configurable in menuconfig.
|
||||
- The Controller does not disconnect after Instant Passed (0x28) by default. */
|
||||
uint16_t scan_backoff_upperlimitmax; /*!< The value of upperlimitmax is 2^n, The maximum value is 256 */
|
||||
uint8_t ble_chan_ass_en; /*!< Enable / disable BLE channel assessment. Configurable in menuconfig.
|
||||
- 0 - Disable
|
||||
- 1 - Enable (default) */
|
||||
uint8_t ble_data_lenth_zero_aux; /*!< Enable / disable auxiliary packets when the extended ADV data length is zero. Configurable in menuconfig.
|
||||
- 0 - Disable (default)
|
||||
- 1 - Enable */
|
||||
uint32_t config_magic; /*!< Configuration magic value */
|
||||
} esp_bt_controller_config_t;
|
||||
|
||||
|
||||
@ -263,10 +272,14 @@ typedef struct {
|
||||
.main_xtal_freq = CONFIG_XTAL_FREQ, \
|
||||
.cpu_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, \
|
||||
.ignore_wl_for_direct_adv = 0, \
|
||||
.enable_pcl = 0, \
|
||||
.enable_pcl = DEFAULT_BT_LE_POWER_CONTROL_ENABLED, \
|
||||
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
|
||||
.enable_csr = 0, \
|
||||
.ble_aa_check = DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS, \
|
||||
.ble_llcp_disc_flag = BT_LE_CTRL_LLCP_DISC_FLAG, \
|
||||
.scan_backoff_upperlimitmax = BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX, \
|
||||
.ble_chan_ass_en = DEFAULT_BT_LE_CTRL_CHAN_ASS_EN, \
|
||||
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
|
||||
.config_magic = CONFIG_MAGIC, \
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user