From a784e0dba2afe8c0321d3a8837bd96a6ab8d97b8 Mon Sep 17 00:00:00 2001 From: Shen Weilong Date: Mon, 10 Mar 2025 20:34:36 +0800 Subject: [PATCH] feat(ble): tell controller if vhci is enabled for ESP32-C6 and ESP32-H2 --- components/bt/controller/esp32c6/esp_bt_cfg.h | 6 ++++++ components/bt/controller/esp32h2/esp_bt_cfg.h | 6 ++++++ components/bt/controller/lib_esp32c6/esp32c6-bt-lib | 2 +- components/bt/controller/lib_esp32h2/esp32h2-bt-lib | 2 +- components/bt/include/esp32c6/include/esp_bt.h | 4 +++- components/bt/include/esp32h2/include/esp_bt.h | 4 +++- 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/components/bt/controller/esp32c6/esp_bt_cfg.h b/components/bt/controller/esp32c6/esp_bt_cfg.h index 10ede46757..3d8edd55de 100644 --- a/components/bt/controller/esp32c6/esp_bt_cfg.h +++ b/components/bt/controller/esp32c6/esp_bt_cfg.h @@ -198,6 +198,12 @@ extern "C" { #define HCI_UART_EN 0 // hci ram mode #endif +#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_RAM +#define DEFAULT_BT_LE_VHCI_ENABLED (CONFIG_BT_LE_HCI_INTERFACE_USE_RAM) +#else +#define DEFAULT_BT_LE_VHCI_ENABLED (0) +#endif + #ifdef CONFIG_BT_LE_SLEEP_ENABLE #define NIMBLE_SLEEP_ENABLE CONFIG_BT_LE_SLEEP_ENABLE #else diff --git a/components/bt/controller/esp32h2/esp_bt_cfg.h b/components/bt/controller/esp32h2/esp_bt_cfg.h index 10ede46757..3d8edd55de 100644 --- a/components/bt/controller/esp32h2/esp_bt_cfg.h +++ b/components/bt/controller/esp32h2/esp_bt_cfg.h @@ -198,6 +198,12 @@ extern "C" { #define HCI_UART_EN 0 // hci ram mode #endif +#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_RAM +#define DEFAULT_BT_LE_VHCI_ENABLED (CONFIG_BT_LE_HCI_INTERFACE_USE_RAM) +#else +#define DEFAULT_BT_LE_VHCI_ENABLED (0) +#endif + #ifdef CONFIG_BT_LE_SLEEP_ENABLE #define NIMBLE_SLEEP_ENABLE CONFIG_BT_LE_SLEEP_ENABLE #else diff --git a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib index 08946905ec..82935ee5cb 160000 --- a/components/bt/controller/lib_esp32c6/esp32c6-bt-lib +++ b/components/bt/controller/lib_esp32c6/esp32c6-bt-lib @@ -1 +1 @@ -Subproject commit 08946905ec0dfcbfc7dd2919b27e43cbcbde66ed +Subproject commit 82935ee5cb027e1491f70ce243176fce8d24d8bb diff --git a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib index e755a65597..8a3602d542 160000 --- a/components/bt/controller/lib_esp32h2/esp32h2-bt-lib +++ b/components/bt/controller/lib_esp32h2/esp32h2-bt-lib @@ -1 +1 @@ -Subproject commit e755a655979177c9551d5fb3613ebb4885aab3a5 +Subproject commit 8a3602d54227e7f16835b55474be61a683a04c15 diff --git a/components/bt/include/esp32c6/include/esp_bt.h b/components/bt/include/esp32c6/include/esp_bt.h index e6fd3f2def..5de79a7143 100644 --- a/components/bt/include/esp32c6/include/esp_bt.h +++ b/components/bt/include/esp32c6/include/esp_bt.h @@ -156,7 +156,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 0x20250104 +#define CONFIG_VERSION 0x20250310 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -222,6 +222,7 @@ typedef struct { 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 */ + uint8_t vhci_enabled; /*!< VHCI mode is enabled */ uint32_t config_magic; /*!< Magic number for configuration validation */ } esp_bt_controller_config_t; @@ -276,6 +277,7 @@ typedef struct { .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, \ + .vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \ .config_magic = CONFIG_MAGIC, \ } diff --git a/components/bt/include/esp32h2/include/esp_bt.h b/components/bt/include/esp32h2/include/esp_bt.h index 7c460b10c9..565f43f848 100644 --- a/components/bt/include/esp32h2/include/esp_bt.h +++ b/components/bt/include/esp32h2/include/esp_bt.h @@ -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 0x20250104 +#define CONFIG_VERSION 0x20250310 #define CONFIG_MAGIC 0x5A5AA5A5 /** @@ -226,6 +226,7 @@ typedef struct { 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 */ + uint8_t vhci_enabled; /*!< VHCI is enabled */ uint32_t config_magic; /*!< Configuration magic value */ } esp_bt_controller_config_t; @@ -280,6 +281,7 @@ typedef struct { .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, \ + .vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \ .config_magic = CONFIG_MAGIC, \ }