diff --git a/components/bt/controller/esp32c6/Kconfig.in b/components/bt/controller/esp32c6/Kconfig.in index 14b274ce37..e8d1747e23 100644 --- a/components/bt/controller/esp32c6/Kconfig.in +++ b/components/bt/controller/esp32c6/Kconfig.in @@ -876,3 +876,94 @@ config BT_LE_CTRL_ADV_FAST_TX_EN and the actual on-air transmission by executing the advertising TX path from IRAM. Note: Enabling this option increases IRAM usage. + +menu "Adv Tx Options" + config BT_LE_CTRL_ADV_EVENT_INC_ON_FULL_TX_EN + bool "Increment advertising event count only on full PDU TX success" + default n + help + When enabled, the advertising event count is incremented only + if all PDUs in an advertising event are transmitted successfully. + If disabled, the event count is incremented regardless of transmission success. + + config BT_LE_CTRL_ADV_CH38_39_TX_AVOID_CONFLICT_EN + bool "Delay advertising TX on channels 38/39 to avoid scheduling conflicts" + default n + help + When enabled, advertising transmissions on channels 38 and 39 + are delayed if a scheduling conflict occurs. + + config BT_LE_ADV_CH39_TXPWR_CONFIG_SEPARATELY_EN + bool "Enable separate TX power for advertising on channel 39" + default n + help + When enabled, the TX power for advertising transmissions + on channel 39 can be configured independently of other channels. + + config BT_LE_CTRL_ADV_TX_CONTINUE_WHEN_EXCEED_ITVL_EN + bool "Allow advertising TX to continue if data TX exceeds interval" + default n + help + When enabled, advertising transmission continues even if the + TX duration for advertising data exceeds the configured advertising interval. + + config BT_LE_CTRL_ADV_RAND_CH_IDX_EN + bool "Enable Randomized Advertising Channel Indexing" + default n + help + When enabled, the advertising channel sequence is randomized + according to the Randomized Advertising Channel Indexing feature. + If disabled, the standard channel sequence is used. + + choice BT_LE_DFT_CH39_TX_POWER_LEVEL_DBM + prompt "BLE default channel 39 Tx power level (dBm)" + depends on BT_LE_ADV_CH39_TXPWR_CONFIG_SEPARATELY_EN + default BT_LE_DFT_CH39_TX_POWER_LEVEL_P9 + help + Default Tx power (dBm) for advertising on channel 39 when separate channel 39 power is enabled. + config BT_LE_DFT_CH39_TX_POWER_LEVEL_N15 + bool "-15dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_N12 + bool "-12dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_N9 + bool "-9dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_N6 + bool "-6dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_N3 + bool "-3dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_N0 + bool "0dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_P3 + bool "+3dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_P6 + bool "+6dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_P9 + bool "+9dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_P12 + bool "+12dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_P15 + bool "+15dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_P18 + bool "+18dBm" + config BT_LE_DFT_CH39_TX_POWER_LEVEL_P20 + bool "+20dBm" + endchoice + + config BT_LE_DFT_CH39_TX_POWER_LEVEL_DBM_EFF + int + depends on BT_LE_ADV_CH39_TXPWR_CONFIG_SEPARATELY_EN + default -15 if BT_LE_DFT_CH39_TX_POWER_LEVEL_N15 + default -12 if BT_LE_DFT_CH39_TX_POWER_LEVEL_N12 + default -9 if BT_LE_DFT_CH39_TX_POWER_LEVEL_N9 + default -6 if BT_LE_DFT_CH39_TX_POWER_LEVEL_N6 + default -3 if BT_LE_DFT_CH39_TX_POWER_LEVEL_N3 + default 0 if BT_LE_DFT_CH39_TX_POWER_LEVEL_N0 + default 3 if BT_LE_DFT_CH39_TX_POWER_LEVEL_P3 + default 6 if BT_LE_DFT_CH39_TX_POWER_LEVEL_P6 + default 9 if BT_LE_DFT_CH39_TX_POWER_LEVEL_P9 + default 12 if BT_LE_DFT_CH39_TX_POWER_LEVEL_P12 + default 15 if BT_LE_DFT_CH39_TX_POWER_LEVEL_P15 + default 18 if BT_LE_DFT_CH39_TX_POWER_LEVEL_P18 + default 20 if BT_LE_DFT_CH39_TX_POWER_LEVEL_P20 + default 0 +endmenu diff --git a/components/bt/controller/esp32c6/esp_bt_cfg.h b/components/bt/controller/esp32c6/esp_bt_cfg.h index eb82f56941..9a07d380c0 100644 --- a/components/bt/controller/esp32c6/esp_bt_cfg.h +++ b/components/bt/controller/esp32c6/esp_bt_cfg.h @@ -315,6 +315,42 @@ extern "C" { #define DEFAULT_BT_LE_CTRL_RXBUF_MEM_RESV (0) #endif +#ifdef CONFIG_BT_LE_CTRL_ADV_EVENT_INC_ON_FULL_TX_EN +#define DEFAULT_BT_LE_CTRL_ADV_EVENT_INC_ON_FULL_TX_EN (1<<0) +#else +#define DEFAULT_BT_LE_CTRL_ADV_EVENT_INC_ON_FULL_TX_EN (0) +#endif + +#ifdef CONFIG_BT_LE_CTRL_ADV_CH38_39_TX_AVOID_CONFLICT_EN +#define DEFAULT_BT_LE_CTRL_ADV_CH38_39_TX_AVOID_CONFLICT_EN (1<<1) +#else +#define DEFAULT_BT_LE_CTRL_ADV_CH38_39_TX_AVOID_CONFLICT_EN (0) +#endif + +#ifdef CONFIG_BT_LE_ADV_CH39_TXPWR_CONFIG_SEPARATELY_EN +#define DEFAULT_BT_LE_ADV_CH39_TXPWR_CONFIG_SEPARATELY_EN (1<<2) +#define BLE_CH39_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_CH39_TX_POWER_LEVEL_DBM_EFF) +#else +#define DEFAULT_BT_LE_ADV_CH39_TXPWR_CONFIG_SEPARATELY_EN (0) +#define BLE_CH39_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF) +#endif + +#ifdef CONFIG_BT_LE_CTRL_ADV_TX_CONTINUE_WHEN_EXCEED_ITVL_EN +#define DEFAULT_BT_LE_CTRL_ADV_TX_CONTINUE_WHEN_EXCEED_ITVL_EN (1<<3) +#else +#define DEFAULT_BT_LE_CTRL_ADV_TX_CONTINUE_WHEN_EXCEED_ITVL_EN (0) +#endif + +#ifdef CONFIG_BT_LE_CTRL_ADV_RAND_CH_IDX_EN +#define DEFAULT_BT_LE_CTRL_ADV_RAND_CH_IDX_EN (1<<4) +#else +#define DEFAULT_BT_LE_CTRL_ADV_RAND_CH_IDX_EN (0) +#endif + +#define DEFAULT_BT_LE_ADV_TX_OPTIONS (DEFAULT_BT_LE_CTRL_ADV_EVENT_INC_ON_FULL_TX_EN | \ + DEFAULT_BT_LE_CTRL_ADV_CH38_39_TX_AVOID_CONFLICT_EN | DEFAULT_BT_LE_ADV_CH39_TXPWR_CONFIG_SEPARATELY_EN | \ + DEFAULT_BT_LE_CTRL_ADV_TX_CONTINUE_WHEN_EXCEED_ITVL_EN | DEFAULT_BT_LE_CTRL_ADV_RAND_CH_IDX_EN ) + /* Unchanged configuration */ #define BLE_LL_CTRL_PROC_TIMEOUT_MS_N (40000) /* ms */ @@ -346,6 +382,7 @@ extern "C" { #define RUN_QA_TEST (0) #define NIMBLE_DISABLE_SCAN_BACKOFF (0) #define BT_LL_CTRL_PRIO_LVL_CFG ((CONFIG_BT_LE_DFT_SYNC_SCHED_PRIO_LEVEL << 4) | (CONFIG_BT_LE_DFT_PERIODIC_ADV_SCHED_PRIO_LEVEL << 2) | CONFIG_BT_LE_DFT_ADV_SCHED_PRIO_LEVEL) + #ifdef __cplusplus } #endif diff --git a/components/bt/include/esp32c6/include/esp_bt.h b/components/bt/include/esp32c6/include/esp_bt.h index 9747a07650..27040370cc 100644 --- a/components/bt/include/esp32c6/include/esp_bt.h +++ b/components/bt/include/esp32c6/include/esp_bt.h @@ -298,10 +298,10 @@ typedef struct { .ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \ .vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \ .ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \ - .ble_adv_tx_options = 0, \ + .ble_adv_tx_options = DEFAULT_BT_LE_ADV_TX_OPTIONS, \ .skip_unnecessary_checks_en = 0, \ .fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \ - .ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \ + .ch39_txpwr = BLE_CH39_TX_PWR_DBM_N, \ .adv_rsv_cnt = BLE_LL_ADV_SM_RESERVE_CNT_N, \ .conn_rsv_cnt = BLE_LL_CONN_SM_RESERVE_CNT_N, \ .priority_level_cfg = BT_LL_CTRL_PRIO_LVL_CFG, \ @@ -365,10 +365,10 @@ typedef struct { .ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \ .vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \ .ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \ - .ble_adv_tx_options = 0, \ + .ble_adv_tx_options = DEFAULT_BT_LE_ADV_TX_OPTIONS, \ .skip_unnecessary_checks_en = 0, \ .fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \ - .ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \ + .ch39_txpwr = BLE_CH39_TX_PWR_DBM_N, \ .adv_rsv_cnt = BLE_LL_ADV_SM_RESERVE_CNT_N, \ .conn_rsv_cnt = BLE_LL_CONN_SM_RESERVE_CNT_N, \ .priority_level_cfg = BT_LL_CTRL_PRIO_LVL_CFG, \