mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 18:40:59 +02:00
feat(ble): support pawr feature in ble sdk on ESP32-H2
(cherry picked from commit 2f7e200fc8
)
Co-authored-by: cjin <jinchen@espressif.com>
This commit is contained in:
@@ -240,6 +240,13 @@ config BT_LE_CTE_FEATURE_ENABLED
|
|||||||
communication scenarios. If you are using chip esp32h2, ensure that encryption is
|
communication scenarios. If you are using chip esp32h2, ensure that encryption is
|
||||||
disabled when using this feature.
|
disabled when using this feature.
|
||||||
|
|
||||||
|
config BT_LE_PERIODIC_ADV_WITH_RESPONSE_ENABLED
|
||||||
|
bool "Enable BLE periodic advertising with response"
|
||||||
|
depends on BT_LE_50_FEATURE_SUPPORT
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
This enables BLE periodic advertising with response feature
|
||||||
|
|
||||||
menu "Memory Settings"
|
menu "Memory Settings"
|
||||||
depends on !BT_NIMBLE_ENABLED
|
depends on !BT_NIMBLE_ENABLED
|
||||||
|
|
||||||
|
@@ -17,11 +17,6 @@ void base_stack_deinitEnv(void);
|
|||||||
int base_stack_enable(void);
|
int base_stack_enable(void);
|
||||||
void base_stack_disable(void);
|
void base_stack_disable(void);
|
||||||
|
|
||||||
int conn_stack_initEnv(void);
|
|
||||||
void conn_stack_deinitEnv(void);
|
|
||||||
int conn_stack_enable(void);
|
|
||||||
void conn_stack_disable(void);
|
|
||||||
|
|
||||||
int adv_stack_initEnv(void);
|
int adv_stack_initEnv(void);
|
||||||
void adv_stack_deinitEnv(void);
|
void adv_stack_deinitEnv(void);
|
||||||
int adv_stack_enable(void);
|
int adv_stack_enable(void);
|
||||||
@@ -44,6 +39,30 @@ int dtm_stack_enable(void);
|
|||||||
void dtm_stack_disable(void);
|
void dtm_stack_disable(void);
|
||||||
#endif // CONFIG_BT_LE_DTM_ENABLED
|
#endif // CONFIG_BT_LE_DTM_ENABLED
|
||||||
|
|
||||||
|
#if DEFAULT_BT_LE_PAWR_SUPPORTED || CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
|
int ble_single_env_init(void);
|
||||||
|
void ble_single_env_deinit(void);
|
||||||
|
int ble_single_init(void);
|
||||||
|
void ble_single_deinit(void);
|
||||||
|
#endif // DEFAULT_BT_LE_PAWR_SUPPORTED || CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
|
|
||||||
|
#if DEFAULT_BT_LE_PAWR_SUPPORTED
|
||||||
|
int pawrBcast_stack_initEnv(void);
|
||||||
|
void pawrBcast_stack_deinitEnv(void);
|
||||||
|
int pawrBcast_stack_enable(void);
|
||||||
|
void pawrBcast_stack_disable(void);
|
||||||
|
|
||||||
|
int pawrSync_stack_initEnv(void);
|
||||||
|
void pawrSync_stack_deinitEnv(void);
|
||||||
|
int pawrSync_stack_enable(void);
|
||||||
|
void pawrSync_stack_disable(void);
|
||||||
|
#endif // DEFAULT_BT_LE_PAWR_SUPPORTED
|
||||||
|
|
||||||
|
int conn_stack_initEnv(void);
|
||||||
|
void conn_stack_deinitEnv(void);
|
||||||
|
int conn_stack_enable(void);
|
||||||
|
void conn_stack_disable(void);
|
||||||
|
|
||||||
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
|
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
int conn_errorSim_initEnv(void);
|
int conn_errorSim_initEnv(void);
|
||||||
void conn_errorSim_deinitEnv(void);
|
void conn_errorSim_deinitEnv(void);
|
||||||
@@ -142,11 +161,44 @@ int ble_stack_initEnv(void)
|
|||||||
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
|
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
|
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
|
||||||
|
|
||||||
|
#if DEFAULT_BT_LE_PAWR_SUPPORTED || CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
|
rc = ble_single_env_init();
|
||||||
|
if (rc) {
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = ble_single_init();
|
||||||
|
if (rc) {
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
#endif // DEFAULT_BT_LE_PAWR_SUPPORTED || CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
|
|
||||||
|
#if DEFAULT_BT_LE_PAWR_SUPPORTED
|
||||||
|
rc = pawrBcast_stack_initEnv();
|
||||||
|
if (rc) {
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = pawrSync_stack_initEnv();
|
||||||
|
if (rc) {
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
#endif // DEFAULT_BT_LE_PAWR_SUPPORTED
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ble_stack_deinitEnv(void)
|
void ble_stack_deinitEnv(void)
|
||||||
{
|
{
|
||||||
|
#if DEFAULT_BT_LE_PAWR_SUPPORTED
|
||||||
|
pawrSync_stack_deinitEnv();
|
||||||
|
pawrBcast_stack_deinitEnv();
|
||||||
|
#endif // DEFAULT_BT_LE_PAWR_SUPPORTED
|
||||||
|
#if DEFAULT_BT_LE_PAWR_SUPPORTED || CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
|
ble_single_deinit();
|
||||||
|
ble_single_env_deinit();
|
||||||
|
#endif // DEFAULT_BT_LE_PAWR_SUPPORTED || CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
|
|
||||||
#if DEFAULT_BT_LE_MAX_CONNECTIONS
|
#if DEFAULT_BT_LE_MAX_CONNECTIONS
|
||||||
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
|
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
conn_errorSim_deinitEnv();
|
conn_errorSim_deinitEnv();
|
||||||
@@ -156,6 +208,7 @@ void ble_stack_deinitEnv(void)
|
|||||||
#if CONFIG_BT_LE_DTM_ENABLED
|
#if CONFIG_BT_LE_DTM_ENABLED
|
||||||
dtm_stack_deinitEnv();
|
dtm_stack_deinitEnv();
|
||||||
#endif // CONFIG_BT_LE_DTM_ENABLED
|
#endif // CONFIG_BT_LE_DTM_ENABLED
|
||||||
|
|
||||||
sync_stack_deinitEnv();
|
sync_stack_deinitEnv();
|
||||||
extAdv_stack_deinitEnv();
|
extAdv_stack_deinitEnv();
|
||||||
adv_stack_deinitEnv();
|
adv_stack_deinitEnv();
|
||||||
@@ -205,6 +258,17 @@ int ble_stack_enable(void)
|
|||||||
}
|
}
|
||||||
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
|
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
|
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
|
||||||
|
#if DEFAULT_BT_LE_PAWR_SUPPORTED
|
||||||
|
rc = pawrBcast_stack_enable();
|
||||||
|
if (rc) {
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = pawrSync_stack_enable();
|
||||||
|
if (rc) {
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
#endif // DEFAULT_BT_LE_PAWR_SUPPORTED
|
||||||
|
|
||||||
#if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
#if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||||
ble_stack_enableVsCmds(true);
|
ble_stack_enableVsCmds(true);
|
||||||
@@ -224,7 +288,10 @@ void ble_stack_disable(void)
|
|||||||
ble_stack_enableVsEvents(false);
|
ble_stack_enableVsEvents(false);
|
||||||
ble_stack_enableVsCmds(false);
|
ble_stack_enableVsCmds(false);
|
||||||
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
|
||||||
|
#if DEFAULT_BT_LE_PAWR_SUPPORTED
|
||||||
|
pawrSync_stack_disable();
|
||||||
|
pawrBcast_stack_disable();
|
||||||
|
#endif // DEFAULT_BT_LE_PAWR_SUPPORTED
|
||||||
#if DEFAULT_BT_LE_MAX_CONNECTIONS
|
#if DEFAULT_BT_LE_MAX_CONNECTIONS
|
||||||
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
|
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
|
||||||
conn_errorSim_disable();
|
conn_errorSim_disable();
|
||||||
|
@@ -45,6 +45,11 @@ extern "C" {
|
|||||||
#else
|
#else
|
||||||
#define DEFAULT_BT_LE_50_FEATURE_SUPPORT (0)
|
#define DEFAULT_BT_LE_50_FEATURE_SUPPORT (0)
|
||||||
#endif
|
#endif
|
||||||
|
#if CONFIG_BT_NIMBLE_PERIODIC_ADV_WITH_RESPONSES
|
||||||
|
#define DEFAULT_BT_LE_PAWR_SUPPORTED (1)
|
||||||
|
#else
|
||||||
|
#define DEFAULT_BT_LE_PAWR_SUPPORTED (0)
|
||||||
|
#endif // CONFIG_BT_NIMBLE_PERIODIC_ADV_WITH_RESPONSES
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if CONFIG_BT_LE_LL_CFG_FEAT_LE_CODED_PHY
|
#if CONFIG_BT_LE_LL_CFG_FEAT_LE_CODED_PHY
|
||||||
@@ -71,6 +76,12 @@ extern "C" {
|
|||||||
#define DEFAULT_BT_LE_MAX_CONNECTIONS (2)
|
#define DEFAULT_BT_LE_MAX_CONNECTIONS (2)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_LE_PERIODIC_ADV_WITH_RESPONSE_ENABLED)
|
||||||
|
#define DEFAULT_BT_LE_PAWR_SUPPORTED (CONFIG_BT_LE_PERIODIC_ADV_WITH_RESPONSE_ENABLED)
|
||||||
|
#else
|
||||||
|
#define DEFAULT_BT_LE_PAWR_SUPPORTED (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_BT_LE_ACL_BUF_SIZE)
|
#if defined(CONFIG_BT_LE_ACL_BUF_SIZE)
|
||||||
#define DEFAULT_BT_LE_ACL_BUF_SIZE (CONFIG_BT_LE_ACL_BUF_SIZE)
|
#define DEFAULT_BT_LE_ACL_BUF_SIZE (CONFIG_BT_LE_ACL_BUF_SIZE)
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user