Skip to content

Commit 207d85a

Browse files
feat(ble): support creating connections during scanning process on ESP32-H2
1 parent cd6038b commit 207d85a

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

components/bt/controller/esp32h2/Kconfig.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,3 +843,10 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
843843
config BT_LE_RXBUF_OPT_ENABLED
844844
bool "Enable rxbuf optimization feature"
845845
default y
846+
847+
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
848+
bool "Enable fast sending of connection data"
849+
default y
850+
help
851+
If this option is enabled, The Controller will continue to
852+
Send an empty PDU after sending valid connection data within an interval.

components/bt/controller/esp32h2/bt.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
#define OSI_COEX_VERSION 0x00010006
6767
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
6868

69-
#define EXT_FUNC_VERSION 0x20240422
69+
#define EXT_FUNC_VERSION 0x20250415
7070
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
7171

7272
#define BT_ASSERT_PRINT ets_printf
@@ -97,7 +97,6 @@ struct ext_funcs_t {
9797
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
9898
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
9999
const uint8_t *local_priv_key, uint8_t *dhkey);
100-
void (* _esp_reset_rpa_moudle)(void);
101100
uint32_t magic;
102101
};
103102

@@ -183,7 +182,6 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
183182
static int esp_intr_free_wrapper(void **ret_handle);
184183
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
185184
static uint32_t osi_random_wrapper(void);
186-
static void esp_reset_rpa_moudle(void);
187185
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
188186
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
189187
const uint8_t *our_priv_key, uint8_t *out_dhkey);
@@ -460,15 +458,9 @@ struct ext_funcs_t ext_funcs_ro = {
460458
._os_random = osi_random_wrapper,
461459
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
462460
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
463-
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
464461
.magic = EXT_FUNC_MAGIC_VALUE,
465462
};
466463

467-
static void IRAM_ATTR esp_reset_rpa_moudle(void)
468-
{
469-
470-
}
471-
472464
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
473465
uint32_t param1, uint32_t param2)
474466
{

components/bt/controller/esp32h2/esp_bt_cfg.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ extern "C" {
192192
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
193193
#endif
194194

195+
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
196+
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
197+
#else
198+
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
199+
#endif
200+
195201
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
196202
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
197203
#else

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

Lines changed: 10 additions & 2 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 0x20250310
164+
#define CONFIG_VERSION 0x20250513
165165
#define CONFIG_MAGIC 0x5A5AA5A5
166166

167167
/**
@@ -226,8 +226,13 @@ typedef struct {
226226
uint8_t ble_data_lenth_zero_aux; /*!< Enable / disable auxiliary packets when the extended ADV data length is zero. Configurable in menuconfig.
227227
- 0 - Disable (default)
228228
- 1 - Enable */
229-
uint8_t vhci_enabled; /*!< VHCI is enabled */
229+
uint8_t vhci_enabled; /*!< VHCI is enabled */
230230
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
231+
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
232+
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform extra handling for fatal checks. */
233+
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
234+
- 0 - Disable
235+
- 1 - Enable (default) */
231236
uint32_t config_magic; /*!< Configuration magic value */
232237
} esp_bt_controller_config_t;
233238

@@ -284,6 +289,9 @@ typedef struct {
284289
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
285290
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
286291
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
292+
.ble_adv_tx_options = 0, \
293+
.skip_unnecessary_checks_en = 0, \
294+
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
287295
.config_magic = CONFIG_MAGIC, \
288296
}
289297

0 commit comments

Comments
 (0)