diff --git a/components/bt/controller/esp32h2/Kconfig.in b/components/bt/controller/esp32h2/Kconfig.in index 5ff989a8b4..fd0dff5b73 100644 --- a/components/bt/controller/esp32h2/Kconfig.in +++ b/components/bt/controller/esp32h2/Kconfig.in @@ -887,3 +887,7 @@ menu "Reserved Memory Config" The actual reserved memory count will be the minimum value between the maximum connection instances and the BT_LE_CONN_RESERVED_MEMORY_COUNT. endmenu + +config BT_LE_DTM_ENABLED + bool "Enable Direct Test Mode (DTM) feature" + default n diff --git a/components/bt/controller/esp32h2/ble.c b/components/bt/controller/esp32h2/ble.c index a0faf1c4e5..70fb867eec 100644 --- a/components/bt/controller/esp32h2/ble.c +++ b/components/bt/controller/esp32h2/ble.c @@ -37,6 +37,13 @@ void sync_stack_deinitEnv(void); int sync_stack_enable(void); void sync_stack_disable(void); +#if CONFIG_BT_LE_DTM_ENABLED +int dtm_stack_initEnv(void); +void dtm_stack_deinitEnv(void); +int dtm_stack_enable(void); +void dtm_stack_disable(void); +#endif // CONFIG_BT_LE_DTM_ENABLED + #if CONFIG_BT_LE_ERROR_SIM_ENABLED int conn_errorSim_initEnv(void); void conn_errorSim_deinitEnv(void); @@ -115,6 +122,12 @@ int ble_stack_initEnv(void) return rc; } +#if CONFIG_BT_LE_DTM_ENABLED + rc = dtm_stack_initEnv(); + if (rc) { + return rc; + } +#endif // CONFIG_BT_LE_DTM_ENABLED #if DEFAULT_BT_LE_MAX_CONNECTIONS rc = conn_stack_initEnv(); @@ -140,6 +153,9 @@ void ble_stack_deinitEnv(void) #endif // CONFIG_BT_LE_ERROR_SIM_ENABLED conn_stack_deinitEnv(); #endif // DEFAULT_BT_LE_MAX_CONNECTIONS +#if CONFIG_BT_LE_DTM_ENABLED + dtm_stack_deinitEnv(); +#endif // CONFIG_BT_LE_DTM_ENABLED sync_stack_deinitEnv(); extAdv_stack_deinitEnv(); adv_stack_deinitEnv(); @@ -170,6 +186,13 @@ int ble_stack_enable(void) return rc; } +#if CONFIG_BT_LE_DTM_ENABLED + rc = dtm_stack_enable(); + if (rc) { + return rc; + } +#endif // CONFIG_BT_LE_DTM_ENABLED + #if DEFAULT_BT_LE_MAX_CONNECTIONS rc = conn_stack_enable(); if (rc) { @@ -208,6 +231,9 @@ void ble_stack_disable(void) #endif // CONFIG_BT_LE_ERROR_SIM_ENABLED conn_stack_disable(); #endif // DEFAULT_BT_LE_MAX_CONNECTIONS +#if CONFIG_BT_LE_DTM_ENABLED + dtm_stack_disable(); +#endif // CONFIG_BT_LE_DTM_ENABLED sync_stack_disable(); extAdv_stack_disable(); adv_stack_disable();