mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
feat(bt): refactor bt sdk with broker for esp32h4 and esp32s31
This commit is contained in:
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "btdm_user_cfg.h"
|
||||
#include "bredr_user_cfg.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
***************************************************************************************************
|
||||
* Local Defined Macros
|
||||
***************************************************************************************************
|
||||
*/
|
||||
#define ESP_BREDR_CTRL_CONFIG_MAGIC_VAL 0x5A5AA5A5
|
||||
#define ESP_BREDR_CTRL_CONFIG_VERSION 0x20250327
|
||||
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
#define _BT_CTRL_BREDR_INIT_CONFIG_DEFAULT() \
|
||||
{ \
|
||||
.bredr_version = ESP_BREDR_CTRL_CONFIG_VERSION, \
|
||||
.sleep_mode = 0, \
|
||||
.bt_test_mode_en = UC_BR_EDR_TEST_MODE_EN, \
|
||||
.acl_cca_en = UC_BR_EDR_TX_CCA_EN, \
|
||||
.cca_rssi_thr = -UC_BR_EDR_CCA_RSSI_THRESH, \
|
||||
.max_acl_conn = UC_BR_EDR_MAX_ACL_CONN, \
|
||||
.max_sync_conn = UC_BR_EDR_CTRL_MAX_SYNC_CONN, \
|
||||
.cpb_tx_link_num = UC_BR_EDR_CPB_TX_LINK_NB, \
|
||||
.cpb_rx_link_num = UC_BR_EDR_CPB_RX_LINK_NB, \
|
||||
.bt_sco_datapath = UC_BR_EDR_SCO_DATA_PATH, \
|
||||
.hci_tl_type = 0, \
|
||||
.hci_tl_funcs = NULL, \
|
||||
.cfg_mask = 0, \
|
||||
.hw_target_code = 0, \
|
||||
.acl_min_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_ACL_MIN, \
|
||||
.acl_max_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_ACL_MAX, \
|
||||
.apb_tx_pwr = UC_BR_EDR_TX_PWR_APB, \
|
||||
.page_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_PAGE, \
|
||||
.pscan_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_PSCAN, \
|
||||
.iscan_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_ISCAN, \
|
||||
.cpb_tx_pwr = UC_BR_EDR_TX_PWR_CPB, \
|
||||
.strain_tx_pwr = UC_BR_EDR_TX_PWR_STRAIN, \
|
||||
.rf_hw_type = 0, \
|
||||
.static_aclu_tx_buf_nb = UC_BR_EDR_ACLU_TX_BUF_NB - UC_BR_EDR_DYNAMIC_ACLU_TX_BUF_NB, \
|
||||
.dynamic_aclu_tx_buf_nb = UC_BR_EDR_DYNAMIC_ACLU_TX_BUF_NB, \
|
||||
.aclu_rx_buf_nb = UC_BR_EDR_ACLU_RX_BUF_NB, \
|
||||
.sync_tx_buf_nb = UC_BR_EDR_SYNC_TX_BUF_NB, \
|
||||
.sync_rx_buf_nb = UC_BR_EDR_SYNC_RX_BUF_NB, \
|
||||
.esco_ev4_supp = UC_BR_EDR_ESCO_EV4_SUPP, \
|
||||
.esco_ev5_supp = UC_BR_EDR_ESCO_EV5_SUPP, \
|
||||
.esco_ev3_2_supp = UC_BR_EDR_ESCO_EV3_2_SUPP, \
|
||||
.esco_ev3_3_supp = UC_BR_EDR_ESCO_EV3_3_SUPP, \
|
||||
.esco_3_slots_supp = UC_BR_EDR_ESCO_3_SLOTS_SUPP, \
|
||||
.bt_legacy_auth_vs_evt = UC_BR_EDR_LEGACY_AUTH_VENDOR_EVT, \
|
||||
.inq_filter_en = 0, \
|
||||
.dtm_en = 0, \
|
||||
.bredr_magic = ESP_BREDR_CTRL_CONFIG_MAGIC_VAL, \
|
||||
}
|
||||
#else
|
||||
#define _BT_CTRL_BREDR_INIT_CONFIG_DEFAULT() {0}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
|
||||
/*
|
||||
***************************************************************************************************
|
||||
* Type Definitions
|
||||
***************************************************************************************************
|
||||
*/
|
||||
/**
|
||||
* @brief BR/EDR audio data transport path
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_SCO_DATA_PATH_HCI = 0, /*!< data over HCI transport */
|
||||
ESP_SCO_DATA_PATH_PCM = 1, /*!< data over PCM interface */
|
||||
} esp_sco_data_path_t;
|
||||
|
||||
/**
|
||||
* @brief mempool handle type used in BR/EDR controller
|
||||
*/
|
||||
typedef void *orca_mempool_t;
|
||||
|
||||
/**
|
||||
* @brief mempool operations used in BR/EDR controller
|
||||
*/
|
||||
struct orca_mempool_ops {
|
||||
orca_mempool_t (*create_with_pool)(void *mem, size_t pool_bytes,
|
||||
size_t max_bytes); /*!< mempool construction */
|
||||
void (*destroy)(orca_mempool_t mempool); /*!< mempool destruction */
|
||||
void *(*malloc)(orca_mempool_t mempool, size_t size); /*!< allocate memory from mempool */
|
||||
void (*free)(orca_mempool_t mempool, void *ptr); /*!< release memory */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BR/EDR controller configuration options
|
||||
*/
|
||||
typedef struct {
|
||||
/*
|
||||
* Following parameters can not be configured runtime when call esp_bt_controller_init()
|
||||
* They will be overwritten by constant values from menuconfig options or from macros.
|
||||
* So, do not modify the value when esp_bt_controller_init()
|
||||
*/
|
||||
uint32_t bredr_version; /*!< version number of the defined structure */
|
||||
/*
|
||||
* Following parameters can be configured runtime, when call esp_bt_controller_init()
|
||||
*/
|
||||
uint8_t sleep_mode; /*!< controller sleep mode */
|
||||
uint8_t bt_test_mode_en; /*!< enable br/edr test mode */
|
||||
uint8_t acl_cca_en; /*!< Enable BR/EDR ACL Transmit Clear Channel Assessment (TX CCA) */
|
||||
int8_t cca_rssi_thr; /*!< BR/EDR RSSI threshold for Transmit Clear Channel Assessment (CCA) */
|
||||
uint8_t
|
||||
max_acl_conn; /*!< Maximum number of BR/EDR ACL connections. Configurable in menuconfig */
|
||||
uint8_t max_sync_conn; /*!< Maximum number of BR/EDR synchronous connections. Configurable in
|
||||
menuconfig */
|
||||
uint8_t cpb_tx_link_num; /*!< BR/EDR CPB TX link number */
|
||||
uint8_t cpb_rx_link_num; /*!< BR/EDR CPB RX link number */
|
||||
uint8_t bt_sco_datapath; /*!< SCO data path, i.e. HCI(0) or PCM(1) */
|
||||
uint8_t hci_tl_type; /*!< HCI transport layer, UART, VHCI, etc */
|
||||
void *hci_tl_funcs; /*!< hci transport functions used, must be set when hci_tl_type is UART */
|
||||
uint32_t cfg_mask; /*!< reserved */
|
||||
uint32_t hw_target_code; /*!< hardware target */
|
||||
int8_t acl_min_tx_pwr; /*!< Default transmit power for ACL minimum */
|
||||
int8_t acl_max_tx_pwr; /*!< Default transmit power for ACL maximum */
|
||||
int8_t apb_tx_pwr; /*!< Default transmit power for APB */
|
||||
int8_t page_tx_pwr; /*!< Default transmit power for Page */
|
||||
int8_t pscan_tx_pwr; /*!< Default transmit power for Page Scan */
|
||||
int8_t iscan_tx_pwr; /*!< Default transmit power for Inquiry Scan */
|
||||
int8_t cpb_tx_pwr; /*!< Default transmit power for CPB TX */
|
||||
int8_t strain_tx_pwr; /*!< Default transmit power for Synchronization Train */
|
||||
uint8_t rf_hw_type; /*!< RF hardware type */
|
||||
uint8_t static_aclu_tx_buf_nb; /*!< Static ACL-U TX buffer number */
|
||||
uint8_t dynamic_aclu_tx_buf_nb; /*!< Dynamic ACL-U TX buffer number */
|
||||
uint8_t aclu_rx_buf_nb; /*!< ACL-U RX buffer number */
|
||||
uint8_t sync_tx_buf_nb; /*!< SCO TX buffer number */
|
||||
uint8_t sync_rx_buf_nb; /*!< SCO RX buffer number */
|
||||
uint8_t esco_ev4_supp : 1; /*!< eSCO support EV4 packet type */
|
||||
uint8_t esco_ev5_supp : 1; /*!< eSCO support EV5 packet type */
|
||||
uint8_t esco_ev3_2_supp : 1; /*!< eSCO support 2-EV3 packet type */
|
||||
uint8_t esco_ev3_3_supp : 1; /*!< eSCO support 3-EV3 packet type */
|
||||
uint8_t esco_3_slots_supp : 1; /*!< eSCO support 2-EV5 and/or 3-EV5 packet type */
|
||||
uint8_t bt_legacy_auth_vs_evt
|
||||
: 1; /*!< 1 if BR/EDR Legacy Authentication Vendor Specific Event is enabled, which is
|
||||
required to protect from BIAS attack; 0 otherwise. Configurable in menuconfig */
|
||||
uint8_t inq_filter_en : 1; /*!< Enable inquiry result filter */
|
||||
uint8_t dtm_en : 1; /*!< BR/EDR direct test mode */
|
||||
uint32_t mempool_size; /*!< Required mempool size used in BR/EDR controller */
|
||||
struct orca_mempool_ops *mempool_ops; /*!< mempool operations used in BR/EDR controller */
|
||||
uint32_t bredr_magic; /*!< Magic number */
|
||||
} esp_bt_ctrl_bredr_config_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,329 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "btdm_user_cfg.h"
|
||||
#include "ble_user_cfg.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
***************************************************************************************************
|
||||
* Local Defined Macros
|
||||
***************************************************************************************************
|
||||
*/
|
||||
#define BLE_CONFIG_VERSION 0x20260123
|
||||
#define BLE_CONFIG_MAGIC 0x5A5AA5A5
|
||||
|
||||
#if defined(CONFIG_BT_LE_ISO_SUPPORT)
|
||||
#define DEFAULT_BT_LE_ISO_ENABLED 1
|
||||
#if defined(CONFIG_BT_LE_ISO_FRA_UNSEG)
|
||||
#define DEFAULT_BT_LE_ISO_FRA_UNSEG CONFIG_BT_LE_ISO_FRA_UNSEG
|
||||
#else
|
||||
#define DEFAULT_BT_LE_ISO_FRA_UNSEG (0)
|
||||
#endif
|
||||
#if defined(CONFIG_BT_LE_ISO_NSFC_EN)
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_EN CONFIG_BT_LE_ISO_NSFC_EN
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_NUM CONFIG_BT_LE_ISO_NSFC_NUM
|
||||
#else
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_EN (0)
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_NUM (0)
|
||||
#endif
|
||||
#define DEFAULT_BT_LE_ISO_BUF_COUNT CONFIG_BT_LE_ISO_BUF_COUNT
|
||||
#define DEFAULT_BT_LE_ISO_BUF_SIZE CONFIG_BT_LE_ISO_BUF_SIZE
|
||||
#define DEFAULT_BT_LE_ISO_BIG CONFIG_BT_LE_ISO_BIG
|
||||
#define DEFAULT_BT_LE_ISO_BIS CONFIG_BT_LE_ISO_BIS
|
||||
#define DEFAULT_BT_LE_ISO_BIS_PER_BIG CONFIG_BT_LE_ISO_BIS_PER_BIG
|
||||
#define DEFAULT_BT_LE_ISO_CIG CONFIG_BT_LE_ISO_CIG
|
||||
#define DEFAULT_BT_LE_ISO_CIS CONFIG_BT_LE_ISO_CIS
|
||||
#define DEFAULT_BT_LE_ISO_CIS_PER_CIG CONFIG_BT_LE_ISO_CIS_PER_CIG
|
||||
|
||||
#define DEFAULT_BT_LE_ISO_CONFIG \
|
||||
&(esp_bt_ctrl_le_iso_config_t){ \
|
||||
.iso_enabled = DEFAULT_BT_LE_ISO_ENABLED, \
|
||||
.iso_fra_unseg = DEFAULT_BT_LE_ISO_FRA_UNSEG, \
|
||||
.iso_nsfc_en = DEFAULT_BT_LE_ISO_NSFC_EN, \
|
||||
.iso_nsfc_num = DEFAULT_BT_LE_ISO_NSFC_NUM, \
|
||||
.iso_buf_count = DEFAULT_BT_LE_ISO_BUF_COUNT, \
|
||||
.iso_buf_size = DEFAULT_BT_LE_ISO_BUF_SIZE, \
|
||||
.iso_big_count = DEFAULT_BT_LE_ISO_BIG, \
|
||||
.iso_bis_count = DEFAULT_BT_LE_ISO_BIS, \
|
||||
.iso_bis_per_big = DEFAULT_BT_LE_ISO_BIS_PER_BIG, \
|
||||
.iso_cig_count = DEFAULT_BT_LE_ISO_CIG, \
|
||||
.iso_cis_count = DEFAULT_BT_LE_ISO_CIS, \
|
||||
.iso_cis_per_cig = DEFAULT_BT_LE_ISO_CIS_PER_CIG, \
|
||||
}
|
||||
#else // defined(CONFIG_BT_LE_ISO_SUPPORT)
|
||||
#define DEFAULT_BT_LE_ISO_ENABLED 0
|
||||
#define DEFAULT_BT_LE_ISO_FRA_UNSEG 0
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_EN 0
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_NUM 0
|
||||
#define DEFAULT_BT_LE_ISO_BUF_COUNT 0
|
||||
#define DEFAULT_BT_LE_ISO_BUF_SIZE 0
|
||||
#define DEFAULT_BT_LE_ISO_BIG 0
|
||||
#define DEFAULT_BT_LE_ISO_BIS 0
|
||||
#define DEFAULT_BT_LE_ISO_BIS_PER_BIG 0
|
||||
#define DEFAULT_BT_LE_ISO_CIG 0
|
||||
#define DEFAULT_BT_LE_ISO_CIS 0
|
||||
#define DEFAULT_BT_LE_ISO_CIS_PER_CIG 0
|
||||
|
||||
#define DEFAULT_BT_LE_ISO_CONFIG NULL
|
||||
#endif // defined(CONFIG_BT_LE_ISO_SUPPORT)
|
||||
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
#define _BT_CTRL_LE_INIT_CONFIG_DEFAULT() \
|
||||
{ \
|
||||
.config_version = BLE_CONFIG_VERSION, \
|
||||
.ble_ll_resolv_list_size = CONFIG_BT_LE_LL_RESOLV_LIST_SIZE, \
|
||||
.ble_hci_evt_hi_buf_count = DEFAULT_BT_LE_HCI_EVT_HI_BUF_COUNT, \
|
||||
.ble_hci_evt_lo_buf_count = DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT, \
|
||||
.ble_ll_sync_list_cnt = DEFAULT_BT_LE_MAX_PERIODIC_ADVERTISER_LIST, \
|
||||
.ble_ll_sync_cnt = DEFAULT_BT_LE_MAX_PERIODIC_SYNCS, \
|
||||
.ble_ll_rsp_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
|
||||
.ble_ll_adv_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
|
||||
.ble_ll_tx_pwr_dbm = 0, \
|
||||
.rtc_freq = 32000, \
|
||||
.ble_ll_sca = CONFIG_BT_LE_LL_SCA, \
|
||||
.ble_ll_scan_phy_number = BLE_LL_SCAN_PHY_NUMBER_N, \
|
||||
.ble_ll_conn_def_auth_pyld_tmo = BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N, \
|
||||
.ble_ll_jitter_usecs = BLE_LL_JITTER_USECS_N, \
|
||||
.ble_ll_sched_max_adv_pdu_usecs = BLE_LL_SCHED_MAX_ADV_PDU_USECS_N, \
|
||||
.ble_ll_sched_direct_adv_max_usecs = BLE_LL_SCHED_DIRECT_ADV_MAX_USECS_N, \
|
||||
.ble_ll_sched_adv_max_usecs = BLE_LL_SCHED_ADV_MAX_USECS_N, \
|
||||
.ble_scan_rsp_data_max_len = DEFAULT_BT_LE_SCAN_RSP_DATA_MAX_LEN_N, \
|
||||
.ble_ll_cfg_num_hci_cmd_pkts = BLE_LL_CFG_NUM_HCI_CMD_PKTS_N, \
|
||||
.ble_ll_ctrl_proc_timeout_ms = BLE_LL_CTRL_PROC_TIMEOUT_MS_N, \
|
||||
.nimble_max_connections = DEFAULT_BT_LE_MAX_CONNECTIONS, \
|
||||
.ble_whitelist_size = DEFAULT_BT_NIMBLE_WHITELIST_SIZE, \
|
||||
.ble_acl_buf_size = DEFAULT_BT_LE_ACL_BUF_SIZE, \
|
||||
.ble_acl_buf_count = DEFAULT_BT_LE_ACL_BUF_COUNT, \
|
||||
.ble_hci_evt_buf_size = DEFAULT_BT_LE_HCI_EVT_BUF_SIZE, \
|
||||
.ble_multi_adv_instances = DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, \
|
||||
.ble_ext_adv_max_size = DEFAULT_BT_LE_EXT_ADV_MAX_SIZE, \
|
||||
.controller_task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.controller_task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.controller_run_cpu = 0, \
|
||||
.enable_qa_test = RUN_QA_TEST, \
|
||||
.enable_bqb_test = RUN_BQB_TEST, \
|
||||
.enable_tx_cca = DEFAULT_BT_LE_TX_CCA_ENABLED, \
|
||||
.cca_rssi_thresh = 256 - DEFAULT_BT_LE_CCA_RSSI_THRESH, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
|
||||
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
|
||||
.ble_scan_classify_filter_enable = 1, \
|
||||
.main_xtal_freq = CONFIG_XTAL_FREQ, \
|
||||
.ignore_wl_for_direct_adv = 0, \
|
||||
.enable_pcl = UC_BT_CTRL_LE_POWER_CONTROL_ENABLED, \
|
||||
.csa2_select = UC_BT_CTRL_LE_50_FEATURE_SUPPORT, \
|
||||
.enable_csr = UC_BT_CTRL_LE_SUBRATE_ENABLED, \
|
||||
.ble_aa_check = UC_BT_CTRL_LE_CHECK_CONNECT_IND_ACCESS_ADDRESS, \
|
||||
.ble_llcp_disc_flag = UC_BT_CTRL_LLCP_INSTANT_PASSED_DISC_FLAGS, \
|
||||
.scan_backoff_upperlimitmax = UC_BT_CTRL_LE_SCAN_BACKOFF_UPPERLIMITMAX, \
|
||||
.ble_chan_ass_en = UC_BT_CTRL_LE_CHAN_ASS_ENABLED, \
|
||||
.ble_data_lenth_zero_aux = UC_BT_CTRL_LE_ADV_DATA_LENGTH_ZERO_AUX, \
|
||||
.vhci_enabled = CONFIG_BT_CTRL_HCI_INTERFACE_USE_RAM, \
|
||||
.ptr_check_enabled = UC_BT_CTRL_LE_PTR_CHECK_ENABLED, \
|
||||
.ble_adv_tx_options = UC_BT_CTRL_LE_ADV_TX_OPTIONS, \
|
||||
.skip_unnecessary_checks_en = 0, \
|
||||
.fast_conn_data_tx_en = UC_BT_CTRL_LE_FAST_CONN_DATA_TX_EN, \
|
||||
.ch39_txpwr = UC_BT_CTRL_LE_CH39_TX_PWR_DBM, \
|
||||
.adv_rsv_cnt = 1, \
|
||||
.conn_rsv_cnt = 1, \
|
||||
.priority_level_cfg = 0, \
|
||||
.slv_fst_rx_lat_en = 0, \
|
||||
.dl_itvl_phy_sync_en = 0, \
|
||||
.scan_allow_adi_filter = 1, \
|
||||
.enhanced_mem_resv = 1, \
|
||||
.iso_config = DEFAULT_BT_LE_ISO_CONFIG, \
|
||||
.config_magic = BLE_CONFIG_MAGIC, \
|
||||
}
|
||||
#else
|
||||
#define _BT_CTRL_LE_INIT_CONFIG_DEFAULT() {0}
|
||||
#endif // UC_BT_CTRL_BLE_IS_ENABLE
|
||||
|
||||
/*
|
||||
***************************************************************************************************
|
||||
* Type Definitions
|
||||
***************************************************************************************************
|
||||
*/
|
||||
typedef enum esp_power_level esp_power_level_t;
|
||||
typedef enum esp_ble_power_type esp_ble_power_type_t;
|
||||
|
||||
/**
|
||||
* @brief The enhanced type of which tx power, could set Advertising/Connection/Default and etc.
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT = 0,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_ADV,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_SCAN,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_INIT,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_CONN,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_MAX,
|
||||
} esp_ble_enhanced_power_type_t;
|
||||
|
||||
#if SOC_BLE_ISO_SUPPORTED
|
||||
/**
|
||||
* @brief Bluetooth LE controller ISO configuration options
|
||||
*/
|
||||
typedef struct {
|
||||
bool iso_enabled; /*!< Enable ISO support */
|
||||
bool iso_fra_unseg; /*!< Enable ISO FRA unsegmented */
|
||||
bool iso_nsfc_en; /*!< Enable ISO NSF-C */
|
||||
uint8_t iso_nsfc_num; /*!< ISO NSF-C number */
|
||||
uint8_t iso_buf_count; /*!< ISO buffer count */
|
||||
uint16_t iso_buf_size; /*!< ISO buffer size */
|
||||
uint8_t iso_big_count; /*!< ISO BIG count */
|
||||
uint16_t iso_bis_count; /*!< ISO BIS count */
|
||||
uint8_t iso_bis_per_big; /*!< ISO BIS per BIG */
|
||||
uint8_t iso_cig_count; /*!< ISO CIG count */
|
||||
uint16_t iso_cis_count; /*!< ISO CIS count */
|
||||
uint8_t iso_cis_per_cig; /*!< ISO CIS per CIG */
|
||||
} esp_bt_ctrl_le_iso_config_t;
|
||||
#endif // SOC_BLE_ISO_SUPPORTED
|
||||
|
||||
/**
|
||||
* @brief Bluetooth LE controller configuration options
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t config_version; /*!< Version number of the defined structure */
|
||||
uint16_t ble_ll_resolv_list_size; /*!< Size of the resolvable private address list */
|
||||
uint16_t ble_hci_evt_hi_buf_count; /*!< Count of high buffers for HCI events */
|
||||
uint16_t ble_hci_evt_lo_buf_count; /*!< Count of low buffers for HCI events */
|
||||
uint8_t ble_ll_sync_list_cnt; /*!< Number of synchronization lists */
|
||||
uint8_t ble_ll_sync_cnt; /*!< Number of synchronizations */
|
||||
uint16_t ble_ll_rsp_dup_list_count; /*!< Count of duplicated lists for scan response packets */
|
||||
uint16_t ble_ll_adv_dup_list_count; /*!< Count of duplicated lists for advertising packets */
|
||||
uint8_t ble_ll_tx_pwr_dbm; /*!< Tx power (transmit power) in dBm */
|
||||
uint64_t rtc_freq; /*!< Frequency of RTC (Real-Time Clock) */
|
||||
uint16_t ble_ll_sca; /*!< Sleep Clock Accuracy (SCA) parameter */
|
||||
uint8_t ble_ll_scan_phy_number; /*!< Number of PHYs supported for scanning */
|
||||
uint16_t
|
||||
ble_ll_conn_def_auth_pyld_tmo; /*!< Connection default authentication payload timeout */
|
||||
uint8_t ble_ll_jitter_usecs; /*!< Jitter time in microseconds */
|
||||
uint16_t ble_ll_sched_max_adv_pdu_usecs; /*!< Maximum time in microseconds for advertising PDU
|
||||
scheduling */
|
||||
uint16_t ble_ll_sched_direct_adv_max_usecs; /*!< Maximum time in microseconds for directed
|
||||
advertising scheduling */
|
||||
uint16_t
|
||||
ble_ll_sched_adv_max_usecs; /*!< Maximum time in microseconds for advertising scheduling */
|
||||
uint16_t ble_scan_rsp_data_max_len; /*!< Maximum length of scan response data */
|
||||
uint8_t ble_ll_cfg_num_hci_cmd_pkts; /*!< Number of HCI command packets that can be queued */
|
||||
uint32_t ble_ll_ctrl_proc_timeout_ms; /*!< Control processing timeout in milliseconds */
|
||||
uint16_t nimble_max_connections; /*!< Maximum number of connections supported */
|
||||
uint8_t ble_whitelist_size; /*!< Size of the white list */
|
||||
uint16_t ble_acl_buf_size; /*!< Buffer size of ACL (Asynchronous Connection-Less) data */
|
||||
uint16_t ble_acl_buf_count; /*!< Buffer count of ACL data */
|
||||
uint16_t ble_hci_evt_buf_size; /*!< Buffer size for HCI event data */
|
||||
uint16_t ble_multi_adv_instances; /*!< Number of advertising instances */
|
||||
uint16_t ble_ext_adv_max_size; /*!< Maximum size of extended advertising data */
|
||||
uint16_t
|
||||
controller_task_stack_size; /*!< Size of Bluetooth controller task stack, to be removed */
|
||||
uint8_t controller_task_prio; /*!< Priority of the Bluetooth task, to be removed */
|
||||
uint8_t controller_run_cpu; /*!< CPU number on which the Bluetooth controller task runs, to be
|
||||
removed */
|
||||
uint8_t enable_qa_test; /*!< Enable for QA test */
|
||||
uint8_t enable_bqb_test; /*!< Enable for BQB test */
|
||||
uint8_t enable_tx_cca; /*!< Enable Clear Channel Assessment (CCA) when transmitting */
|
||||
uint8_t cca_rssi_thresh; /*!< RSSI threshold for CCA */
|
||||
uint8_t sleep_en; /*!< Enable sleep functionality */
|
||||
uint8_t coex_phy_coded_tx_rx_time_limit; /*!< Coexistence PHY coded TX and RX time limit */
|
||||
uint8_t dis_scan_backoff; /*!< Disable scan backoff */
|
||||
uint8_t ble_scan_classify_filter_enable; /*!< Enable classification filter for BLE scan */
|
||||
uint8_t cca_drop_mode; /*!< CCA drop mode */
|
||||
int8_t cca_low_tx_pwr; /*!< Low TX power setting for CCA */
|
||||
uint8_t main_xtal_freq; /*!< Main crystal frequency */
|
||||
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the white list for directed advertising */
|
||||
uint8_t enable_pcl; /*!< Enable power control */
|
||||
uint8_t csa2_select; /*!< Select CSA#2*/
|
||||
uint8_t enable_csr; /*!< Enable CSR */
|
||||
uint8_t ble_aa_check; /*!< True if adds a verification step for the Access Address within the
|
||||
CONNECT_IND PDU; false otherwise. Configurable in menuconfig */
|
||||
uint8_t ble_llcp_disc_flag; /*!< Flag indicating whether the Controller disconnects after
|
||||
Instant Passed (0x28) error occurs. Configurable in menuconfig.
|
||||
- The Controller does not disconnect after Instant Passed (0x28)
|
||||
by default. */
|
||||
uint16_t scan_backoff_upperlimitmax; /*!< The value of upperlimitmax is 2^n, The maximum value
|
||||
is 256 */
|
||||
uint8_t
|
||||
ble_chan_ass_en; /*!< Enable / disable BLE channel assessment. Configurable in menuconfig.
|
||||
- 0 - Disable
|
||||
- 1 - Enable (default) */
|
||||
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 */
|
||||
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
|
||||
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
|
||||
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform
|
||||
extra handling for fatal checks. */
|
||||
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
|
||||
- 0 - Disable
|
||||
- 1 - Enable (default) */
|
||||
int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */
|
||||
uint8_t adv_rsv_cnt; /*!< BLE adv state machine reserve count number */
|
||||
uint8_t conn_rsv_cnt; /*!< BLE conn state machine reserve count number */
|
||||
uint8_t priority_level_cfg; /*!< The option for priority level configuration */
|
||||
uint8_t
|
||||
slv_fst_rx_lat_en; /*!< The option for enabling slave fast PDU reception during latency. */
|
||||
uint8_t dl_itvl_phy_sync_en; /*!< The option for automatically initiate the data length update
|
||||
when phy update or connect interval update. */
|
||||
uint8_t scan_allow_adi_filter; /*!< The option for ext scan to allow PDU with specific adi. */
|
||||
uint8_t enhanced_mem_resv; /*!< The option masks the BLE events with all reserved memory. */
|
||||
// at initialization. */
|
||||
#if SOC_BLE_ISO_SUPPORTED
|
||||
esp_bt_ctrl_le_iso_config_t *iso_config; /*!< The option for ISO configuration */
|
||||
#endif // SOC_BLE_ISO_SUPPORTED
|
||||
uint32_t config_magic; /*!< Configuration magic value */
|
||||
} esp_bt_ctrl_le_config_t;
|
||||
|
||||
/**
|
||||
* @brief Set BLE TX power
|
||||
* Connection Tx power should only be set after connection created.
|
||||
* @param power_type : The type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @param power_level: Power level(index) corresponding to absolute value(dbm)
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_t power_level);
|
||||
|
||||
/**
|
||||
* @brief Get BLE TX power
|
||||
* Connection Tx power should only be get after connection created.
|
||||
* @param power_type : The type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @return >= 0 - Power level, < 0 - Invalid
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type);
|
||||
|
||||
/**
|
||||
* @brief ENHANCED API for Setting BLE TX power
|
||||
* Connection Tx power should only be set after connection created.
|
||||
* @param power_type : The enhanced type of which tx power, could set
|
||||
* Advertising/Connection/Default and etc
|
||||
* @param handle : The handle of Advertising or Connection and the value 0 for other enhanced power
|
||||
* types.
|
||||
* @param power_level: Power level(index) corresponding to absolute value(dbm)
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle,
|
||||
esp_power_level_t power_level);
|
||||
|
||||
/**
|
||||
* @brief ENHANCED API of Getting BLE TX power
|
||||
* Connection Tx power should only be get after connection created.
|
||||
* @param power_type : The enhanced type of which tx power, could set
|
||||
* Advertising/Connection/Default and etc
|
||||
* @param handle : The handle of Advertising or Connection and the value 0 for other enhanced power
|
||||
* types.
|
||||
* @return >= 0 - Power level, < 0 - Invalid
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type,
|
||||
uint16_t handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,549 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// @brief HCI VS Commands for Espressif's Bluetooth LE Host
|
||||
//
|
||||
// @note The following vendor-specific HCI commands are exclusively for Espressif's Bluetooth LE Host (ESP-Bluedroid Host or ESP-NimBLE Host).
|
||||
// If you are using a non-ESP host or HCI UART, these commands will remain disabled unless enabling the feature in the menuconfig (CONFIG_BT_CTRL_LE_VS_CMD_EVT_ENABLED).
|
||||
// Note, these additional HCI VS commands are intended for Espressif's Bluetooth Host use only.
|
||||
// Application developers **should not** enable these commands in their applications.
|
||||
//
|
||||
|
||||
/**
|
||||
* @brief Config scanning duplicate exceptional list (OCF: 0x0108)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_CONFIG_DUP_EXC_LIST_OCF (0x0108)
|
||||
/**
|
||||
* @brief Update exception list cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_update_exc_list {
|
||||
uint8_t subcode; /*!< Add, remove or clear exception list */
|
||||
uint32_t type; /*!< device type */
|
||||
uint8_t device_info[6]; /*!< device information */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable/disable advertising report flow control (OCF: 0x0109)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_ADV_REPORT_FLOW_CTRL_OCF (0x0109)
|
||||
/**
|
||||
* @brief Init ADV flow control cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_init_adv_flow_ctrl {
|
||||
uint8_t enable; /*!< Enable ADV flow control */
|
||||
uint16_t num; /*!< ADV buffer maximum value */
|
||||
uint16_t adv_lost_threshold; /*!< ADV lost event triggered threshold */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Update the number of advertising report in ADV flow control (OCF: 0x010A)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_UPD_ADV_REPORT_FLOW_CTRL_NUM_OCF (0x010a)
|
||||
/**
|
||||
* @brief Update ADV flow control cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_update_adv_flow_ctrl {
|
||||
uint16_t num; /*!< The number of ADV report processed */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Clear legacy advertising (same as HCI_LE_Clear_Advertising_Sets) (OCF: 0x010C)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_CLR_LEGACY_ADV_OCF (0x010c)
|
||||
/**
|
||||
* @brief Clear legacy ADV cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_clr_legacy_adv {
|
||||
// no parameters
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set parameters of duplicate list (OCF: 0x010D)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_DUP_LIST_PARAMS_OCF (0x010d)
|
||||
/**
|
||||
* @brief Set duplicate list cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_dup_params {
|
||||
uint8_t dup_mode; /*!< Duplicate mode */
|
||||
uint8_t dup_ad_type; /*!< Duplicate data type */
|
||||
uint16_t ring_list_max_num; /*!< Duplicate list size */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable/disable duplicate and exception list (OCF: 0x010E)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_ENABLE_DUP_EXC_LIST_OCF (0x010e)
|
||||
/**
|
||||
* @brief Enable duplicate and exception list cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_enable_dup_exc {
|
||||
uint8_t enable; /*!< Enable or disable */
|
||||
uint8_t ring_list_reset; /*!< Reset list */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable optimization of multiple connections (OCF: 0x010F)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_ENABLE_ARRANGEMENT_OCF (0x010f)
|
||||
/**
|
||||
* @brief Multiple connections optimization cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_enable_arrangement {
|
||||
uint32_t common_factor; /*!< The greatest common factor of connection interval */
|
||||
uint8_t enable; /*!< Enable or disable */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set scheduling length for a certain role (OCF: 0x0110)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_SCHED_ROLE_LEN_OCF (0x0110)
|
||||
/**
|
||||
* @brief Scheduling length cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_sched_role_len {
|
||||
uint8_t role; /*!< BLE role; 0: central; 1: peripheral */
|
||||
uint32_t len; /*!< Length is us */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set RSSI threshold for automatic power control (OCF: 0x0111)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_PCL_RSSI_THRESH_OCF (0x0111)
|
||||
/**
|
||||
* @brief PCL RSSI threshold cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_pcl_rssi_thresh {
|
||||
uint16_t conn_handle; /*!< Connection handle */
|
||||
uint8_t rssi_thresh_min_1M; /*!< Lower limit for 1M */
|
||||
uint8_t rssi_thresh_max_1M; /*!< Upper limit for 1M */
|
||||
uint8_t rssi_thresh_min_2M; /*!< Lower limit for 2M */
|
||||
uint8_t rssi_thresh_max_2M; /*!< Upper limit for 2M */
|
||||
uint8_t rssi_thresh_min_s2coded; /*!< Lower limit for s2 coded */
|
||||
uint8_t rssi_thresh_max_s2coded; /*!< Upper limit for s2 coded */
|
||||
uint8_t rssi_thresh_min_s8coded; /*!< Lower limit for s8 coded */
|
||||
uint8_t rssi_thresh_max_s8coded; /*!< Upper limit for s8 coded */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable/disable channel selection algorithm #2 (OCF: 0x0112)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_ENABLE_CSA2_OCF (0x0112)
|
||||
/**
|
||||
* @brief Enable/disable channel selection algorithm #2 cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_csa_enable {
|
||||
uint8_t csa2_select; /*!< Select CSA2 */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set parameters of controller logs (OCF: 0x0114)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_LOG_PARAMS_OCF (0x0114)
|
||||
/**
|
||||
* @brief Controller logs cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_log_params {
|
||||
uint8_t type; /*!< Operation type */
|
||||
uint32_t output_enable; /*!< Enable/disable output */
|
||||
uint8_t buffer_optoin; /*!< Select log buffers */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set BLE vendor events mask (OCF: 0x0116)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_LE_VENDOR_EVTS_MASK_OCF (0x0116)
|
||||
/**
|
||||
* @brief Set BLE vendor events mask cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_vs_evts_mask {
|
||||
uint32_t evt_masks; /*!< BLE vendor events Mask */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set connection protected TX/RX threshold (OCF: 0x0117)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_CONN_PROT_TX_RX_THRESH_OCF (0x0117)
|
||||
/**
|
||||
* @brief Set connection protected TX/RX threshold cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_set_conn_prot_tx_rx_thresh {
|
||||
uint8_t use_default_thresh; /*!< Use default threshold */
|
||||
uint8_t threshold; /*!< Threshold */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set peer sleep clock accuracy to a constant value (OCF: 0x0118)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_CONST_PEER_SCA_OCF (0x0118)
|
||||
/**
|
||||
* @brief Peer constant SCA cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_const_peer_sca {
|
||||
uint16_t peer_sca; /*!< Peer SCA */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Get CTE hardware information (OCF: 0x011B)
|
||||
*
|
||||
* @note This command is only used by internal test.
|
||||
*/
|
||||
#define ESP_BT_VS_GET_CTE_HW_INFO (0x011B)
|
||||
|
||||
/**
|
||||
* @brief Set CTE calibration receive parameter (OCF: 0x011C)
|
||||
*
|
||||
* @note This command is only used by internal test.
|
||||
*/
|
||||
#define ESP_BT_VS_SET_CTE_CAL_RECV_PARAM (0x011C)
|
||||
|
||||
/**
|
||||
* @brief Set CTE calibration transmit parameter (OCF: 0x011D)
|
||||
*
|
||||
* @note This command is only used by internal test.
|
||||
*/
|
||||
#define ESP_BT_VS_SET_CTE_CAL_TRANS_PARAM (0x011D)
|
||||
|
||||
/**
|
||||
* @brief Set CTE calibration BB parameter (OCF: 0x011E)
|
||||
*
|
||||
* @note This command is only used by internal test.
|
||||
*/
|
||||
#define ESP_BT_VS_SET_CTE_CAL_BB_PARAM (0x011E)
|
||||
|
||||
/**
|
||||
* @brief Set CTE calibration LC parameter (OCF: 0x011F)
|
||||
*
|
||||
* @note This command is only used by internal test.
|
||||
*/
|
||||
#define ESP_BT_VS_SET_CTE_CAL_LC_PARAM (0x011F)
|
||||
|
||||
/**
|
||||
* @brief Set CTE calibration state (OCF: 0x0120)
|
||||
*
|
||||
* @note This command is only used by internal test.
|
||||
*/
|
||||
#define ESP_BT_VS_SET_CTE_CAL_STATE (0x0120)
|
||||
|
||||
/**
|
||||
* @brief Set CTE calibration TX data (OCF: 0x0121)
|
||||
*
|
||||
* @note This command is only used by internal test.
|
||||
*/
|
||||
#define ESP_BT_VS_SET_CTE_CAL_TX_DATA (0x0121)
|
||||
|
||||
/**
|
||||
* @brief Disable advertising random delay (OCF: 0x0122)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_DISABLE_ADV_RANDOM_DELAY_OCF (0x0122)
|
||||
/**
|
||||
* @brief Disable advertising random delay cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_disable_adv_random_delay {
|
||||
uint8_t disable; /*!< Enable or disable */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set default coded PHY (OCF: 0x0123)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_PREFERRED_CODED_PHY_OCF (0x0123)
|
||||
/**
|
||||
* @brief Set default coded PHY cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_set_preferred_coded_phy {
|
||||
uint8_t perfer_s2_coded; /*!< 500k by default */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set scan forever (OCF: 0x0124)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_SCAN_FOREVER_OCF (0x0124)
|
||||
/**
|
||||
* @brief Set scan forever cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_scan_forever {
|
||||
uint8_t scan_forever; /*!< Scan forever */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set TX power level enhanced (OCF: 0x0125)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_TXPWR_LVL_ENH_OCF (0x0125)
|
||||
/**
|
||||
* @brief Set TX power level enhanced cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_set_txpwr_lvl_enhanced {
|
||||
uint8_t type; /*!< Type */
|
||||
int txpwr_lvl; /*!< TX power level enhancement */
|
||||
uint16_t handle; /*!< Handle */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Get TX power level enhanced (OCF: 0x0126)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_GET_TXPWR_LVL_ENH_OCF (0x0126)
|
||||
/**
|
||||
* @brief Get TX power level enhanced cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_get_txpwr_lvl_enhanced {
|
||||
uint8_t type; /*!< Type */
|
||||
uint16_t handle; /*!< Handle */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable/disable CCA (OCF: 0x0127)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_ENABLE_CCA_OCF (0x0127)
|
||||
/**
|
||||
* @brief Enable/disable CCA cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_enable_cca {
|
||||
uint8_t enable; /*!< Enable or disable */
|
||||
int8_t threshold; /*!< Threshold */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set RX sensitivity threshold (OCF: 0x0128)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_RX_SENS_THRESH_OCF (0x0128)
|
||||
/**
|
||||
* @brief Set RX sensitivity threshold cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_set_rx_sens_thresh {
|
||||
uint8_t enabled; /*!< Enable or disable */
|
||||
uint8_t phy; /*!< Type */
|
||||
int8_t threshold_dbm; /*!< Threshold in dBm */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set scan backoff uplimit (OCF: 0x0129)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_SCAN_BACKOFF_UPLIMIT_OCF (0x0129)
|
||||
/**
|
||||
* @brief Set scan backoff uplimit cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_set_scan_backoff_uplimit {
|
||||
uint16_t max_uplimit; /*!< Maximum uplimit */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set extended advertising constant DID (OCF: 0x012a)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_EXT_ADV_CONSTANT_DID_OCF (0x012a)
|
||||
/**
|
||||
* @brief Set extended advertising constant DID cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_set_ext_adv_constant_did {
|
||||
uint16_t handle; /*!< Handle */
|
||||
uint8_t enable; /*!< Enable or disable */
|
||||
uint16_t did; /*!< DID */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set scan ADI filter (OCF: 0x012b)
|
||||
*
|
||||
*/
|
||||
#define ESP_BT_VS_SET_SCAN_ADI_FILTER_OCF (0x012b)
|
||||
/**
|
||||
* @brief Scan ADI filter parameter entry
|
||||
*/
|
||||
struct bt_hci_vs_adi_entry {
|
||||
uint8_t sid; /*!< Expected SID */
|
||||
uint16_t did_cnt; /*!< DID count */
|
||||
uint16_t did[0]; /*!< Expected DID list */
|
||||
};
|
||||
/**
|
||||
* @brief Set scan ADI filter cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_set_scan_adi_filter {
|
||||
uint8_t enable; /*!< Enable or disable ADI filter */
|
||||
uint8_t dup_filter; /*!< Enable duplicate filter */
|
||||
uint8_t sid_num; /*!< SID number */
|
||||
struct bt_hci_vs_adi_entry adi_entry[0]; /*!< ADIs list */
|
||||
};
|
||||
|
||||
// @brief HCI VS Events for Espressif's Bluetooth LE Host
|
||||
//
|
||||
// @note The following HCI VS events are exclusively for Espressif's Bluetooth LE Host (ESP-Bluedroid Host or ESP-NimBLE Host).
|
||||
// If you are using a non-ESP host or HCI UART, these events will remain disabled unless the initialization function is explicitly called from the application.
|
||||
// Note, these init functions as well as these additional HCI VS events are intended for Espressif's Bluetooth Host use only.
|
||||
// Application developers **should not** call the init functions in their applications.
|
||||
//
|
||||
|
||||
/**
|
||||
* @brief BLE Scan/Connect Request, Aux Connect Response received event (EVTCODE: 0xFF, SUBCODE: 0xC0)
|
||||
*
|
||||
* @note The init function is `adv_stack_enableScanReqRxdVsEvent(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_CONN_SCAN_REQ_RXED_EVT_SUBCODE (0xC0)
|
||||
/**
|
||||
* @brief BLE Scan/Connect Request, Aux Connect Response received event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_conn_scan_req_rxed_evt {
|
||||
uint8_t evt_type; /*!< Event type; 0: SCAN_REQ; 1: CONN_IND */
|
||||
uint8_t handle; /*!< Advertisement handle */
|
||||
uint8_t peer_addr_type; /*!< Peer address type */
|
||||
uint8_t peer_addr[6]; /*!< Peer address */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BLE Channel Map Update Completion event (EVTCODE: 0xFF, SUBCODE: 0xC1)
|
||||
*
|
||||
* @note The init function is `conn_stack_enableChanMapUpdCompVsEvent(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_CHAN_UPDATE_COMP_EVT_SUBCODE (0xC1)
|
||||
/**
|
||||
* @brief BLE Channel Map Update Completion event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_chan_update_comp_evt {
|
||||
uint8_t status; /*!< Controller error code */
|
||||
uint16_t handle; /*!< Connection handle */
|
||||
uint8_t ch_map[5]; /*!< Updated channel map */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BLE Wakeup From Sleep event (EVTCODE: 0xFF, SUBCODE: 0xC3)
|
||||
*
|
||||
* @note The init function is `sleep_stack_enableWakeupVsEvent(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_SLEEP_WAKEUP_EVT_SUBCODE (0xC3)
|
||||
/**
|
||||
* @brief BLE wakeup event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_sleep_wakeup_evt {
|
||||
// no parameters
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BLE advertising report lost event for flow control (EVTCODE: 0x3E, SUBCODE: 0xF0)
|
||||
*
|
||||
* @note The init function is `scan_stack_enableAdvFlowCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_ADV_LOST_EVT_SUBCODE (0xF0)
|
||||
/**
|
||||
* @brief ADV lost event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_adv_lost_evt {
|
||||
uint32_t nb_lost; /*!< The number of ADV report discarded */
|
||||
};
|
||||
|
||||
//
|
||||
// @brief HCI VS Commands for Espressif's Internal-Use Debugging
|
||||
//
|
||||
// @note The following HCI VS debugging commands are implemented in Bluetooth LE controller pre-compiled libraries.
|
||||
// These commands are not linked into the application binary, unless the function `esp_ble_internalTestFeaturesEnable(true)`is called from the application.
|
||||
// They are intended for Espressif's internal use only. Application developers **should not** call `esp_ble_internalTestFeaturesEnable(true)` in their applications.
|
||||
//
|
||||
|
||||
#define ESP_BT_VS_CFG_TEST_RELATED_OCF (0x0113)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_SUBCMD (0X00)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_ADV_DELAY_SUBCMD (0X01)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_PREF_CODED_SUBCMD (0X02)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_DEFAULT_PRIV_MODE_SUBCMD (0X03)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCAN_FOREVER_SUBCMD (0X04)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_EXPECTED_PEER_SUBCMD (0X05)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_ADV_TXED_CNT_SUBCMD (0X06)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_SCAN_RXED_CNT_SUBCMD (0X07)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_TXPWR_LVL_SUBCMD (0X08)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXPWR_LVL_SUBCMD (0X09)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_TXPWR_LVL_ENH_SUBCMD (0X0a)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXPWR_LVL_ENH_SUBCMD (0X0b)
|
||||
#define ESP_BT_VS_CFG_TEST_IGNORE_WL_FOR_DIR_ADV_SUBCMD (0X0c)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_ADV_RXED_RSSI_SUBCMD (0X0d)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_CCA_SUBCMD (0X0e)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_CCA_WIN_SUBCMD (0X0f)
|
||||
#define ESP_BT_VS_CFG_TEST_READ_CCA_DATA_SUBCM (0X10)
|
||||
#define ESP_BT_VS_CFG_TEST_CLEAR_RAND_ADDR_SUBCMD (0X11)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_MAX_TXPWR_SUBCMD (0X12)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXPWR_RANGE_SUBCMD (0X13)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCAN_AA_SUBCMD (0X14)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_ADV_AA_SUBCMD (0X15)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCAN_CHAN_SUBCMD (0X16)
|
||||
#define ESP_BT_VS_CFG_TEST_SKIP_LIGHT_SLEEP_CHECK_SUBCMD (0X17)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_WAKEUP_OVERHEAD_SUBCMD (0X18)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_ADV_MIN_ITVL_SUBCMD (0X19)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_CTRL_STATUS_SUBCMD (0X1a)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_CONN_PHY_TXPWR_SUBCMD (0X1b)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_CONN_PHY_TXPWR_SUBCMD (0X1c)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_RXBUF_EMPTY_CNT_SUBCMD (0X1d)
|
||||
#define ESP_BT_VS_CFG_TEST_RESTART_SUBCMD (0X1e)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_RECODE_RX_STATE_SUBCMD (0X1f)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_RECODE_CNT_SUBCMD (0X20)
|
||||
#define ESP_BT_VS_CFG_TEST_CLR_RECODE_CNT_SUBCMD (0X21)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_CTRL_COMPILE_VER_SUBCMD (0X24)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_AUX_ADV_OFFSET_SUBCMD (0X25)
|
||||
#define ESP_BT_VS_CFG_TEST_INIT_FLEXIBLE_MODE_SUBCMD (0X26)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_FLEXIBLE_MODE_SUBCMD (0X27)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_FLEXIBLE_CONN_ERR_SUBCMD (0X28)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_FLEXIBLE_ADV_ERR_SUBCMD (0X29)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_FLEXIBLE_SCAN_ERR_SUBCMD (0X2a)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXED_CRCERR_SUBCMD (0X2c)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_BACKOFF_UPLIMIT_SUBCMD (0X2d)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_RXED_ADV_ADI_SUBCMD (0X2f)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCH_RAND_MODE_SUBCMD (0X30)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_RX_SENS_THRESH_SUBCMD (0X31)
|
||||
#define ESP_BT_VS_CFG_TEST_CHECK_MSYS_BUF_SUBCMD (0X32)
|
||||
#define ESP_BT_VS_CFG_TEST_UPDATE_BLE_TIMER_SUBCMD (0X33)
|
||||
#define ESP_BT_VS_CFG_TEST_UPDATE_BLE_RTC_SUBCMD (0X34)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_LOCKED_MEM_NUM_SUBCMD (0X35)
|
||||
#define ESP_BT_VS_CFG_TEST_ALLOW_MEM_ALLOC_SUBCMD (0X36)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCH_RAND_INFO_PTR_SUBCMD (0X37)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_DIAG_IO_SUBCMD (0X38)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_AGC_MAX_GAIN_SUBCMD (0X39)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_CHAN_ASSESS_SUBCMD (0X40)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_BACKOFF_UPLIMIT_SUBCMD (0X41)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_CONN_TOP_PRIO_RESV_THRESH_SUBCMD (0X42)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_TEST_EVT_MSK_SUBCMD (0X43)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_WAKEUP_TIMEOUT_SUBCMD (0X45)
|
||||
#define ESP_BT_VS_CFG_TEST_RELATED_SUBCMD_MAX (0Xff)
|
||||
|
||||
//
|
||||
// @brief HCI VS Events for Espressif's Internal-Use Debugging
|
||||
//
|
||||
// @note The following HCI VS debugging events are implemented in Bluetooth LE controller pre-compiled libraries.
|
||||
// These events are not linked into the application binary, unless the function `esp_ble_internalTestFeaturesEnable(true)`is called from the application.
|
||||
// Application developers **should not** call `esp_ble_internalTestFeaturesEnable(true)` in their applications.
|
||||
//
|
||||
|
||||
#define ESP_BT_VS_LE_RUNNING_STATUS_EVT_SUBCODE (0xC3)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -4,533 +4,343 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef __ESP_BT_H__
|
||||
#define __ESP_BT_H__
|
||||
#ifndef __ESP_BT_H__
|
||||
#define __ESP_BT_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "esp_err.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_task.h"
|
||||
#include "esp_assert.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "esp_err.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_task.h"
|
||||
#include "esp_assert.h"
|
||||
|
||||
#include "btdm_user_cfg.h"
|
||||
#include "btdm_user_cfg.h"
|
||||
|
||||
#if CONFIG_BTDM_CTRL_MODE_BLE_ONLY || CONFIG_BTDM_CTRL_MODE_BTDM
|
||||
#include "ble_user_cfg.h"
|
||||
#endif /* CONFIG_BTDM_CTRL_MODE_BLE_ONLY || CONFIG_BTDM_CTRL_MODE_BTDM */
|
||||
#if SOC_BT_CLASSIC_SUPPORTED
|
||||
#include "../../common/btdm_bredr.h"
|
||||
#endif // SOC_BT_CLASSIC_SUPPORTED
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#include "driver/uart.h"
|
||||
#endif
|
||||
#if SOC_BLE_SUPPORTED
|
||||
#include "../../common/btdm_le.h"
|
||||
#endif /* SOC_BLE_SUPPORTED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#include "driver/uart.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Bluetooth mode for controller enable/disable.
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_BT_MODE_IDLE = 0x00, /*!< Bluetooth is not running */
|
||||
ESP_BT_MODE_BLE = 0x01, /*!< Run BLE mode */
|
||||
ESP_BT_MODE_CLASSIC_BT = 0x02, /*!< Run Classic BT mode */
|
||||
ESP_BT_MODE_BTDM = 0x03, /*!< Run dual mode */
|
||||
} esp_bt_mode_t;
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Bluetooth controller enable/disable/initialised/de-initialised status.
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_BT_CONTROLLER_STATUS_IDLE = 0, /*!< Controller is in idle state */
|
||||
ESP_BT_CONTROLLER_STATUS_INITED, /*!< Controller is in initialising state */
|
||||
ESP_BT_CONTROLLER_STATUS_ENABLED, /*!< Controller is in enabled state */
|
||||
ESP_BT_CONTROLLER_STATUS_NUM, /*!< Controller is in disabled state */
|
||||
} esp_bt_controller_status_t;
|
||||
/**
|
||||
* @brief Bluetooth mode for controller enable/disable.
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_BT_MODE_IDLE = 0x00, /*!< Bluetooth is not running */
|
||||
ESP_BT_MODE_BLE = 0x01, /*!< Run BLE mode */
|
||||
ESP_BT_MODE_CLASSIC_BT = 0x02, /*!< Run Classic BT mode */
|
||||
ESP_BT_MODE_BTDM = 0x03, /*!< Run dual mode */
|
||||
} esp_bt_mode_t;
|
||||
|
||||
/**
|
||||
* @brief BLE tx power type
|
||||
* ESP_BLE_PWR_TYPE_CONN_HDL0-8: for each connection, and only be set after connection completed.
|
||||
* when disconnect, the correspond TX power is not effected.
|
||||
* ESP_BLE_PWR_TYPE_ADV : for advertising/scan response.
|
||||
* ESP_BLE_PWR_TYPE_SCAN : for scan.
|
||||
* ESP_BLE_PWR_TYPE_DEFAULT : if each connection's TX power is not set, it will use this default value.
|
||||
* if neither in scan mode nor in adv mode, it will use this default value.
|
||||
* If none of power type is set, system will use ESP_PWR_LVL_P3 as default for ADV/SCAN/CONN0-9.
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL0 = 0, /*!< For connection handle 0 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL1 = 1, /*!< For connection handle 1 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL2 = 2, /*!< For connection handle 2 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL3 = 3, /*!< For connection handle 3 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL4 = 4, /*!< For connection handle 4 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL5 = 5, /*!< For connection handle 5 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL6 = 6, /*!< For connection handle 6 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL7 = 7, /*!< For connection handle 7 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL8 = 8, /*!< For connection handle 8 */
|
||||
ESP_BLE_PWR_TYPE_ADV = 9, /*!< For advertising */
|
||||
ESP_BLE_PWR_TYPE_SCAN = 10, /*!< For scan */
|
||||
ESP_BLE_PWR_TYPE_DEFAULT = 11, /*!< For default, if not set other, it will use default value */
|
||||
ESP_BLE_PWR_TYPE_NUM = 12, /*!< TYPE numbers */
|
||||
} esp_ble_power_type_t;
|
||||
/**
|
||||
* @brief Bluetooth controller enable/disable/initialised/de-initialised status.
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_BT_CONTROLLER_STATUS_IDLE = 0, /*!< Controller is in idle state */
|
||||
ESP_BT_CONTROLLER_STATUS_INITED, /*!< Controller is in initialising state */
|
||||
ESP_BT_CONTROLLER_STATUS_ENABLED, /*!< Controller is in enabled state */
|
||||
ESP_BT_CONTROLLER_STATUS_NUM, /*!< Controller is in disabled state */
|
||||
} esp_bt_controller_status_t;
|
||||
|
||||
/**
|
||||
* @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm).
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */
|
||||
ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */
|
||||
ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */
|
||||
ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */
|
||||
ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */
|
||||
ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */
|
||||
ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */
|
||||
ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */
|
||||
ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */
|
||||
ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */
|
||||
ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */
|
||||
ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */
|
||||
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
|
||||
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
|
||||
ESP_PWR_LVL_P16 = 14, /*!< Corresponding to +16dbm */
|
||||
ESP_PWR_LVL_P17 = 15, /*!< Corresponding to +17dbm */
|
||||
ESP_PWR_LVL_P18 = 16, /*!< Corresponding to +18dbm */
|
||||
ESP_PWR_LVL_P19 = 17, /*!< Corresponding to +19dbm */
|
||||
ESP_PWR_LVL_P20 = 18, /*!< Corresponding to +20dbm */
|
||||
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
|
||||
} esp_power_level_t;
|
||||
/**
|
||||
* @brief BLE tx power type
|
||||
* ESP_BLE_PWR_TYPE_CONN_HDL0-8: for each connection, and only be set after connection completed.
|
||||
* when disconnect, the correspond TX power is not effected.
|
||||
* ESP_BLE_PWR_TYPE_ADV : for advertising/scan response.
|
||||
* ESP_BLE_PWR_TYPE_SCAN : for scan.
|
||||
* ESP_BLE_PWR_TYPE_DEFAULT : if each connection's TX power is not set, it will use this default value.
|
||||
* if neither in scan mode nor in adv mode, it will use this default value.
|
||||
* If none of power type is set, system will use ESP_PWR_LVL_P3 as default for ADV/SCAN/CONN0-9.
|
||||
*/
|
||||
typedef enum esp_ble_power_type {
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL0 = 0, /*!< For connection handle 0 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL1 = 1, /*!< For connection handle 1 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL2 = 2, /*!< For connection handle 2 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL3 = 3, /*!< For connection handle 3 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL4 = 4, /*!< For connection handle 4 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL5 = 5, /*!< For connection handle 5 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL6 = 6, /*!< For connection handle 6 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL7 = 7, /*!< For connection handle 7 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL8 = 8, /*!< For connection handle 8 */
|
||||
ESP_BLE_PWR_TYPE_ADV = 9, /*!< For advertising */
|
||||
ESP_BLE_PWR_TYPE_SCAN = 10, /*!< For scan */
|
||||
ESP_BLE_PWR_TYPE_DEFAULT = 11, /*!< For default, if not set other, it will use default value */
|
||||
ESP_BLE_PWR_TYPE_NUM = 12, /*!< TYPE numbers */
|
||||
} esp_ble_power_type_t;
|
||||
|
||||
/**
|
||||
* @brief The enhanced type of which tx power, could set Advertising/Connection/Default and etc.
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT = 0,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_ADV,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_SCAN,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_INIT,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_CONN,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_MAX,
|
||||
} esp_ble_enhanced_power_type_t;
|
||||
/**
|
||||
* @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm).
|
||||
*/
|
||||
typedef enum esp_power_level {
|
||||
ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */
|
||||
ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */
|
||||
ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */
|
||||
ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */
|
||||
ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */
|
||||
ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */
|
||||
ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */
|
||||
ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */
|
||||
ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */
|
||||
ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */
|
||||
ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */
|
||||
ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */
|
||||
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
|
||||
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
|
||||
ESP_PWR_LVL_P16 = 14, /*!< Corresponding to +16dbm */
|
||||
ESP_PWR_LVL_P17 = 15, /*!< Corresponding to +17dbm */
|
||||
ESP_PWR_LVL_P18 = 16, /*!< Corresponding to +18dbm */
|
||||
ESP_PWR_LVL_P19 = 17, /*!< Corresponding to +19dbm */
|
||||
ESP_PWR_LVL_P20 = 18, /*!< Corresponding to +20dbm */
|
||||
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
|
||||
} esp_power_level_t;
|
||||
|
||||
/**
|
||||
* @brief Select buffers
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_BLE_LOG_BUF_HCI = 0x02,
|
||||
ESP_BLE_LOG_BUF_CONTROLLER = 0x05,
|
||||
} esp_ble_log_buf_t;
|
||||
|
||||
/**
|
||||
* @brief Address type and address value.
|
||||
*/
|
||||
/**
|
||||
* @brief Address type and address value.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t type; /*!< Type of the Bluetooth address (public, random, etc.) */
|
||||
uint8_t val[6]; /*!< Array containing the 6-byte Bluetooth address value */
|
||||
} esp_ble_addr_t;
|
||||
uint8_t type; /*!< Type of the Bluetooth address (public, random, etc.) */
|
||||
uint8_t val[6]; /*!< Array containing the 6-byte Bluetooth address value */
|
||||
} esp_ble_addr_t;
|
||||
|
||||
#define BTDM_CONFIG_VERSION 0x20260127
|
||||
#define BTDM_CONFIG_MAGIC_VALUE 0x5a5aa5a5
|
||||
|
||||
#define BLE_CONFIG_VERSION 0x20241029
|
||||
#define BLE_CONFIG_MAGIC 0x5A5AA5A5
|
||||
/* Types definition
|
||||
************************************************************************
|
||||
*/
|
||||
|
||||
#define BTDM_CONFIG_VERSION 0x20260127
|
||||
#define BTDM_CONFIG_MAGIC_VALUE 0x5a5aa5a5
|
||||
/**
|
||||
* @brief BTDM controller common configuration options
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t version; /*!< Version number of the defined structure */
|
||||
uint16_t task_stack_size; /*!< Size of Bluetooth controller task stack */
|
||||
uint8_t task_prio; /*!< Priority of the Bluetooth controller task */
|
||||
uint8_t task_run_cpu; /*!< CPU number on which the Bluetooth controller task runs */
|
||||
uint8_t hci_cmd_num; /*!< HCI command buffer number */
|
||||
uint8_t sleep_en; /*!< Enable sleep functionality */
|
||||
uint8_t version_num; /*!< Hardware version number of this chip */
|
||||
uint8_t bluetooth_mode; /*!< Controller mode: BR/EDR, BLE or Dual Mode */
|
||||
uint32_t magic; /*!< Magic number for configuration validation */
|
||||
} esp_bt_ctrl_btdm_config_t;
|
||||
|
||||
/* Types definition
|
||||
************************************************************************
|
||||
*/
|
||||
/**
|
||||
* @brief BTDM controller common configuration options
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t version; /*!< Version number of the defined structure */
|
||||
uint16_t task_stack_size; /*!< Size of Bluetooth controller task stack */
|
||||
uint8_t task_prio; /*!< Priority of the Bluetooth controller task */
|
||||
uint8_t task_run_cpu; /*!< CPU number on which the Bluetooth controller task runs */
|
||||
uint8_t hci_cmd_num; /*!< HCI command buffer number */
|
||||
uint8_t hci_conn_num; /*!< HCI level connection number */
|
||||
uint8_t sleep_en; /*!< Enable sleep functionality */
|
||||
uint8_t version_num; /*!< Hardware version number of this chip */
|
||||
uint8_t bluetooth_mode; /*!< Controller mode: BR/EDR, BLE or Dual Mode */
|
||||
uint32_t magic; /*!< Magic number for configuration validation */
|
||||
}esp_btdm_controller_config_t;
|
||||
/**
|
||||
* @brief Controller config options, depend on config mask.
|
||||
* Config mask indicate which functions enabled, this means
|
||||
* some options or parameters of some functions enabled by config mask.
|
||||
*/
|
||||
typedef struct {
|
||||
esp_bt_ctrl_le_config_t ble; /*!< Bluetooth LE controller configuration options */
|
||||
#if SOC_BT_CLASSIC_SUPPORTED
|
||||
esp_bt_ctrl_bredr_config_t bredr; /*!< Bluetooth Classic controller configuration options */
|
||||
#endif // SOC_BT_CLASSIC_SUPPORTED
|
||||
esp_bt_ctrl_btdm_config_t btdm; /*!< Bluetooth controller common configuration options */
|
||||
} esp_bt_controller_config_t;
|
||||
|
||||
/**
|
||||
* @brief Controller config options, depend on config mask.
|
||||
* Config mask indicate which functions enabled, this means
|
||||
* some options or parameters of some functions enabled by config mask.
|
||||
*/
|
||||
typedef struct {
|
||||
struct {
|
||||
uint32_t config_version; /*!< Version number of the defined structure */
|
||||
uint16_t ble_ll_resolv_list_size; /*!< Size of the resolvable private address list */
|
||||
uint16_t ble_hci_evt_hi_buf_count; /*!< Count of high buffers for HCI events */
|
||||
uint16_t ble_hci_evt_lo_buf_count; /*!< Count of low buffers for HCI events */
|
||||
uint8_t ble_ll_sync_list_cnt; /*!< Number of synchronization lists */
|
||||
uint8_t ble_ll_sync_cnt; /*!< Number of synchronizations */
|
||||
uint16_t ble_ll_rsp_dup_list_count; /*!< Count of duplicated lists for scan response packets */
|
||||
uint16_t ble_ll_adv_dup_list_count; /*!< Count of duplicated lists for advertising packets */
|
||||
uint8_t ble_ll_tx_pwr_dbm; /*!< Tx power (transmit power) in dBm */
|
||||
uint64_t rtc_freq; /*!< Frequency of RTC (Real-Time Clock) */
|
||||
uint16_t ble_ll_sca; /*!< Sleep Clock Accuracy (SCA) parameter */
|
||||
uint8_t ble_ll_scan_phy_number; /*!< Number of PHYs supported for scanning */
|
||||
uint16_t ble_ll_conn_def_auth_pyld_tmo; /*!< Connection default authentication payload timeout */
|
||||
uint8_t ble_ll_jitter_usecs; /*!< Jitter time in microseconds */
|
||||
uint16_t ble_ll_sched_max_adv_pdu_usecs; /*!< Maximum time in microseconds for advertising PDU scheduling */
|
||||
uint16_t ble_ll_sched_direct_adv_max_usecs; /*!< Maximum time in microseconds for directed advertising scheduling */
|
||||
uint16_t ble_ll_sched_adv_max_usecs; /*!< Maximum time in microseconds for advertising scheduling */
|
||||
uint16_t ble_scan_rsp_data_max_len; /*!< Maximum length of scan response data */
|
||||
uint8_t ble_ll_cfg_num_hci_cmd_pkts; /*!< Number of HCI command packets that can be queued */
|
||||
uint32_t ble_ll_ctrl_proc_timeout_ms; /*!< Control processing timeout in milliseconds */
|
||||
uint16_t nimble_max_connections; /*!< Maximum number of connections supported */
|
||||
uint8_t ble_whitelist_size; /*!< Size of the white list */
|
||||
uint16_t ble_acl_buf_size; /*!< Buffer size of ACL (Asynchronous Connection-Less) data */
|
||||
uint16_t ble_acl_buf_count; /*!< Buffer count of ACL data */
|
||||
uint16_t ble_hci_evt_buf_size; /*!< Buffer size for HCI event data */
|
||||
uint16_t ble_multi_adv_instances; /*!< Number of advertising instances */
|
||||
uint16_t ble_ext_adv_max_size; /*!< Maximum size of extended advertising data */
|
||||
uint16_t controller_task_stack_size; /*!< Size of Bluetooth controller task stack, to be removed */
|
||||
uint8_t controller_task_prio; /*!< Priority of the Bluetooth task, to be removed */
|
||||
uint8_t controller_run_cpu; /*!< CPU number on which the Bluetooth controller task runs, to be removed */
|
||||
uint8_t enable_qa_test; /*!< Enable for QA test */
|
||||
uint8_t enable_bqb_test; /*!< Enable for BQB test */
|
||||
uint8_t enable_tx_cca; /*!< Enable Clear Channel Assessment (CCA) when transmitting */
|
||||
uint8_t cca_rssi_thresh; /*!< RSSI threshold for CCA */
|
||||
uint8_t sleep_en; /*!< Enable sleep functionality */
|
||||
uint8_t coex_phy_coded_tx_rx_time_limit; /*!< Coexistence PHY coded TX and RX time limit */
|
||||
uint8_t dis_scan_backoff; /*!< Disable scan backoff */
|
||||
uint8_t ble_scan_classify_filter_enable; /*!< Enable classification filter for BLE scan */
|
||||
uint8_t cca_drop_mode; /*!< CCA drop mode */
|
||||
int8_t cca_low_tx_pwr; /*!< Low TX power setting for CCA */
|
||||
uint8_t main_xtal_freq; /*!< Main crystal frequency */
|
||||
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the white list for directed advertising */
|
||||
uint8_t enable_pcl; /*!< Enable power control */
|
||||
uint8_t csa2_select; /*!< Select CSA2 */
|
||||
uint8_t enable_csr; /*!< Enable connection subrate */
|
||||
int8_t backoff_rssi; /*!< Set the lowest rssi threshold for backoff */
|
||||
bool iso_enabled; /*!< Enable ISO */
|
||||
bool iso_bqb_test; /*!< Enable ISO BQB test */
|
||||
bool iso_fra_unseg; /*!< Enable ISO FRA unsegmented */
|
||||
bool iso_nsfc_en; /*!< Enable ISO NSCF */
|
||||
uint8_t iso_nsfc_num; /*!< Number of ISO NSCF */
|
||||
uint8_t iso_buf_count; /*!< Number of ISO buffer */
|
||||
uint16_t iso_buf_size; /*!< Size of ISO buffer */
|
||||
uint8_t iso_big_count; /*!< Number of ISO big */
|
||||
uint16_t iso_bis_count; /*!< Number of ISO bis */
|
||||
uint8_t iso_bis_per_big; /*!< Number of ISO bis per big */
|
||||
uint8_t iso_cig_count; /*!< Number of ISO cig */
|
||||
uint16_t iso_cis_count; /*!< Number of ISO cis */
|
||||
uint8_t iso_cis_per_cig; /*!< Number of ISO cis per cig */
|
||||
uint32_t config_magic; /*!< Configuration magic value */
|
||||
} ble; /*!< Bluetooth LE controller configuration options */
|
||||
#if defined(CONFIG_BTDM_CTRL_MODE_BLE_ONLY)
|
||||
#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_BLE
|
||||
#elif defined(CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY)
|
||||
#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_CLASSIC_BT
|
||||
#else
|
||||
#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_BTDM
|
||||
#endif // defined(CONFIG_BTDM_CTRL_MODE_BLE_ONLY)
|
||||
|
||||
esp_btdm_controller_config_t btdm; /*!< BTDM controller common configuration options */
|
||||
} esp_bt_controller_config_t;
|
||||
#if SOC_BT_CLASSIC_SUPPORTED
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() \
|
||||
{ \
|
||||
.ble = _BT_CTRL_LE_INIT_CONFIG_DEFAULT(), \
|
||||
.bredr = _BT_CTRL_BREDR_INIT_CONFIG_DEFAULT(), \
|
||||
.btdm = \
|
||||
{ \
|
||||
.version = BTDM_CONFIG_VERSION, \
|
||||
.task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.task_run_cpu = CONFIG_BT_CTRL_PINNED_TO_CORE, \
|
||||
.hci_cmd_num = CONFIG_BT_CTRL_HCI_CMD_NUM, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.version_num = 0, \
|
||||
.bluetooth_mode = BTDM_CONTROLLER_MODE_EFF, \
|
||||
.magic = BTDM_CONFIG_MAGIC_VALUE, \
|
||||
}, \
|
||||
}
|
||||
#else
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() \
|
||||
{ \
|
||||
.ble = _BT_CTRL_LE_INIT_CONFIG_DEFAULT(), \
|
||||
.btdm = \
|
||||
{ \
|
||||
.version = BTDM_CONFIG_VERSION, \
|
||||
.task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.task_run_cpu = CONFIG_BT_CTRL_PINNED_TO_CORE, \
|
||||
.hci_cmd_num = CONFIG_BT_CTRL_HCI_CMD_NUM, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.version_num = 0, \
|
||||
.bluetooth_mode = BTDM_CONTROLLER_MODE_EFF, \
|
||||
.magic = BTDM_CONFIG_MAGIC_VALUE, \
|
||||
}, \
|
||||
}
|
||||
#endif // SOC_BT_CLASSIC_SUPPORTED
|
||||
|
||||
#if defined(CONFIG_BTDM_CTRL_MODE_BLE_ONLY)
|
||||
#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_BLE
|
||||
#elif defined(CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY)
|
||||
#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_CLASSIC_BT
|
||||
#else
|
||||
#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_BTDM
|
||||
#endif
|
||||
/**
|
||||
* @brief Initialize BT controller to allocate task and other resource.
|
||||
* This function should be called only once, before any other BT functions are called.
|
||||
* @param cfg: Initial configuration of BT controller. Different from previous version, there's a mode and some
|
||||
* connection configuration in "cfg" to configure controller work mode and allocate the resource which is needed.
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg);
|
||||
|
||||
#if defined(CONFIG_BT_LE_ISO_SUPPORT)
|
||||
#define DEFAULT_BT_LE_ISO_ENABLED 1
|
||||
#if defined(CONFIG_BT_LE_ISO_FRA_UNSEG)
|
||||
#define DEFAULT_BT_LE_ISO_FRA_UNSEG CONFIG_BT_LE_ISO_FRA_UNSEG
|
||||
#else
|
||||
#define DEFAULT_BT_LE_ISO_FRA_UNSEG (0)
|
||||
#endif
|
||||
#if defined(CONFIG_BT_LE_ISO_NSFC_EN)
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_EN CONFIG_BT_LE_ISO_NSFC_EN
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_NUM CONFIG_BT_LE_ISO_NSFC_NUM
|
||||
#else
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_EN (0)
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_NUM (0)
|
||||
#endif
|
||||
#define DEFAULT_BT_LE_ISO_BUF_COUNT CONFIG_BT_LE_ISO_BUF_COUNT
|
||||
#define DEFAULT_BT_LE_ISO_BUF_SIZE CONFIG_BT_LE_ISO_BUF_SIZE
|
||||
#define DEFAULT_BT_LE_ISO_BIG CONFIG_BT_LE_ISO_BIG
|
||||
#define DEFAULT_BT_LE_ISO_BIS CONFIG_BT_LE_ISO_BIS
|
||||
#define DEFAULT_BT_LE_ISO_BIS_PER_BIG CONFIG_BT_LE_ISO_BIS_PER_BIG
|
||||
#define DEFAULT_BT_LE_ISO_CIG CONFIG_BT_LE_ISO_CIG
|
||||
#define DEFAULT_BT_LE_ISO_CIS CONFIG_BT_LE_ISO_CIS
|
||||
#define DEFAULT_BT_LE_ISO_CIS_PER_CIG CONFIG_BT_LE_ISO_CIS_PER_CIG
|
||||
#else
|
||||
#define DEFAULT_BT_LE_ISO_ENABLED 0
|
||||
#define DEFAULT_BT_LE_ISO_FRA_UNSEG 0
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_EN 0
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_NUM 0
|
||||
#define DEFAULT_BT_LE_ISO_BUF_COUNT 0
|
||||
#define DEFAULT_BT_LE_ISO_BUF_SIZE 0
|
||||
#define DEFAULT_BT_LE_ISO_BIG 0
|
||||
#define DEFAULT_BT_LE_ISO_BIS 0
|
||||
#define DEFAULT_BT_LE_ISO_BIS_PER_BIG 0
|
||||
#define DEFAULT_BT_LE_ISO_CIG 0
|
||||
#define DEFAULT_BT_LE_ISO_CIS 0
|
||||
#define DEFAULT_BT_LE_ISO_CIS_PER_CIG 0
|
||||
#endif
|
||||
/**
|
||||
* @brief Get BT controller is initialised/de-initialised/enabled/disabled
|
||||
* @return status value
|
||||
*/
|
||||
esp_bt_controller_status_t esp_bt_controller_get_status(void);
|
||||
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \
|
||||
.ble = { \
|
||||
.config_version = BLE_CONFIG_VERSION, \
|
||||
.ble_ll_resolv_list_size = CONFIG_BT_LE_LL_RESOLV_LIST_SIZE, \
|
||||
.ble_hci_evt_hi_buf_count = DEFAULT_BT_LE_HCI_EVT_HI_BUF_COUNT, \
|
||||
.ble_hci_evt_lo_buf_count = DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT, \
|
||||
.ble_ll_sync_list_cnt = DEFAULT_BT_LE_MAX_PERIODIC_ADVERTISER_LIST, \
|
||||
.ble_ll_sync_cnt = DEFAULT_BT_LE_MAX_PERIODIC_SYNCS, \
|
||||
.ble_ll_rsp_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
|
||||
.ble_ll_adv_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
|
||||
.ble_ll_tx_pwr_dbm = 0, \
|
||||
.rtc_freq = 32000, \
|
||||
.ble_ll_sca = CONFIG_BT_LE_LL_SCA, \
|
||||
.ble_ll_scan_phy_number = BLE_LL_SCAN_PHY_NUMBER_N, \
|
||||
.ble_ll_conn_def_auth_pyld_tmo = BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N, \
|
||||
.ble_ll_jitter_usecs = BLE_LL_JITTER_USECS_N, \
|
||||
.ble_ll_sched_max_adv_pdu_usecs = BLE_LL_SCHED_MAX_ADV_PDU_USECS_N, \
|
||||
.ble_ll_sched_direct_adv_max_usecs = BLE_LL_SCHED_DIRECT_ADV_MAX_USECS_N, \
|
||||
.ble_ll_sched_adv_max_usecs = BLE_LL_SCHED_ADV_MAX_USECS_N, \
|
||||
.ble_scan_rsp_data_max_len = DEFAULT_BT_LE_SCAN_RSP_DATA_MAX_LEN_N, \
|
||||
.ble_ll_cfg_num_hci_cmd_pkts = BLE_LL_CFG_NUM_HCI_CMD_PKTS_N, \
|
||||
.ble_ll_ctrl_proc_timeout_ms = BLE_LL_CTRL_PROC_TIMEOUT_MS_N, \
|
||||
.nimble_max_connections = DEFAULT_BT_LE_MAX_CONNECTIONS, \
|
||||
.ble_whitelist_size = DEFAULT_BT_NIMBLE_WHITELIST_SIZE, \
|
||||
.ble_acl_buf_size = DEFAULT_BT_LE_ACL_BUF_SIZE, \
|
||||
.ble_acl_buf_count = DEFAULT_BT_LE_ACL_BUF_COUNT, \
|
||||
.ble_hci_evt_buf_size = DEFAULT_BT_LE_HCI_EVT_BUF_SIZE, \
|
||||
.ble_multi_adv_instances = DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, \
|
||||
.ble_ext_adv_max_size = DEFAULT_BT_LE_EXT_ADV_MAX_SIZE, \
|
||||
.controller_task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.controller_task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.controller_run_cpu = 0, \
|
||||
.enable_qa_test = RUN_QA_TEST, \
|
||||
.enable_bqb_test = RUN_BQB_TEST, \
|
||||
.enable_tx_cca = DEFAULT_BT_LE_TX_CCA_ENABLED, \
|
||||
.cca_rssi_thresh = 256 - DEFAULT_BT_LE_CCA_RSSI_THRESH, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
|
||||
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
|
||||
.ble_scan_classify_filter_enable = 1, \
|
||||
.main_xtal_freq = CONFIG_XTAL_FREQ, \
|
||||
.ignore_wl_for_direct_adv = 0, \
|
||||
.enable_pcl = 0, \
|
||||
.csa2_select = 1, \
|
||||
.enable_csr = 0, \
|
||||
.backoff_rssi = -100, \
|
||||
.iso_enabled = DEFAULT_BT_LE_ISO_ENABLED, \
|
||||
.iso_bqb_test = false, \
|
||||
.iso_fra_unseg = DEFAULT_BT_LE_ISO_FRA_UNSEG, \
|
||||
.iso_nsfc_en = DEFAULT_BT_LE_ISO_NSFC_EN, \
|
||||
.iso_nsfc_num = DEFAULT_BT_LE_ISO_NSFC_NUM, \
|
||||
.iso_buf_count = DEFAULT_BT_LE_ISO_BUF_COUNT, \
|
||||
.iso_buf_size = DEFAULT_BT_LE_ISO_BUF_SIZE, \
|
||||
.iso_big_count = DEFAULT_BT_LE_ISO_BIG, \
|
||||
.iso_bis_count = DEFAULT_BT_LE_ISO_BIS, \
|
||||
.iso_bis_per_big = DEFAULT_BT_LE_ISO_BIS_PER_BIG, \
|
||||
.iso_cig_count = DEFAULT_BT_LE_ISO_CIG, \
|
||||
.iso_cis_count = DEFAULT_BT_LE_ISO_CIS, \
|
||||
.iso_cis_per_cig = DEFAULT_BT_LE_ISO_CIS_PER_CIG, \
|
||||
.config_magic = BLE_CONFIG_MAGIC, \
|
||||
}, \
|
||||
.btdm = { \
|
||||
.version = BTDM_CONFIG_VERSION, \
|
||||
.task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.task_run_cpu = CONFIG_BT_CTRL_PINNED_TO_CORE, \
|
||||
.hci_cmd_num = CONFIG_BT_CTRL_HCI_CMD_NUM, \
|
||||
.hci_conn_num = DEFAULT_BT_LE_MAX_CONNECTIONS + DEFAULT_BT_LE_ISO_CIS + DEFAULT_BT_LE_ISO_BIS, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.version_num = 0, \
|
||||
.bluetooth_mode = BTDM_CONTROLLER_MODE_EFF, \
|
||||
.magic = BTDM_CONFIG_MAGIC_VALUE, \
|
||||
}, \
|
||||
}
|
||||
/**
|
||||
* @brief De-initialize BT controller to free resource and delete task.
|
||||
* You should stop advertising and scanning, as well as
|
||||
* disconnect all existing connections before de-initializing BT controller.
|
||||
*
|
||||
* This function should be called only once, after any other BT functions are called.
|
||||
* This function is not whole completed, esp_bt_controller_init cannot called after this function.
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_controller_deinit(void);
|
||||
|
||||
/**
|
||||
* @brief Set BLE TX power
|
||||
* Connection Tx power should only be set after connection created.
|
||||
* @param power_type : The type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @param power_level: Power level(index) corresponding to absolute value(dbm)
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_t power_level);
|
||||
/**
|
||||
* @brief Enable BT controller.
|
||||
* Due to a known issue, you cannot call esp_bt_controller_enable() a second time
|
||||
* to change the controller mode dynamically. To change controller mode, call
|
||||
* esp_bt_controller_disable() and then call esp_bt_controller_enable() with the new mode.
|
||||
* @param mode : the mode(BLE/BT/BTDM) to enable. For compatible of API, retain this argument. This mode must be
|
||||
* equal as the mode in "cfg" of esp_bt_controller_init().
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode);
|
||||
|
||||
/**
|
||||
* @brief Get BLE TX power
|
||||
* Connection Tx power should only be get after connection created.
|
||||
* @param power_type : The type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @return >= 0 - Power level, < 0 - Invalid
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type);
|
||||
/**
|
||||
* @brief Disable BT controller
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_controller_disable(void);
|
||||
|
||||
/**
|
||||
* @brief ENHANCED API for Setting BLE TX power
|
||||
* Connection Tx power should only be set after connection created.
|
||||
* @param power_type : The enhanced type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @param handle : The handle of Advertising or Connection and the value 0 for other enhanced power types.
|
||||
* @param power_level: Power level(index) corresponding to absolute value(dbm)
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle, esp_power_level_t power_level);
|
||||
/** @brief esp_vhci_host_callback
|
||||
* used for vhci call host function to notify what host need to do
|
||||
*/
|
||||
typedef struct esp_vhci_host_callback {
|
||||
void (*notify_host_send_available)(void); /*!< callback used to notify that the host can send packet to controller */
|
||||
int (*notify_host_recv)(uint8_t *data, uint16_t len); /*!< callback used to notify that the controller has a packet to send to the host*/
|
||||
} esp_vhci_host_callback_t;
|
||||
|
||||
/**
|
||||
* @brief ENHANCED API of Getting BLE TX power
|
||||
* Connection Tx power should only be get after connection created.
|
||||
* @param power_type : The enhanced type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @param handle : The handle of Advertising or Connection and the value 0 for other enhanced power types.
|
||||
* @return >= 0 - Power level, < 0 - Invalid
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
|
||||
/** @brief esp_vhci_host_check_send_available
|
||||
* used for check actively if the host can send packet to controller or not.
|
||||
* @return true for ready to send, false means cannot send packet
|
||||
*/
|
||||
bool esp_vhci_host_check_send_available(void);
|
||||
|
||||
/**
|
||||
* @brief Initialize BT controller to allocate task and other resource.
|
||||
* This function should be called only once, before any other BT functions are called.
|
||||
* @param cfg: Initial configuration of BT controller. Different from previous version, there's a mode and some
|
||||
* connection configuration in "cfg" to configure controller work mode and allocate the resource which is needed.
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg);
|
||||
/** @brief esp_vhci_host_send_packet
|
||||
* host send packet to controller
|
||||
*
|
||||
* Should not call this function from within a critical section
|
||||
* or when the scheduler is suspended.
|
||||
*
|
||||
* @param data the packet point
|
||||
* @param len the packet length
|
||||
*/
|
||||
void esp_vhci_host_send_packet(uint8_t *data, uint16_t len);
|
||||
|
||||
/**
|
||||
* @brief Get BT controller is initialised/de-initialised/enabled/disabled
|
||||
* @return status value
|
||||
*/
|
||||
esp_bt_controller_status_t esp_bt_controller_get_status(void);
|
||||
/** @brief esp_vhci_host_register_callback
|
||||
* register the vhci reference callback
|
||||
* struct defined by vhci_host_callback structure.
|
||||
* @param callback esp_vhci_host_callback type variable
|
||||
* @return ESP_OK - success, ESP_FAIL - failed
|
||||
*/
|
||||
esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback);
|
||||
|
||||
/**
|
||||
* @brief De-initialize BT controller to free resource and delete task.
|
||||
* You should stop advertising and scanning, as well as
|
||||
* disconnect all existing connections before de-initializing BT controller.
|
||||
*
|
||||
* This function should be called only once, after any other BT functions are called.
|
||||
* This function is not whole completed, esp_bt_controller_init cannot called after this function.
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_controller_deinit(void);
|
||||
/** @brief esp_bt_controller_mem_release
|
||||
* release the controller memory as per the mode
|
||||
*
|
||||
* This function releases the BSS, data and other sections of the controller to heap. The total size is about 70k bytes.
|
||||
*
|
||||
* esp_bt_controller_mem_release(mode) should be called only before esp_bt_controller_init()
|
||||
* or after esp_bt_controller_deinit().
|
||||
*
|
||||
* Note that once BT controller memory is released, the process cannot be reversed. It means you cannot use the bluetooth
|
||||
* mode which you have released by this function.
|
||||
*
|
||||
* If your firmware will later upgrade the Bluetooth controller mode (BLE -> BT Classic or disabled -> enabled)
|
||||
* then do not call this function.
|
||||
*
|
||||
* If the app calls esp_bt_controller_enable(ESP_BT_MODE_BLE) to use BLE only then it is safe to call
|
||||
* esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT) at initialization time to free unused BT Classic memory.
|
||||
*
|
||||
* If the mode is ESP_BT_MODE_BTDM, then it may be useful to call API esp_bt_mem_release(ESP_BT_MODE_BTDM) instead,
|
||||
* which internally calls esp_bt_controller_mem_release(ESP_BT_MODE_BTDM) and additionally releases the BSS and data
|
||||
* consumed by the BT/BLE host stack to heap. For more details about usage please refer to the documentation of
|
||||
* esp_bt_mem_release() function
|
||||
*
|
||||
* @param mode : the mode want to release memory
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode);
|
||||
|
||||
/**
|
||||
* @brief Enable BT controller.
|
||||
* Due to a known issue, you cannot call esp_bt_controller_enable() a second time
|
||||
* to change the controller mode dynamically. To change controller mode, call
|
||||
* esp_bt_controller_disable() and then call esp_bt_controller_enable() with the new mode.
|
||||
* @param mode : the mode(BLE/BT/BTDM) to enable. For compatible of API, retain this argument. This mode must be
|
||||
* equal as the mode in "cfg" of esp_bt_controller_init().
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode);
|
||||
/** @brief esp_bt_mem_release
|
||||
* release controller memory and BSS and data section of the BT/BLE host stack as per the mode
|
||||
*
|
||||
* This function first releases controller memory by internally calling esp_bt_controller_mem_release().
|
||||
* Additionally, if the mode is set to ESP_BT_MODE_BTDM, it also releases the BSS and data consumed by the BT/BLE host stack to heap
|
||||
*
|
||||
* Note that once BT memory is released, the process cannot be reversed. It means you cannot use the bluetooth
|
||||
* mode which you have released by this function.
|
||||
*
|
||||
* If your firmware will later upgrade the Bluetooth controller mode (BLE -> BT Classic or disabled -> enabled)
|
||||
* then do not call this function.
|
||||
*
|
||||
* If you never intend to use bluetooth in a current boot-up cycle, you can call esp_bt_mem_release(ESP_BT_MODE_BTDM)
|
||||
* before esp_bt_controller_init or after esp_bt_controller_deinit.
|
||||
*
|
||||
* For example, if a user only uses bluetooth for setting the WiFi configuration, and does not use bluetooth in the rest of the product operation".
|
||||
* In such cases, after receiving the WiFi configuration, you can disable/deinit bluetooth and release its memory.
|
||||
* Below is the sequence of APIs to be called for such scenarios:
|
||||
*
|
||||
* esp_bluedroid_disable();
|
||||
* esp_bluedroid_deinit();
|
||||
* esp_bt_controller_disable();
|
||||
* esp_bt_controller_deinit();
|
||||
* esp_bt_mem_release(ESP_BT_MODE_BTDM);
|
||||
*
|
||||
* @param mode : the mode whose memory is to be released
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_mem_release(esp_bt_mode_t mode);
|
||||
|
||||
/**
|
||||
* @brief Disable BT controller
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_controller_disable(void);
|
||||
/**
|
||||
* @brief Returns random static address or -1 if not present.
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
extern int esp_ble_hw_get_static_addr(esp_ble_addr_t *addr);
|
||||
|
||||
/** @brief esp_vhci_host_callback
|
||||
* used for vhci call host function to notify what host need to do
|
||||
*/
|
||||
typedef struct esp_vhci_host_callback {
|
||||
void (*notify_host_send_available)(void); /*!< callback used to notify that the host can send packet to controller */
|
||||
int (*notify_host_recv)(uint8_t *data, uint16_t len); /*!< callback used to notify that the controller has a packet to send to the host*/
|
||||
} esp_vhci_host_callback_t;
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/**
|
||||
* @brief dump all log information cached in buffers.
|
||||
* @param output : true for log dump, false will take no effect
|
||||
*/
|
||||
void esp_ble_controller_log_dump_all(bool output);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
/** @brief esp_vhci_host_check_send_available
|
||||
* used for check actively if the host can send packet to controller or not.
|
||||
* @return true for ready to send, false means cannot send packet
|
||||
*/
|
||||
bool esp_vhci_host_check_send_available(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @brief esp_vhci_host_send_packet
|
||||
* host send packet to controller
|
||||
*
|
||||
* Should not call this function from within a critical section
|
||||
* or when the scheduler is suspended.
|
||||
*
|
||||
* @param data the packet point
|
||||
* @param len the packet length
|
||||
*/
|
||||
void esp_vhci_host_send_packet(uint8_t *data, uint16_t len);
|
||||
|
||||
/** @brief esp_vhci_host_register_callback
|
||||
* register the vhci reference callback
|
||||
* struct defined by vhci_host_callback structure.
|
||||
* @param callback esp_vhci_host_callback type variable
|
||||
* @return ESP_OK - success, ESP_FAIL - failed
|
||||
*/
|
||||
esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback);
|
||||
|
||||
/** @brief esp_bt_controller_mem_release
|
||||
* release the controller memory as per the mode
|
||||
*
|
||||
* This function releases the BSS, data and other sections of the controller to heap. The total size is about 70k bytes.
|
||||
*
|
||||
* esp_bt_controller_mem_release(mode) should be called only before esp_bt_controller_init()
|
||||
* or after esp_bt_controller_deinit().
|
||||
*
|
||||
* Note that once BT controller memory is released, the process cannot be reversed. It means you cannot use the bluetooth
|
||||
* mode which you have released by this function.
|
||||
*
|
||||
* If your firmware will later upgrade the Bluetooth controller mode (BLE -> BT Classic or disabled -> enabled)
|
||||
* then do not call this function.
|
||||
*
|
||||
* If the app calls esp_bt_controller_enable(ESP_BT_MODE_BLE) to use BLE only then it is safe to call
|
||||
* esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT) at initialization time to free unused BT Classic memory.
|
||||
*
|
||||
* If the mode is ESP_BT_MODE_BTDM, then it may be useful to call API esp_bt_mem_release(ESP_BT_MODE_BTDM) instead,
|
||||
* which internally calls esp_bt_controller_mem_release(ESP_BT_MODE_BTDM) and additionally releases the BSS and data
|
||||
* consumed by the BT/BLE host stack to heap. For more details about usage please refer to the documentation of
|
||||
* esp_bt_mem_release() function
|
||||
*
|
||||
* @param mode : the mode want to release memory
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode);
|
||||
|
||||
/** @brief esp_bt_mem_release
|
||||
* release controller memory and BSS and data section of the BT/BLE host stack as per the mode
|
||||
*
|
||||
* This function first releases controller memory by internally calling esp_bt_controller_mem_release().
|
||||
* Additionally, if the mode is set to ESP_BT_MODE_BTDM, it also releases the BSS and data consumed by the BT/BLE host stack to heap
|
||||
*
|
||||
* Note that once BT memory is released, the process cannot be reversed. It means you cannot use the bluetooth
|
||||
* mode which you have released by this function.
|
||||
*
|
||||
* If your firmware will later upgrade the Bluetooth controller mode (BLE -> BT Classic or disabled -> enabled)
|
||||
* then do not call this function.
|
||||
*
|
||||
* If you never intend to use bluetooth in a current boot-up cycle, you can call esp_bt_mem_release(ESP_BT_MODE_BTDM)
|
||||
* before esp_bt_controller_init or after esp_bt_controller_deinit.
|
||||
*
|
||||
* For example, if a user only uses bluetooth for setting the WiFi configuration, and does not use bluetooth in the rest of the product operation".
|
||||
* In such cases, after receiving the WiFi configuration, you can disable/deinit bluetooth and release its memory.
|
||||
* Below is the sequence of APIs to be called for such scenarios:
|
||||
*
|
||||
* esp_bluedroid_disable();
|
||||
* esp_bluedroid_deinit();
|
||||
* esp_bt_controller_disable();
|
||||
* esp_bt_controller_deinit();
|
||||
* esp_bt_mem_release(ESP_BT_MODE_BTDM);
|
||||
*
|
||||
* @param mode : the mode whose memory is to be released
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_bt_mem_release(esp_bt_mode_t mode);
|
||||
|
||||
/**
|
||||
* @brief Returns random static address or -1 if not present.
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
extern int esp_ble_hw_get_static_addr(esp_ble_addr_t *addr);
|
||||
|
||||
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
/**
|
||||
* @brief dump all log information cached in buffers.
|
||||
* @param output : true for log dump, false will take no effect
|
||||
*/
|
||||
void esp_ble_controller_log_dump_all(bool output);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ESP_BT_H__ */
|
||||
#endif /* __ESP_BT_H__ */
|
||||
|
||||
@@ -6,355 +6,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// @brief HCI VS Commands for Espressif's Bluetooth Host
|
||||
//
|
||||
// @note The following vendor-specific HCI commands are exclusively for Espressif's Bluetooth Host (ESP-Bluedroid Host or ESP-NimBLE Host).
|
||||
// If you are using a non-ESP host or HCI UART, these commands will remain disabled unless the initialization function is explicitly called from the application.
|
||||
// Note, these init functions as well as these additional HCI VS commands are intended for Espressif's Bluetooth Host use only.
|
||||
// Application developers **should not** call the init functions in their applications.
|
||||
//
|
||||
|
||||
/**
|
||||
* @brief Config scanning duplicate exceptional list (OCF: 0x0108)
|
||||
*
|
||||
* @note The init function is `advFilter_stack_eanbleDupExcListCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_CONFIG_DUP_EXC_LIST_OCF (0x0108)
|
||||
/**
|
||||
* @brief Update exception list cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_update_exc_list {
|
||||
uint8_t subcode; /*!< Add, remove or clear exception list */
|
||||
uint32_t type; /*!< device type */
|
||||
uint8_t device_info[6]; /*!< device information */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable/disable advertising report flow control (OCF: 0x0109)
|
||||
*
|
||||
* @note The init function is `scan_stack_enableAdvFlowCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_ADV_REPORT_FLOW_CTRL_OCF (0x0109)
|
||||
/**
|
||||
* @brief Init ADV flow control cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_init_adv_flow_ctrl {
|
||||
uint8_t enable; /*!< Enable ADV flow control */
|
||||
uint16_t num; /*!< ADV buffer maximum value */
|
||||
uint16_t adv_lost_threshold; /*!< ADV lost event triggered threshold */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Update the number of advertising report in ADV flow control (OCF: 0x010A)
|
||||
*
|
||||
* @note The init function is `scan_stack_enableAdvFlowCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_UPD_ADV_REPORT_FLOW_CTRL_NUM_OCF (0x010a)
|
||||
/**
|
||||
* @brief Update ADV flow control cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_update_adv_flow_ctrl {
|
||||
uint16_t num; /*!< The number of ADV report processed */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Clear legacy advertising (same as HCI_LE_Clear_Advertising_Sets) (OCF: 0x010C)
|
||||
*
|
||||
* @note The init function is `adv_stack_enableClearLegacyAdvVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_CLR_LEGACY_ADV_OCF (0x010c)
|
||||
/**
|
||||
* @brief Clear legacy ADV cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_clr_legacy_adv {
|
||||
// no parameters
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set parameters of duplicate list (OCF: 0x010D)
|
||||
*
|
||||
* @note The init function is `advFilter_stack_eanbleDupExcListCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_DUP_LIST_PARAMS_OCF (0x010d)
|
||||
/**
|
||||
* @brief Set duplicate list cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_dup_params {
|
||||
uint8_t dup_mode; /*!< Duplicate mode */
|
||||
uint8_t dup_ad_type; /*!< Duplicate data type */
|
||||
uint16_t ring_list_max_num; /*!< Duplicate list size */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable/disable duplicate and exception list (OCF: 0x010E)
|
||||
*
|
||||
* @note The init function is `advFilter_stack_eanbleDupExcListCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_ENABLE_DUP_EXC_LIST_OCF (0x010e)
|
||||
/**
|
||||
* @brief Enable duplicate and exception list cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_enable_dup_exc {
|
||||
uint8_t enable; /*!< Enable or disable */
|
||||
uint8_t ring_list_reset; /*!< Reset list */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable optimization of multiple connections (OCF: 0x010F)
|
||||
*
|
||||
* @note The init function is `arr_stack_enableMultiConnVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_ENABLE_ARRANGEMENT_OCF (0x010f)
|
||||
/**
|
||||
* @brief Multiple connections optimization cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_enable_arrangement {
|
||||
uint32_t common_factor; /*!< The greatest common factor of connection interval */
|
||||
uint8_t enable; /*!< Enable or disable */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set scheduling length for a certain role (OCF: 0x0110)
|
||||
*
|
||||
* @note The init function is `arr_stack_enableMultiConnVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_SCHED_ROLE_LEN_OCF (0x0110)
|
||||
/**
|
||||
* @brief Scheduling length cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_sched_role_len {
|
||||
uint8_t role; /*!< BLE role; 0: central; 1: peripheral */
|
||||
uint32_t len; /*!< Length is us */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set RSSI threshold for automatic power control (OCF: 0x0111)
|
||||
*
|
||||
* @note The init function is `pcl_stack_enableSetRssiThreshVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_PCL_RSSI_THRESH_OCF (0x0111)
|
||||
/**
|
||||
* @brief PCL RSSI threshold cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_pcl_rssi_thresh {
|
||||
uint16_t conn_handle; /*!< Connection handle */
|
||||
uint8_t rssi_thresh_min_1M; /*!< Lower limit for 1M */
|
||||
uint8_t rssi_thresh_max_1M; /*!< Upper limit for 1M */
|
||||
uint8_t rssi_thresh_min_2M; /*!< Lower limit for 2M */
|
||||
uint8_t rssi_thresh_max_2M; /*!< Upper limit for 2M */
|
||||
uint8_t rssi_thresh_min_s2coded; /*!< Lower limit for s2 coded */
|
||||
uint8_t rssi_thresh_max_s2coded; /*!< Upper limit for s2 coded */
|
||||
uint8_t rssi_thresh_min_s8coded; /*!< Lower limit for s8 coded */
|
||||
uint8_t rssi_thresh_max_s8coded; /*!< Upper limit for s8 coded */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable/disable channel selection algorithm #2 (OCF: 0x0112)
|
||||
*
|
||||
* @note The init function is `chanSel_stack_enableSetCsaVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_ENABLE_CSA2_OCF (0x0112)
|
||||
/**
|
||||
* @brief Enable/disable channel selection algorithm #2 cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_csa_enable {
|
||||
uint8_t csa2_select; /*!< Select CSA2 */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set parameters of controller logs (OCF: 0x0114)
|
||||
*
|
||||
* @note The init function is `log_stack_enableLogsRelatedVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_LOG_PARAMS_OCF (0x0114)
|
||||
/**
|
||||
* @brief Controller logs cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_log_params {
|
||||
uint8_t type; /*!< Operation type */
|
||||
uint32_t output_enable; /*!< Enable/disable output */
|
||||
uint8_t buffer_optoin /*!< Select log buffers */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set BLE vendor events mask (OCF: 0x0116)
|
||||
*
|
||||
* @note The init function is `hci_stack_enableSetVsEvtMaskVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_LE_VENDOR_EVTS_MASK_OCF (0x0116)
|
||||
/**
|
||||
* @brief Set BLE vendor events mask cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_vs_evts_mask {
|
||||
uint32_t evt_masks; /*!< BLE vendor events Mask */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set peer sleep clock accuracy to a constant value (OCF: 0x0118)
|
||||
*
|
||||
* @note The init function is `winWiden_stack_enableSetConstPeerScaVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_CONST_PEER_SCA_OCF (0x0118)
|
||||
/**
|
||||
* @brief Peer constant SCA cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_const_peer_sca {
|
||||
uint16_t peer_sca; /*!< Peer SCA */
|
||||
};
|
||||
|
||||
// @brief HCI VS Events for Espressif's Bluetooth Host
|
||||
//
|
||||
// @note The following HCI VS events are exclusively for Espressif's Bluetooth Host (ESP-Bluedroid Host or ESP-NimBLE Host).
|
||||
// If you are using a non-ESP host or HCI UART, these events will remain disabled unless the initialization function is explicitly called from the application.
|
||||
// Note, these init functions as well as these additional HCI VS events are intended for Espressif's Bluetooth Host use only.
|
||||
// Application developers **should not** call the init functions in their applications.
|
||||
//
|
||||
|
||||
/**
|
||||
* @brief BLE Scan/Connect Request, Aux Connect Response received event (EVTCODE: 0xFF, SUBCODE: 0xC0)
|
||||
*
|
||||
* @note The init function is `adv_stack_enableScanReqRxdVsEvent(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_CONN_SCAN_REQ_RXED_EVT_SUBCODE (0xC0)
|
||||
/**
|
||||
* @brief BLE Scan/Connect Request, Aux Connect Response received event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_conn_scan_req_rxed_evt {
|
||||
uint8_t evt_type; /*!< Event type; 0: SCAN_REQ; 1: CONN_IND */
|
||||
uint8_t handle; /*!< Advertisement handle */
|
||||
uint8_t peer_addr_type; /*!< Peer address type */
|
||||
uint8_t peer_addr[6]; /*!< Peer address */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BLE Channel Map Update Completion event (EVTCODE: 0xFF, SUBCODE: 0xC1)
|
||||
*
|
||||
* @note The init function is `conn_stack_enableChanMapUpdCompVsEvent(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_CHAN_UPDATE_COMP_EVT_SUBCODE (0xC1)
|
||||
/**
|
||||
* @brief BLE Channel Map Update Completion event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_chan_update_comp_evt {
|
||||
uint8_t status; /*!< Controller error code */
|
||||
uint16_t handle; /*!< Connection handle */
|
||||
uint8_t ch_map[5]; /*!< Updated channel map */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BLE Wakeup From Sleep event (EVTCODE: 0xFF, SUBCODE: 0xC3)
|
||||
*
|
||||
* @note The init function is `sleep_stack_enableWakeupVsEvent(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_SLEEP_WAKEUP_EVT_SUBCODE (0xC3)
|
||||
/**
|
||||
* @brief BLE wakeup event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_sleep_wakeup_evt {
|
||||
// no parameters
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BLE advertising report lost event for flow control (EVTCODE: 0x3E, SUBCODE: 0xF0)
|
||||
*
|
||||
* @note The init function is `scan_stack_enableAdvFlowCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_ADV_LOST_EVT_SUBCODE (0xF0)
|
||||
/**
|
||||
* @brief ADV lost event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_adv_lost_evt {
|
||||
uint32_t nb_lost; /*!< The number of ADV report discarded */
|
||||
};
|
||||
|
||||
//
|
||||
// @brief HCI VS Commands for Espressif's Internal-Use Debugging
|
||||
//
|
||||
// @note The following HCI VS debugging commands are implemented in Bluetooth controller pre-compiled libraries.
|
||||
// These commands are not linked into the application binary, unless the function `esp_ble_internalTestFeaturesEnable(true)`is called from the application.
|
||||
// They are intended for Espressif's internal use only. Application developers **should not** call `esp_ble_internalTestFeaturesEnable(true)` in their applications.
|
||||
//
|
||||
|
||||
#define ESP_BT_VS_CFG_TEST_RELATED_OCF (0x0113)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_SUBCMD (0X00)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_ADV_DELAY_SUBCMD (0X01)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_PREF_CODED_SUBCMD (0X02)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_DEFAULT_PRIV_MODE_SUBCMD (0X03)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCAN_FOREVER_SUBCMD (0X04)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_EXPECTED_PEER_SUBCMD (0X05)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_ADV_TXED_CNT_SUBCMD (0X06)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_SCAN_RXED_CNT_SUBCMD (0X07)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_TXPWR_LVL_SUBCMD (0X08)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXPWR_LVL_SUBCMD (0X09)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_TXPWR_LVL_ENH_SUBCMD (0X0a)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXPWR_LVL_ENH_SUBCMD (0X0b)
|
||||
#define ESP_BT_VS_CFG_TEST_IGNORE_WL_FOR_DIR_ADV_SUBCMD (0X0c)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_ADV_RXED_RSSI_SUBCMD (0X0d)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_CCA_SUBCMD (0X0e)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_CCA_WIN_SUBCMD (0X0f)
|
||||
#define ESP_BT_VS_CFG_TEST_READ_CCA_DATA_SUBCM (0X10)
|
||||
#define ESP_BT_VS_CFG_TEST_CLEAR_RAND_ADDR_SUBCMD (0X11)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_MAX_TXPWR_SUBCMD (0X12)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXPWR_RANGE_SUBCMD (0X13)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCAN_AA_SUBCMD (0X14)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_ADV_AA_SUBCMD (0X15)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCAN_CHAN_SUBCMD (0X16)
|
||||
#define ESP_BT_VS_CFG_TEST_SKIP_LIGHT_SLEEP_CHECK_SUBCMD (0X17)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_WAKEUP_OVERHEAD_SUBCMD (0X18)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_ADV_MIN_ITVL_SUBCMD (0X19)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_CTRL_STATUS_SUBCMD (0X1a)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_CONN_PHY_TXPWR_SUBCMD (0X1b)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_CONN_PHY_TXPWR_SUBCMD (0X1c)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_RXBUF_EMPTY_CNT_SUBCMD (0X1d)
|
||||
#define ESP_BT_VS_CFG_TEST_RESTART_SUBCMD (0X1e)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_RECODE_RX_STATE_SUBCMD (0X1f)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_RECODE_CNT_SUBCMD (0X20)
|
||||
#define ESP_BT_VS_CFG_TEST_CLR_RECODE_CNT_SUBCMD (0X21)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_CTRL_COMPILE_VER_SUBCMD (0X24)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_AUX_ADV_OFFSET_SUBCMD (0X25)
|
||||
#define ESP_BT_VS_CFG_TEST_INIT_FLEXIBLE_MODE_SUBCMD (0X26)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_FLEXIBLE_MODE_SUBCMD (0X27)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_FLEXIBLE_CONN_ERR_SUBCMD (0X28)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_FLEXIBLE_ADV_ERR_SUBCMD (0X29)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_FLEXIBLE_SCAN_ERR_SUBCMD (0X2a)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXED_CRCERR_SUBCMD (0X2c)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_BACKOFF_UPLIMIT_SUBCMD (0X2d)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_RXED_ADV_ADI_SUBCMD (0X2f)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCH_RAND_MODE_SUBCMD (0X30)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_RX_SENS_THRESH_SUBCMD (0X31)
|
||||
#define ESP_BT_VS_CFG_TEST_CHECK_MSYS_BUF_SUBCMD (0X32)
|
||||
#define ESP_BT_VS_CFG_TEST_UPDATE_BLE_TIMER_SUBCMD (0X33)
|
||||
#define ESP_BT_VS_CFG_TEST_UPDATE_BLE_RTC_SUBCMD (0X34)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_LOCKED_MEM_NUM_SUBCMD (0X35)
|
||||
#define ESP_BT_VS_CFG_TEST_ALLOW_MEM_ALLOC_SUBCMD (0X36)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCH_RAND_INFO_PTR_SUBCMD (0X37)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_DIAG_IO_SUBCMD (0X38)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_AGC_MAX_GAIN_SUBCMD (0X39)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_CHAN_ASSESS_SUBCMD (0X40)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_BACKOFF_UPLIMIT_SUBCMD (0X41)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_CONN_TOP_PRIO_RESV_THRESH_SUBCMD (0X42)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_TEST_EVT_MSK_SUBCMD (0X43)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_WAKEUP_TIMEOUT_SUBCMD (0X45)
|
||||
#define ESP_BT_VS_CFG_TEST_RELATED_SUBCMD_MAX (0Xff)
|
||||
|
||||
//
|
||||
// @brief HCI VS Events for Espressif's Internal-Use Debugging
|
||||
//
|
||||
// @note The following HCI VS debugging events are implemented in Bluetooth controller pre-compiled libraries.
|
||||
// These events are not linked into the application binary, unless the function `esp_ble_internalTestFeaturesEnable(true)`is called from the application.
|
||||
// Application developers **should not** call `esp_ble_internalTestFeaturesEnable(true)` in their applications.
|
||||
//
|
||||
|
||||
#define ESP_BT_VS_LE_RUNNING_STATUS_EVT_SUBCODE (0xC3)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "../../common/btdm_le_vs.h"
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
#include "btdm_user_cfg.h"
|
||||
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
#include "bredr_user_cfg.h"
|
||||
#endif
|
||||
#if SOC_BT_CLASSIC_SUPPORTED
|
||||
#include "../../common/btdm_bredr.h"
|
||||
#endif // SOC_BT_CLASSIC_SUPPORTED
|
||||
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
#include "ble_user_cfg.h"
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
#if SOC_BLE_SUPPORTED
|
||||
#include "../../common/btdm_le.h"
|
||||
#endif /* SOC_BLE_SUPPORTED */
|
||||
|
||||
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
|
||||
#include "driver/uart.h"
|
||||
@@ -52,11 +52,6 @@ typedef enum {
|
||||
ESP_BT_CONTROLLER_STATUS_NUM, /*!< Controller is in disabled state */
|
||||
} esp_bt_controller_status_t;
|
||||
|
||||
#if (UC_BT_CTRL_BR_EDR_IS_ENABLE)
|
||||
#define ESP_BREDR_CTRL_CONFIG_MAGIC_VAL 0x5A5AA5A5
|
||||
#define ESP_BREDR_CTRL_CONFIG_VERSION 0x20250327
|
||||
|
||||
#endif // #if (UC_BT_CTRL_BR_EDR_IS_ENABLE)
|
||||
/**
|
||||
* @brief BLE tx power type
|
||||
* ESP_BLE_PWR_TYPE_CONN_HDL0-8: for each connection, and only be set after connection completed.
|
||||
@@ -67,7 +62,7 @@ typedef enum {
|
||||
* if neither in scan mode nor in adv mode, it will use this default value.
|
||||
* If none of power type is set, system will use ESP_PWR_LVL_P3 as default for ADV/SCAN/CONN0-9.
|
||||
*/
|
||||
typedef enum {
|
||||
typedef enum esp_ble_power_type {
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL0 = 0, /*!< For connection handle 0 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL1 = 1, /*!< For connection handle 1 */
|
||||
ESP_BLE_PWR_TYPE_CONN_HDL2 = 2, /*!< For connection handle 2 */
|
||||
@@ -86,7 +81,7 @@ typedef enum {
|
||||
/**
|
||||
* @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm).
|
||||
*/
|
||||
typedef enum {
|
||||
typedef enum esp_power_level {
|
||||
ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */
|
||||
ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */
|
||||
ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */
|
||||
@@ -109,26 +104,6 @@ typedef enum {
|
||||
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
|
||||
} esp_power_level_t;
|
||||
|
||||
/**
|
||||
* @brief The enhanced type of which tx power, could set Advertising/Connection/Default and etc.
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT = 0,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_ADV,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_SCAN,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_INIT,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_CONN,
|
||||
ESP_BLE_ENHANCED_PWR_TYPE_MAX,
|
||||
} esp_ble_enhanced_power_type_t;
|
||||
|
||||
/**
|
||||
* @brief BR/EDR audio data transport path
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_SCO_DATA_PATH_HCI = 0, /*!< data over HCI transport */
|
||||
ESP_SCO_DATA_PATH_PCM = 1, /*!< data over PCM interface */
|
||||
} esp_sco_data_path_t;
|
||||
|
||||
/**
|
||||
* @brief Address type and address value.
|
||||
*/
|
||||
@@ -137,17 +112,6 @@ typedef struct {
|
||||
uint8_t val[6]; /*!< Array containing the 6-byte Bluetooth address value */
|
||||
} esp_ble_addr_t;
|
||||
|
||||
/**
|
||||
* @brief Select buffers
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_BLE_LOG_BUF_HCI = 0x02,
|
||||
ESP_BLE_LOG_BUF_CONTROLLER = 0x05,
|
||||
} esp_ble_log_buf_t;
|
||||
|
||||
#define BLE_CONFIG_VERSION 0x20241029
|
||||
#define BLE_CONFIG_MAGIC 0x5A5AA5A5
|
||||
|
||||
#define BTDM_CONFIG_VERSION 0x20260127
|
||||
#define BTDM_CONFIG_MAGIC_VALUE 0x5a5aa5a5
|
||||
|
||||
@@ -155,74 +119,6 @@ typedef enum {
|
||||
************************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief mempool handle type used in BR/EDR controller
|
||||
*/
|
||||
typedef void * orca_mempool_t;
|
||||
|
||||
/**
|
||||
* @brief mempool operations used in BR/EDR controller
|
||||
*/
|
||||
struct orca_mempool_ops {
|
||||
orca_mempool_t (*create_with_pool)(void *mem, size_t pool_bytes, size_t max_bytes); /*!< mempool construction */
|
||||
void (*destroy)(orca_mempool_t mempool); /*!< mempool destruction */
|
||||
void *(*malloc)(orca_mempool_t mempool, size_t size); /*!< allocate memory from mempool */
|
||||
void (*free)(orca_mempool_t mempool, void *ptr); /*!< release memory */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BR/EDR controller configuration options
|
||||
*/
|
||||
typedef struct {
|
||||
/*
|
||||
* Following parameters can not be configured runtime when call esp_bt_controller_init()
|
||||
* They will be overwritten by constant values from menuconfig options or from macros.
|
||||
* So, do not modify the value when esp_bt_controller_init()
|
||||
*/
|
||||
uint32_t bredr_version; /*!< version number of the defined structure */
|
||||
/*
|
||||
* Following parameters can be configured runtime, when call esp_bt_controller_init()
|
||||
*/
|
||||
uint8_t sleep_mode; /*!< controller sleep mode */
|
||||
uint8_t bt_test_mode_en; /*!< enable br/edr test mode */
|
||||
uint8_t acl_cca_en; /*!< Enable BR/EDR ACL Transmit Clear Channel Assessment (TX CCA) */
|
||||
int8_t cca_rssi_thr; /*!< BR/EDR RSSI threshold for Transmit Clear Channel Assessment (CCA) */
|
||||
uint8_t max_acl_conn; /*!< Maximum number of BR/EDR ACL connections. Configurable in menuconfig */
|
||||
uint8_t max_sync_conn; /*!< Maximum number of BR/EDR synchronous connections. Configurable in menuconfig */
|
||||
uint8_t cpb_tx_link_num; /*!< BR/EDR CPB TX link number */
|
||||
uint8_t cpb_rx_link_num; /*!< BR/EDR CPB RX link number */
|
||||
uint8_t bt_sco_datapath; /*!< SCO data path, i.e. HCI(0) or PCM(1) */
|
||||
uint8_t hci_tl_type; /*!< HCI transport layer, UART, VHCI, etc */
|
||||
void *hci_tl_funcs; /*!< hci transport functions used, must be set when hci_tl_type is UART */
|
||||
uint32_t cfg_mask; /*!< reserved */
|
||||
uint32_t hw_target_code; /*!< hardware target */
|
||||
int8_t acl_min_tx_pwr; /*!< Default transmit power for ACL minimum */
|
||||
int8_t acl_max_tx_pwr; /*!< Default transmit power for ACL maximum */
|
||||
int8_t apb_tx_pwr; /*!< Default transmit power for APB */
|
||||
int8_t page_tx_pwr; /*!< Default transmit power for Page */
|
||||
int8_t pscan_tx_pwr; /*!< Default transmit power for Page Scan */
|
||||
int8_t iscan_tx_pwr; /*!< Default transmit power for Inquiry Scan */
|
||||
int8_t cpb_tx_pwr; /*!< Default transmit power for CPB TX */
|
||||
int8_t strain_tx_pwr; /*!< Default transmit power for Synchronization Train */
|
||||
uint8_t rf_hw_type; /*!< RF hardware type */
|
||||
uint8_t static_aclu_tx_buf_nb; /*!< Static ACL-U TX buffer number */
|
||||
uint8_t dynamic_aclu_tx_buf_nb; /*!< Dynamic ACL-U TX buffer number */
|
||||
uint8_t aclu_rx_buf_nb; /*!< ACL-U RX buffer number */
|
||||
uint8_t sync_tx_buf_nb; /*!< SCO TX buffer number */
|
||||
uint8_t sync_rx_buf_nb; /*!< SCO RX buffer number */
|
||||
uint8_t esco_ev4_supp : 1; /*!< eSCO support EV4 packet type */
|
||||
uint8_t esco_ev5_supp : 1; /*!< eSCO support EV5 packet type */
|
||||
uint8_t esco_ev3_2_supp : 1; /*!< eSCO support 2-EV3 packet type */
|
||||
uint8_t esco_ev3_3_supp : 1; /*!< eSCO support 3-EV3 packet type */
|
||||
uint8_t esco_3_slots_supp : 1; /*!< eSCO support 2-EV5 and/or 3-EV5 packet type */
|
||||
uint8_t bt_legacy_auth_vs_evt :1; /*!< 1 if BR/EDR Legacy Authentication Vendor Specific Event is enabled, which is required to protect from BIAS attack; 0 otherwise. Configurable in menuconfig */
|
||||
uint8_t inq_filter_en : 1; /*!< Enable inquiry result filter */
|
||||
uint8_t dtm_en :1; /*!< BR/EDR direct test mode */
|
||||
uint32_t mempool_size; /*!< Required mempool size used in BR/EDR controller */
|
||||
struct orca_mempool_ops *mempool_ops; /*!< mempool operations used in BR/EDR controller */
|
||||
uint32_t bredr_magic; /*!< Magic number */
|
||||
} esp_bredr_controller_config_t;
|
||||
|
||||
/**
|
||||
* @brief BTDM controller common configuration options
|
||||
*/
|
||||
@@ -232,12 +128,11 @@ typedef struct {
|
||||
uint8_t task_prio; /*!< Priority of the Bluetooth controller task */
|
||||
uint8_t task_run_cpu; /*!< CPU number on which the Bluetooth controller task runs */
|
||||
uint8_t hci_cmd_num; /*!< HCI command buffer number */
|
||||
uint8_t hci_conn_num; /*!< HCI level connection number */
|
||||
uint8_t sleep_en; /*!< Enable sleep functionality */
|
||||
uint8_t version_num; /*!< Hardware version number of this chip */
|
||||
uint8_t bluetooth_mode; /*!< Controller mode: BR/EDR, BLE or Dual Mode */
|
||||
uint32_t magic; /*!< Magic number for configuration validation */
|
||||
} esp_btdm_controller_config_t;
|
||||
} esp_bt_ctrl_btdm_config_t;
|
||||
|
||||
/**
|
||||
* @brief Controller config options, depend on config mask.
|
||||
@@ -245,81 +140,11 @@ typedef struct {
|
||||
* some options or parameters of some functions enabled by config mask.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Bluetooth LE controller configuration options
|
||||
*/
|
||||
struct {
|
||||
uint32_t config_version; /*!< Version number of the defined structure */
|
||||
uint16_t ble_ll_resolv_list_size; /*!< Size of the resolvable private address list */
|
||||
uint16_t ble_hci_evt_hi_buf_count; /*!< Count of high buffers for HCI events */
|
||||
uint16_t ble_hci_evt_lo_buf_count; /*!< Count of low buffers for HCI events */
|
||||
uint8_t ble_ll_sync_list_cnt; /*!< Number of synchronization lists */
|
||||
uint8_t ble_ll_sync_cnt; /*!< Number of synchronizations */
|
||||
uint16_t ble_ll_rsp_dup_list_count; /*!< Count of duplicated lists for scan response packets */
|
||||
uint16_t ble_ll_adv_dup_list_count; /*!< Count of duplicated lists for advertising packets */
|
||||
uint8_t ble_ll_tx_pwr_dbm; /*!< Tx power (transmit power) in dBm */
|
||||
uint64_t rtc_freq; /*!< Frequency of RTC (Real-Time Clock) */
|
||||
uint16_t ble_ll_sca; /*!< Sleep Clock Accuracy (SCA) parameter */
|
||||
uint8_t ble_ll_scan_phy_number; /*!< Number of PHYs supported for scanning */
|
||||
uint16_t ble_ll_conn_def_auth_pyld_tmo; /*!< Connection default authentication payload timeout */
|
||||
uint8_t ble_ll_jitter_usecs; /*!< Jitter time in microseconds */
|
||||
uint16_t ble_ll_sched_max_adv_pdu_usecs; /*!< Maximum time in microseconds for advertising PDU scheduling */
|
||||
uint16_t ble_ll_sched_direct_adv_max_usecs; /*!< Maximum time in microseconds for directed advertising scheduling */
|
||||
uint16_t ble_ll_sched_adv_max_usecs; /*!< Maximum time in microseconds for advertising scheduling */
|
||||
uint16_t ble_scan_rsp_data_max_len; /*!< Maximum length of scan response data */
|
||||
uint8_t ble_ll_cfg_num_hci_cmd_pkts; /*!< Number of HCI command packets that can be queued */
|
||||
uint32_t ble_ll_ctrl_proc_timeout_ms; /*!< Control processing timeout in milliseconds */
|
||||
uint16_t nimble_max_connections; /*!< Maximum number of connections supported */
|
||||
uint8_t ble_whitelist_size; /*!< Size of the white list */
|
||||
uint16_t ble_acl_buf_size; /*!< Buffer size of ACL (Asynchronous Connection-Less) data */
|
||||
uint16_t ble_acl_buf_count; /*!< Buffer count of ACL data */
|
||||
uint16_t ble_hci_evt_buf_size; /*!< Buffer size for HCI event data */
|
||||
uint16_t ble_multi_adv_instances; /*!< Number of advertising instances */
|
||||
uint16_t ble_ext_adv_max_size; /*!< Maximum size of extended advertising data */
|
||||
uint16_t controller_task_stack_size; /*!< Size of Bluetooth controller task stack, to be removed */
|
||||
uint8_t controller_task_prio; /*!< Priority of the Bluetooth task, to be removed */
|
||||
uint8_t controller_run_cpu; /*!< CPU number on which the Bluetooth controller task runs, to be removed */
|
||||
uint8_t enable_qa_test; /*!< Enable for QA test */
|
||||
uint8_t enable_bqb_test; /*!< Enable for BQB test */
|
||||
uint8_t enable_tx_cca; /*!< Enable Clear Channel Assessment (CCA) when transmitting */
|
||||
uint8_t cca_rssi_thresh; /*!< RSSI threshold for CCA */
|
||||
uint8_t sleep_en; /*!< Enable sleep functionality */
|
||||
uint8_t coex_phy_coded_tx_rx_time_limit; /*!< Coexistence PHY coded TX and RX time limit */
|
||||
uint8_t dis_scan_backoff; /*!< Disable scan backoff */
|
||||
uint8_t ble_scan_classify_filter_enable; /*!< Enable classification filter for BLE scan */
|
||||
uint8_t cca_drop_mode; /*!< CCA drop mode */
|
||||
int8_t cca_low_tx_pwr; /*!< Low TX power setting for CCA */
|
||||
uint8_t main_xtal_freq; /*!< Main crystal frequency */
|
||||
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the white list for directed advertising */
|
||||
uint8_t enable_pcl; /*!< Enable power control */
|
||||
uint8_t csa2_select; /*!< Select CSA2 */
|
||||
uint8_t enable_csr; /*!< Enable connection subrate */
|
||||
int8_t backoff_rssi; /*!< Set the lowest rssi threshold for backoff */
|
||||
bool iso_enabled; /*!< Enable ISO */
|
||||
bool iso_bqb_test; /*!< Enable ISO BQB test */
|
||||
bool iso_fra_unseg; /*!< Enable ISO FRA unsegmented */
|
||||
bool iso_nsfc_en; /*!< Enable ISO NSCF */
|
||||
uint8_t iso_nsfc_num; /*!< Number of ISO NSCF */
|
||||
uint8_t iso_buf_count; /*!< Number of ISO buffer */
|
||||
uint16_t iso_buf_size; /*!< Size of ISO buffer */
|
||||
uint8_t iso_big_count; /*!< Number of ISO big */
|
||||
uint16_t iso_bis_count; /*!< Number of ISO bis */
|
||||
uint8_t iso_bis_per_big; /*!< Number of ISO bis per big */
|
||||
uint8_t iso_cig_count; /*!< Number of ISO cig */
|
||||
uint16_t iso_cis_count; /*!< Number of ISO cis */
|
||||
uint8_t iso_cis_per_cig; /*!< Number of ISO cis per cig */
|
||||
uint32_t config_magic; /*!< Configuration magic value */
|
||||
} ble; /*!< Bluetooth LE controller configuration options */
|
||||
|
||||
/**
|
||||
* @brief Bluetooth Classic controller configuration options
|
||||
*/
|
||||
esp_bredr_controller_config_t bredr; /*!< Bluetooth Classic controller configuration options */
|
||||
|
||||
/**
|
||||
* @brief Bluetooth controller common configuration options
|
||||
*/
|
||||
esp_btdm_controller_config_t btdm; /*!< Bluetooth controller common configuration options */
|
||||
esp_bt_ctrl_le_config_t ble; /*!< Bluetooth LE controller configuration options */
|
||||
#if SOC_BT_CLASSIC_SUPPORTED
|
||||
esp_bt_ctrl_bredr_config_t bredr; /*!< Bluetooth Classic controller configuration options */
|
||||
#endif // SOC_BT_CLASSIC_SUPPORTED
|
||||
esp_bt_ctrl_btdm_config_t btdm; /*!< Bluetooth controller common configuration options */
|
||||
} esp_bt_controller_config_t;
|
||||
|
||||
#if defined(CONFIG_BTDM_CTRL_MODE_BLE_ONLY)
|
||||
@@ -328,329 +153,44 @@ typedef struct {
|
||||
#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_CLASSIC_BT
|
||||
#else
|
||||
#define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_BTDM
|
||||
#endif
|
||||
#endif // defined(CONFIG_BTDM_CTRL_MODE_BLE_ONLY)
|
||||
|
||||
#if defined(CONFIG_BT_LE_ISO_SUPPORT)
|
||||
#define DEFAULT_BT_LE_ISO_ENABLED 1
|
||||
#if defined(CONFIG_BT_LE_ISO_FRA_UNSEG)
|
||||
#define DEFAULT_BT_LE_ISO_FRA_UNSEG CONFIG_BT_LE_ISO_FRA_UNSEG
|
||||
#if SOC_BT_CLASSIC_SUPPORTED
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() \
|
||||
{ \
|
||||
.ble = _BT_CTRL_LE_INIT_CONFIG_DEFAULT(), \
|
||||
.bredr = _BT_CTRL_BREDR_INIT_CONFIG_DEFAULT(), \
|
||||
.btdm = \
|
||||
{ \
|
||||
.version = BTDM_CONFIG_VERSION, \
|
||||
.task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.task_run_cpu = CONFIG_BT_CTRL_PINNED_TO_CORE, \
|
||||
.hci_cmd_num = CONFIG_BT_CTRL_HCI_CMD_NUM, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.version_num = 0, \
|
||||
.bluetooth_mode = BTDM_CONTROLLER_MODE_EFF, \
|
||||
.magic = BTDM_CONFIG_MAGIC_VALUE, \
|
||||
}, \
|
||||
}
|
||||
#else
|
||||
#define DEFAULT_BT_LE_ISO_FRA_UNSEG (0)
|
||||
#endif
|
||||
#if defined(CONFIG_BT_LE_ISO_NSFC_EN)
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_EN CONFIG_BT_LE_ISO_NSFC_EN
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_NUM CONFIG_BT_LE_ISO_NSFC_NUM
|
||||
#else
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_EN (0)
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_NUM (0)
|
||||
#endif
|
||||
#define DEFAULT_BT_LE_ISO_BUF_COUNT CONFIG_BT_LE_ISO_BUF_COUNT
|
||||
#define DEFAULT_BT_LE_ISO_BUF_SIZE CONFIG_BT_LE_ISO_BUF_SIZE
|
||||
#define DEFAULT_BT_LE_ISO_BIG CONFIG_BT_LE_ISO_BIG
|
||||
#define DEFAULT_BT_LE_ISO_BIS CONFIG_BT_LE_ISO_BIS
|
||||
#define DEFAULT_BT_LE_ISO_BIS_PER_BIG CONFIG_BT_LE_ISO_BIS_PER_BIG
|
||||
#define DEFAULT_BT_LE_ISO_CIG CONFIG_BT_LE_ISO_CIG
|
||||
#define DEFAULT_BT_LE_ISO_CIS CONFIG_BT_LE_ISO_CIS
|
||||
#define DEFAULT_BT_LE_ISO_CIS_PER_CIG CONFIG_BT_LE_ISO_CIS_PER_CIG
|
||||
#else
|
||||
#define DEFAULT_BT_LE_ISO_ENABLED 0
|
||||
#define DEFAULT_BT_LE_ISO_FRA_UNSEG 0
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_EN 0
|
||||
#define DEFAULT_BT_LE_ISO_NSFC_NUM 0
|
||||
#define DEFAULT_BT_LE_ISO_BUF_COUNT 0
|
||||
#define DEFAULT_BT_LE_ISO_BUF_SIZE 0
|
||||
#define DEFAULT_BT_LE_ISO_BIG 0
|
||||
#define DEFAULT_BT_LE_ISO_BIS 0
|
||||
#define DEFAULT_BT_LE_ISO_BIS_PER_BIG 0
|
||||
#define DEFAULT_BT_LE_ISO_CIG 0
|
||||
#define DEFAULT_BT_LE_ISO_CIS 0
|
||||
#define DEFAULT_BT_LE_ISO_CIS_PER_CIG 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_BTDM_CTRL_MODE_BTDM
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \
|
||||
.ble = { \
|
||||
.config_version = BLE_CONFIG_VERSION, \
|
||||
.ble_ll_resolv_list_size = CONFIG_BT_LE_LL_RESOLV_LIST_SIZE, \
|
||||
.ble_hci_evt_hi_buf_count = DEFAULT_BT_LE_HCI_EVT_HI_BUF_COUNT, \
|
||||
.ble_hci_evt_lo_buf_count = DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT, \
|
||||
.ble_ll_sync_list_cnt = DEFAULT_BT_LE_MAX_PERIODIC_ADVERTISER_LIST, \
|
||||
.ble_ll_sync_cnt = DEFAULT_BT_LE_MAX_PERIODIC_SYNCS, \
|
||||
.ble_ll_rsp_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
|
||||
.ble_ll_adv_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
|
||||
.ble_ll_tx_pwr_dbm = 0, \
|
||||
.rtc_freq = 32000, \
|
||||
.ble_ll_sca = CONFIG_BT_LE_LL_SCA, \
|
||||
.ble_ll_scan_phy_number = BLE_LL_SCAN_PHY_NUMBER_N, \
|
||||
.ble_ll_conn_def_auth_pyld_tmo = BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N, \
|
||||
.ble_ll_jitter_usecs = BLE_LL_JITTER_USECS_N, \
|
||||
.ble_ll_sched_max_adv_pdu_usecs = BLE_LL_SCHED_MAX_ADV_PDU_USECS_N, \
|
||||
.ble_ll_sched_direct_adv_max_usecs = BLE_LL_SCHED_DIRECT_ADV_MAX_USECS_N, \
|
||||
.ble_ll_sched_adv_max_usecs = BLE_LL_SCHED_ADV_MAX_USECS_N, \
|
||||
.ble_scan_rsp_data_max_len = DEFAULT_BT_LE_SCAN_RSP_DATA_MAX_LEN_N, \
|
||||
.ble_ll_cfg_num_hci_cmd_pkts = BLE_LL_CFG_NUM_HCI_CMD_PKTS_N, \
|
||||
.ble_ll_ctrl_proc_timeout_ms = BLE_LL_CTRL_PROC_TIMEOUT_MS_N, \
|
||||
.nimble_max_connections = DEFAULT_BT_LE_MAX_CONNECTIONS, \
|
||||
.ble_whitelist_size = DEFAULT_BT_NIMBLE_WHITELIST_SIZE, \
|
||||
.ble_acl_buf_size = DEFAULT_BT_LE_ACL_BUF_SIZE, \
|
||||
.ble_acl_buf_count = DEFAULT_BT_LE_ACL_BUF_COUNT, \
|
||||
.ble_hci_evt_buf_size = DEFAULT_BT_LE_HCI_EVT_BUF_SIZE, \
|
||||
.ble_multi_adv_instances = DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, \
|
||||
.ble_ext_adv_max_size = DEFAULT_BT_LE_EXT_ADV_MAX_SIZE, \
|
||||
.controller_task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.controller_task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.controller_run_cpu = 0, \
|
||||
.enable_qa_test = RUN_QA_TEST, \
|
||||
.enable_bqb_test = RUN_BQB_TEST, \
|
||||
.enable_tx_cca = DEFAULT_BT_LE_TX_CCA_ENABLED, \
|
||||
.cca_rssi_thresh = 256 - DEFAULT_BT_LE_CCA_RSSI_THRESH, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
|
||||
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
|
||||
.ble_scan_classify_filter_enable = 1, \
|
||||
.main_xtal_freq = CONFIG_XTAL_FREQ, \
|
||||
.ignore_wl_for_direct_adv = 0, \
|
||||
.enable_pcl = 0, \
|
||||
.csa2_select = 1, \
|
||||
.enable_csr = 0, \
|
||||
.backoff_rssi = -100, \
|
||||
.iso_enabled = DEFAULT_BT_LE_ISO_ENABLED, \
|
||||
.iso_bqb_test = false, \
|
||||
.iso_fra_unseg = DEFAULT_BT_LE_ISO_FRA_UNSEG, \
|
||||
.iso_nsfc_en = DEFAULT_BT_LE_ISO_NSFC_EN, \
|
||||
.iso_nsfc_num = DEFAULT_BT_LE_ISO_NSFC_NUM, \
|
||||
.iso_buf_count = DEFAULT_BT_LE_ISO_BUF_COUNT, \
|
||||
.iso_buf_size = DEFAULT_BT_LE_ISO_BUF_SIZE, \
|
||||
.iso_big_count = DEFAULT_BT_LE_ISO_BIG, \
|
||||
.iso_bis_count = DEFAULT_BT_LE_ISO_BIS, \
|
||||
.iso_bis_per_big = DEFAULT_BT_LE_ISO_BIS_PER_BIG, \
|
||||
.iso_cig_count = DEFAULT_BT_LE_ISO_CIG, \
|
||||
.iso_cis_count = DEFAULT_BT_LE_ISO_CIS, \
|
||||
.iso_cis_per_cig = DEFAULT_BT_LE_ISO_CIS_PER_CIG, \
|
||||
.config_magic = BLE_CONFIG_MAGIC, \
|
||||
}, \
|
||||
.bredr = { \
|
||||
.bredr_version = ESP_BREDR_CTRL_CONFIG_VERSION, \
|
||||
.sleep_mode = 0, \
|
||||
.bt_test_mode_en = UC_BR_EDR_TEST_MODE_EN, \
|
||||
.acl_cca_en = UC_BR_EDR_TX_CCA_EN, \
|
||||
.cca_rssi_thr = -UC_BR_EDR_CCA_RSSI_THRESH, \
|
||||
.max_acl_conn = UC_BR_EDR_MAX_ACL_CONN, \
|
||||
.max_sync_conn = UC_BR_EDR_CTRL_MAX_SYNC_CONN, \
|
||||
.cpb_tx_link_num = UC_BR_EDR_CPB_TX_LINK_NB, \
|
||||
.cpb_rx_link_num = UC_BR_EDR_CPB_RX_LINK_NB, \
|
||||
.bt_sco_datapath = UC_BR_EDR_SCO_DATA_PATH, \
|
||||
.hci_tl_type = 0, \
|
||||
.hci_tl_funcs = NULL, \
|
||||
.cfg_mask = 0, \
|
||||
.hw_target_code = 0, \
|
||||
.acl_min_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_ACL_MIN, \
|
||||
.acl_max_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_ACL_MAX, \
|
||||
.apb_tx_pwr = UC_BR_EDR_TX_PWR_APB, \
|
||||
.page_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_PAGE, \
|
||||
.pscan_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_PSCAN, \
|
||||
.iscan_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_ISCAN, \
|
||||
.cpb_tx_pwr = UC_BR_EDR_TX_PWR_CPB, \
|
||||
.strain_tx_pwr = UC_BR_EDR_TX_PWR_STRAIN, \
|
||||
.rf_hw_type = 0, \
|
||||
.static_aclu_tx_buf_nb = UC_BR_EDR_ACLU_TX_BUF_NB - UC_BR_EDR_DYNAMIC_ACLU_TX_BUF_NB, \
|
||||
.dynamic_aclu_tx_buf_nb = UC_BR_EDR_DYNAMIC_ACLU_TX_BUF_NB, \
|
||||
.aclu_rx_buf_nb = UC_BR_EDR_ACLU_RX_BUF_NB, \
|
||||
.sync_tx_buf_nb = UC_BR_EDR_SYNC_TX_BUF_NB, \
|
||||
.sync_rx_buf_nb = UC_BR_EDR_SYNC_RX_BUF_NB, \
|
||||
.esco_ev4_supp = UC_BR_EDR_ESCO_EV4_SUPP, \
|
||||
.esco_ev5_supp = UC_BR_EDR_ESCO_EV5_SUPP, \
|
||||
.esco_ev3_2_supp = UC_BR_EDR_ESCO_EV3_2_SUPP, \
|
||||
.esco_ev3_3_supp = UC_BR_EDR_ESCO_EV3_3_SUPP, \
|
||||
.esco_3_slots_supp = UC_BR_EDR_ESCO_3_SLOTS_SUPP, \
|
||||
.bt_legacy_auth_vs_evt = UC_BR_EDR_LEGACY_AUTH_VENDOR_EVT, \
|
||||
.inq_filter_en = 0, \
|
||||
.dtm_en = 0, \
|
||||
.bredr_magic = ESP_BREDR_CTRL_CONFIG_MAGIC_VAL, \
|
||||
}, \
|
||||
.btdm = { \
|
||||
.version = BTDM_CONFIG_VERSION, \
|
||||
.task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.task_run_cpu = CONFIG_BT_CTRL_PINNED_TO_CORE, \
|
||||
.hci_cmd_num = CONFIG_BT_CTRL_HCI_CMD_NUM, \
|
||||
.hci_conn_num = DEFAULT_BT_LE_MAX_CONNECTIONS + DEFAULT_BT_LE_ISO_CIS + DEFAULT_BT_LE_ISO_BIS + \
|
||||
UC_BR_EDR_MAX_ACL_CONN + UC_BR_EDR_CTRL_MAX_SYNC_CONN, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.version_num = 0, \
|
||||
.bluetooth_mode = BTDM_CONTROLLER_MODE_EFF, \
|
||||
.magic = BTDM_CONFIG_MAGIC_VALUE, \
|
||||
}, \
|
||||
}
|
||||
|
||||
#elif CONFIG_BTDM_CTRL_MODE_BLE_ONLY
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \
|
||||
.ble = { \
|
||||
.config_version = BLE_CONFIG_VERSION, \
|
||||
.ble_ll_resolv_list_size = CONFIG_BT_LE_LL_RESOLV_LIST_SIZE, \
|
||||
.ble_hci_evt_hi_buf_count = DEFAULT_BT_LE_HCI_EVT_HI_BUF_COUNT, \
|
||||
.ble_hci_evt_lo_buf_count = DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT, \
|
||||
.ble_ll_sync_list_cnt = DEFAULT_BT_LE_MAX_PERIODIC_ADVERTISER_LIST, \
|
||||
.ble_ll_sync_cnt = DEFAULT_BT_LE_MAX_PERIODIC_SYNCS, \
|
||||
.ble_ll_rsp_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
|
||||
.ble_ll_adv_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
|
||||
.ble_ll_tx_pwr_dbm = 0, \
|
||||
.rtc_freq = 32000, \
|
||||
.ble_ll_sca = CONFIG_BT_LE_LL_SCA, \
|
||||
.ble_ll_scan_phy_number = BLE_LL_SCAN_PHY_NUMBER_N, \
|
||||
.ble_ll_conn_def_auth_pyld_tmo = BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N, \
|
||||
.ble_ll_jitter_usecs = BLE_LL_JITTER_USECS_N, \
|
||||
.ble_ll_sched_max_adv_pdu_usecs = BLE_LL_SCHED_MAX_ADV_PDU_USECS_N, \
|
||||
.ble_ll_sched_direct_adv_max_usecs = BLE_LL_SCHED_DIRECT_ADV_MAX_USECS_N, \
|
||||
.ble_ll_sched_adv_max_usecs = BLE_LL_SCHED_ADV_MAX_USECS_N, \
|
||||
.ble_scan_rsp_data_max_len = DEFAULT_BT_LE_SCAN_RSP_DATA_MAX_LEN_N, \
|
||||
.ble_ll_cfg_num_hci_cmd_pkts = BLE_LL_CFG_NUM_HCI_CMD_PKTS_N, \
|
||||
.ble_ll_ctrl_proc_timeout_ms = BLE_LL_CTRL_PROC_TIMEOUT_MS_N, \
|
||||
.nimble_max_connections = DEFAULT_BT_LE_MAX_CONNECTIONS, \
|
||||
.ble_whitelist_size = DEFAULT_BT_NIMBLE_WHITELIST_SIZE, \
|
||||
.ble_acl_buf_size = DEFAULT_BT_LE_ACL_BUF_SIZE, \
|
||||
.ble_acl_buf_count = DEFAULT_BT_LE_ACL_BUF_COUNT, \
|
||||
.ble_hci_evt_buf_size = DEFAULT_BT_LE_HCI_EVT_BUF_SIZE, \
|
||||
.ble_multi_adv_instances = DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, \
|
||||
.ble_ext_adv_max_size = DEFAULT_BT_LE_EXT_ADV_MAX_SIZE, \
|
||||
.controller_task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.controller_task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.controller_run_cpu = 0, \
|
||||
.enable_qa_test = RUN_QA_TEST, \
|
||||
.enable_bqb_test = RUN_BQB_TEST, \
|
||||
.enable_tx_cca = DEFAULT_BT_LE_TX_CCA_ENABLED, \
|
||||
.cca_rssi_thresh = 256 - DEFAULT_BT_LE_CCA_RSSI_THRESH, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
|
||||
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
|
||||
.ble_scan_classify_filter_enable = 1, \
|
||||
.main_xtal_freq = CONFIG_XTAL_FREQ, \
|
||||
.ignore_wl_for_direct_adv = 0, \
|
||||
.enable_pcl = 0, \
|
||||
.csa2_select = 1, \
|
||||
.enable_csr = 0, \
|
||||
.backoff_rssi = -100, \
|
||||
.iso_enabled = DEFAULT_BT_LE_ISO_ENABLED, \
|
||||
.iso_bqb_test = false, \
|
||||
.iso_fra_unseg = DEFAULT_BT_LE_ISO_FRA_UNSEG, \
|
||||
.iso_nsfc_en = DEFAULT_BT_LE_ISO_NSFC_EN, \
|
||||
.iso_nsfc_num = DEFAULT_BT_LE_ISO_NSFC_NUM, \
|
||||
.iso_buf_count = DEFAULT_BT_LE_ISO_BUF_COUNT, \
|
||||
.iso_buf_size = DEFAULT_BT_LE_ISO_BUF_SIZE, \
|
||||
.iso_big_count = DEFAULT_BT_LE_ISO_BIG, \
|
||||
.iso_bis_count = DEFAULT_BT_LE_ISO_BIS, \
|
||||
.iso_bis_per_big = DEFAULT_BT_LE_ISO_BIS_PER_BIG, \
|
||||
.iso_cig_count = DEFAULT_BT_LE_ISO_CIG, \
|
||||
.iso_cis_count = DEFAULT_BT_LE_ISO_CIS, \
|
||||
.iso_cis_per_cig = DEFAULT_BT_LE_ISO_CIS_PER_CIG, \
|
||||
.config_magic = BLE_CONFIG_MAGIC, \
|
||||
}, \
|
||||
.bredr = { 0 }, \
|
||||
.btdm = { \
|
||||
.version = BTDM_CONFIG_VERSION, \
|
||||
.task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.task_run_cpu = CONFIG_BT_CTRL_PINNED_TO_CORE, \
|
||||
.hci_cmd_num = CONFIG_BT_CTRL_HCI_CMD_NUM, \
|
||||
.hci_conn_num = DEFAULT_BT_LE_MAX_CONNECTIONS + DEFAULT_BT_LE_ISO_CIS + DEFAULT_BT_LE_ISO_BIS, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.version_num = 0, \
|
||||
.bluetooth_mode = BTDM_CONTROLLER_MODE_EFF, \
|
||||
.magic = BTDM_CONFIG_MAGIC_VALUE, \
|
||||
}, \
|
||||
}
|
||||
#elif CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \
|
||||
.ble = { 0 }, \
|
||||
.bredr = { \
|
||||
.bredr_version = ESP_BREDR_CTRL_CONFIG_VERSION, \
|
||||
.sleep_mode = 0, \
|
||||
.bt_test_mode_en = UC_BR_EDR_TEST_MODE_EN, \
|
||||
.acl_cca_en = UC_BR_EDR_TX_CCA_EN, \
|
||||
.cca_rssi_thr = -UC_BR_EDR_CCA_RSSI_THRESH, \
|
||||
.max_acl_conn = UC_BR_EDR_MAX_ACL_CONN, \
|
||||
.max_sync_conn = UC_BR_EDR_CTRL_MAX_SYNC_CONN, \
|
||||
.cpb_tx_link_num = UC_BR_EDR_CPB_TX_LINK_NB, \
|
||||
.cpb_rx_link_num = UC_BR_EDR_CPB_RX_LINK_NB, \
|
||||
.bt_sco_datapath = UC_BR_EDR_SCO_DATA_PATH, \
|
||||
.hci_tl_type = 0, \
|
||||
.hci_tl_funcs = NULL, \
|
||||
.cfg_mask = 0, \
|
||||
.hw_target_code = 0, \
|
||||
.acl_min_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_ACL_MIN, \
|
||||
.acl_max_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_ACL_MAX, \
|
||||
.apb_tx_pwr = UC_BR_EDR_TX_PWR_APB, \
|
||||
.page_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_PAGE, \
|
||||
.pscan_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_PSCAN, \
|
||||
.iscan_tx_pwr = CONFIG_BT_CTRL_BR_EDR_TX_PWR_ISCAN, \
|
||||
.cpb_tx_pwr = UC_BR_EDR_TX_PWR_CPB, \
|
||||
.strain_tx_pwr = UC_BR_EDR_TX_PWR_STRAIN, \
|
||||
.rf_hw_type = 0, \
|
||||
.static_aclu_tx_buf_nb = UC_BR_EDR_ACLU_TX_BUF_NB - UC_BR_EDR_DYNAMIC_ACLU_TX_BUF_NB, \
|
||||
.dynamic_aclu_tx_buf_nb = UC_BR_EDR_DYNAMIC_ACLU_TX_BUF_NB, \
|
||||
.aclu_rx_buf_nb = UC_BR_EDR_ACLU_RX_BUF_NB, \
|
||||
.sync_tx_buf_nb = UC_BR_EDR_SYNC_TX_BUF_NB, \
|
||||
.sync_rx_buf_nb = UC_BR_EDR_SYNC_RX_BUF_NB, \
|
||||
.esco_ev4_supp = UC_BR_EDR_ESCO_EV4_SUPP, \
|
||||
.esco_ev5_supp = UC_BR_EDR_ESCO_EV5_SUPP, \
|
||||
.esco_ev3_2_supp = UC_BR_EDR_ESCO_EV3_2_SUPP, \
|
||||
.esco_ev3_3_supp = UC_BR_EDR_ESCO_EV3_3_SUPP, \
|
||||
.esco_3_slots_supp = UC_BR_EDR_ESCO_3_SLOTS_SUPP, \
|
||||
.bt_legacy_auth_vs_evt = UC_BR_EDR_LEGACY_AUTH_VENDOR_EVT, \
|
||||
.inq_filter_en = 0, \
|
||||
.dtm_en = 0, \
|
||||
.bredr_magic = ESP_BREDR_CTRL_CONFIG_MAGIC_VAL, \
|
||||
}, \
|
||||
.btdm = { \
|
||||
.version = BTDM_CONFIG_VERSION, \
|
||||
.task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.task_run_cpu = CONFIG_BT_CTRL_PINNED_TO_CORE, \
|
||||
.hci_cmd_num = CONFIG_BT_CTRL_HCI_CMD_NUM, \
|
||||
.hci_conn_num = UC_BR_EDR_MAX_ACL_CONN + UC_BR_EDR_CTRL_MAX_SYNC_CONN, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.version_num = 0, \
|
||||
.bluetooth_mode = BTDM_CONTROLLER_MODE_EFF, \
|
||||
.magic = BTDM_CONFIG_MAGIC_VALUE, \
|
||||
}, \
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Set BLE TX power
|
||||
* Connection Tx power should only be set after connection created.
|
||||
* @param power_type : The type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @param power_level: Power level(index) corresponding to absolute value(dbm)
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_t power_level);
|
||||
|
||||
/**
|
||||
* @brief Get BLE TX power
|
||||
* Connection Tx power should only be get after connection created.
|
||||
* @param power_type : The type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @return >= 0 - Power level, < 0 - Invalid
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type);
|
||||
|
||||
/**
|
||||
* @brief ENHANCED API for Setting BLE TX power
|
||||
* Connection Tx power should only be set after connection created.
|
||||
* @param power_type : The enhanced type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @param handle : The handle of Advertising or Connection and the value 0 for other enhanced power types.
|
||||
* @param power_level: Power level(index) corresponding to absolute value(dbm)
|
||||
* @return ESP_OK - success, other - failed
|
||||
*/
|
||||
esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle, esp_power_level_t power_level);
|
||||
|
||||
/**
|
||||
* @brief ENHANCED API of Getting BLE TX power
|
||||
* Connection Tx power should only be get after connection created.
|
||||
* @param power_type : The enhanced type of which tx power, could set Advertising/Connection/Default and etc
|
||||
* @param handle : The handle of Advertising or Connection and the value 0 for other enhanced power types.
|
||||
* @return >= 0 - Power level, < 0 - Invalid
|
||||
*/
|
||||
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
|
||||
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() \
|
||||
{ \
|
||||
.ble = _BT_CTRL_LE_INIT_CONFIG_DEFAULT(), \
|
||||
.btdm = \
|
||||
{ \
|
||||
.version = BTDM_CONFIG_VERSION, \
|
||||
.task_stack_size = UC_BT_CTRL_TASK_STACK_SIZE, \
|
||||
.task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
|
||||
.task_run_cpu = CONFIG_BT_CTRL_PINNED_TO_CORE, \
|
||||
.hci_cmd_num = CONFIG_BT_CTRL_HCI_CMD_NUM, \
|
||||
.sleep_en = UC_BT_CTRL_SLEEP_ENABLE, \
|
||||
.version_num = 0, \
|
||||
.bluetooth_mode = BTDM_CONTROLLER_MODE_EFF, \
|
||||
.magic = BTDM_CONFIG_MAGIC_VALUE, \
|
||||
}, \
|
||||
}
|
||||
#endif // SOC_BT_CLASSIC_SUPPORTED
|
||||
|
||||
/**
|
||||
* @brief Initialize BT controller to allocate task and other resource.
|
||||
|
||||
@@ -4,474 +4,6 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// @brief HCI VS Commands for Espressif's Bluetooth Host
|
||||
//
|
||||
// @note The following vendor-specific HCI commands are exclusively for Espressif's Bluetooth Host (ESP-Bluedroid Host or ESP-NimBLE Host).
|
||||
// If you are using a non-ESP host or HCI UART, these commands will remain disabled unless the initialization function is explicitly called from the application.
|
||||
// Note, these init functions as well as these additional HCI VS commands are intended for Espressif's Bluetooth Host use only.
|
||||
// Application developers **should not** call the init functions in their applications.
|
||||
//
|
||||
|
||||
/**
|
||||
* @brief Config scanning duplicate exceptional list (OCF: 0x0108)
|
||||
*
|
||||
* @note The init function is `advFilter_stack_eanbleDupExcListCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_CONFIG_DUP_EXC_LIST_OCF (0x0108)
|
||||
/**
|
||||
* @brief Update exception list cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_update_exc_list {
|
||||
uint8_t subcode; /*!< Add, remove or clear exception list */
|
||||
uint32_t type; /*!< device type */
|
||||
uint8_t device_info[6]; /*!< device information */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable/disable advertising report flow control (OCF: 0x0109)
|
||||
*
|
||||
* @note The init function is `scan_stack_enableAdvFlowCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_ADV_REPORT_FLOW_CTRL_OCF (0x0109)
|
||||
/**
|
||||
* @brief Init ADV flow control cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_init_adv_flow_ctrl {
|
||||
uint8_t enable; /*!< Enable ADV flow control */
|
||||
uint16_t num; /*!< ADV buffer maximum value */
|
||||
uint16_t adv_lost_threshold; /*!< ADV lost event triggered threshold */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Update the number of advertising report in ADV flow control (OCF: 0x010A)
|
||||
*
|
||||
* @note The init function is `scan_stack_enableAdvFlowCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_UPD_ADV_REPORT_FLOW_CTRL_NUM_OCF (0x010a)
|
||||
/**
|
||||
* @brief Update ADV flow control cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_update_adv_flow_ctrl {
|
||||
uint16_t num; /*!< The number of ADV report processed */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Clear legacy advertising (same as HCI_LE_Clear_Advertising_Sets) (OCF: 0x010C)
|
||||
*
|
||||
* @note The init function is `adv_stack_enableClearLegacyAdvVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_CLR_LEGACY_ADV_OCF (0x010c)
|
||||
/**
|
||||
* @brief Clear legacy ADV cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_clr_legacy_adv {
|
||||
// no parameters
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set parameters of duplicate list (OCF: 0x010D)
|
||||
*
|
||||
* @note The init function is `advFilter_stack_eanbleDupExcListCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_DUP_LIST_PARAMS_OCF (0x010d)
|
||||
/**
|
||||
* @brief Set duplicate list cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_dup_params {
|
||||
uint8_t dup_mode; /*!< Duplicate mode */
|
||||
uint8_t dup_ad_type; /*!< Duplicate data type */
|
||||
uint16_t ring_list_max_num; /*!< Duplicate list size */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable/disable duplicate and exception list (OCF: 0x010E)
|
||||
*
|
||||
* @note The init function is `advFilter_stack_eanbleDupExcListCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_ENABLE_DUP_EXC_LIST_OCF (0x010e)
|
||||
/**
|
||||
* @brief Enable duplicate and exception list cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_enable_dup_exc {
|
||||
uint8_t enable; /*!< Enable or disable */
|
||||
uint8_t ring_list_reset; /*!< Reset list */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable optimization of multiple connections (OCF: 0x010F)
|
||||
*
|
||||
* @note The init function is `arr_stack_enableMultiConnVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_ENABLE_ARRANGEMENT_OCF (0x010f)
|
||||
/**
|
||||
* @brief Multiple connections optimization cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_enable_arrangement {
|
||||
uint32_t common_factor; /*!< The greatest common factor of connection interval */
|
||||
uint8_t enable; /*!< Enable or disable */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set scheduling length for a certain role (OCF: 0x0110)
|
||||
*
|
||||
* @note The init function is `arr_stack_enableMultiConnVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_SCHED_ROLE_LEN_OCF (0x0110)
|
||||
/**
|
||||
* @brief Scheduling length cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_sched_role_len {
|
||||
uint8_t role; /*!< BLE role; 0: central; 1: peripheral */
|
||||
uint32_t len; /*!< Length is us */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set RSSI threshold for automatic power control (OCF: 0x0111)
|
||||
*
|
||||
* @note The init function is `pcl_stack_enableSetRssiThreshVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_PCL_RSSI_THRESH_OCF (0x0111)
|
||||
/**
|
||||
* @brief PCL RSSI threshold cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_pcl_rssi_thresh {
|
||||
uint16_t conn_handle; /*!< Connection handle */
|
||||
uint8_t rssi_thresh_min_1M; /*!< Lower limit for 1M */
|
||||
uint8_t rssi_thresh_max_1M; /*!< Upper limit for 1M */
|
||||
uint8_t rssi_thresh_min_2M; /*!< Lower limit for 2M */
|
||||
uint8_t rssi_thresh_max_2M; /*!< Upper limit for 2M */
|
||||
uint8_t rssi_thresh_min_s2coded; /*!< Lower limit for s2 coded */
|
||||
uint8_t rssi_thresh_max_s2coded; /*!< Upper limit for s2 coded */
|
||||
uint8_t rssi_thresh_min_s8coded; /*!< Lower limit for s8 coded */
|
||||
uint8_t rssi_thresh_max_s8coded; /*!< Upper limit for s8 coded */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enable/disable channel selection algorithm #2 (OCF: 0x0112)
|
||||
*
|
||||
* @note The init function is `chanSel_stack_enableSetCsaVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_ENABLE_CSA2_OCF (0x0112)
|
||||
/**
|
||||
* @brief Enable/disable channel selection algorithm #2 cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_csa_enable {
|
||||
uint8_t csa2_select; /*!< Select CSA2 */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set parameters of controller logs (OCF: 0x0114)
|
||||
*
|
||||
* @note The init function is `log_stack_enableLogsRelatedVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_LOG_PARAMS_OCF (0x0114)
|
||||
/**
|
||||
* @brief Controller logs cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_log_params {
|
||||
uint8_t type; /*!< Operation type */
|
||||
uint32_t output_enable; /*!< Enable/disable output */
|
||||
uint8_t buffer_optoin /*!< Select log buffers */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set BLE vendor events mask (OCF: 0x0116)
|
||||
*
|
||||
* @note The init function is `hci_stack_enableSetVsEvtMaskVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_LE_VENDOR_EVTS_MASK_OCF (0x0116)
|
||||
/**
|
||||
* @brief Set BLE vendor events mask cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_vs_evts_mask {
|
||||
uint32_t evt_masks; /*!< BLE vendor events Mask */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set peer sleep clock accuracy to a constant value (OCF: 0x0118)
|
||||
*
|
||||
* @note The init function is `winWiden_stack_enableSetConstPeerScaVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_CONST_PEER_SCA_OCF (0x0118)
|
||||
/**
|
||||
* @brief Peer constant SCA cmd parameters
|
||||
*/
|
||||
struct bt_hci_vs_ble_set_const_peer_sca {
|
||||
uint16_t peer_sca; /*!< Peer SCA */
|
||||
};
|
||||
|
||||
// @brief HCI VS Events for Espressif's Bluetooth Host
|
||||
//
|
||||
// @note The following HCI VS events are exclusively for Espressif's Bluetooth Host (ESP-Bluedroid Host or ESP-NimBLE Host).
|
||||
// If you are using a non-ESP host or HCI UART, these events will remain disabled unless the initialization function is explicitly called from the application.
|
||||
// Note, these init functions as well as these additional HCI VS events are intended for Espressif's Bluetooth Host use only.
|
||||
// Application developers **should not** call the init functions in their applications.
|
||||
//
|
||||
|
||||
/**
|
||||
* @brief BLE Scan/Connect Request, Aux Connect Response received event (EVTCODE: 0xFF, SUBCODE: 0xC0)
|
||||
*
|
||||
* @note The init function is `adv_stack_enableScanReqRxdVsEvent(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_CONN_SCAN_REQ_RXED_EVT_SUBCODE (0xC0)
|
||||
/**
|
||||
* @brief BLE Scan/Connect Request, Aux Connect Response received event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_conn_scan_req_rxed_evt {
|
||||
uint8_t evt_type; /*!< Event type; 0: SCAN_REQ; 1: CONN_IND */
|
||||
uint8_t handle; /*!< Advertisement handle */
|
||||
uint8_t peer_addr_type; /*!< Peer address type */
|
||||
uint8_t peer_addr[6]; /*!< Peer address */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BLE Channel Map Update Completion event (EVTCODE: 0xFF, SUBCODE: 0xC1)
|
||||
*
|
||||
* @note The init function is `conn_stack_enableChanMapUpdCompVsEvent(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_CHAN_UPDATE_COMP_EVT_SUBCODE (0xC1)
|
||||
/**
|
||||
* @brief BLE Channel Map Update Completion event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_chan_update_comp_evt {
|
||||
uint8_t status; /*!< Controller error code */
|
||||
uint16_t handle; /*!< Connection handle */
|
||||
uint8_t ch_map[5]; /*!< Updated channel map */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BLE Wakeup From Sleep event (EVTCODE: 0xFF, SUBCODE: 0xC3)
|
||||
*
|
||||
* @note The init function is `sleep_stack_enableWakeupVsEvent(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_SLEEP_WAKEUP_EVT_SUBCODE (0xC3)
|
||||
/**
|
||||
* @brief BLE wakeup event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_sleep_wakeup_evt {
|
||||
// no parameters
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief BLE advertising report lost event for flow control (EVTCODE: 0x3E, SUBCODE: 0xF0)
|
||||
*
|
||||
* @note The init function is `scan_stack_enableAdvFlowCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LE_ADV_LOST_EVT_SUBCODE (0xF0)
|
||||
/**
|
||||
* @brief ADV lost event parameters
|
||||
*/
|
||||
struct bt_hci_vs_le_adv_lost_evt {
|
||||
uint32_t nb_lost; /*!< The number of ADV report discarded */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief This event indicates legacy authentication is completed by remote device (EVTCODE: 0xFF, SUBCODE: 0x03)
|
||||
*
|
||||
* @note The init function is `bt_stack_enableSecCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LEGACY_REM_AUTH_EVT_SUBCODE (0x03)
|
||||
/**
|
||||
* @brief legacy remote auth event parameters
|
||||
*/
|
||||
struct bt_hci_vs_legacy_rem_auth_evt {
|
||||
uint16_t conhdl; /*!< connection handle */
|
||||
};
|
||||
|
||||
//
|
||||
// @brief HCI VS Commands for Espressif's Internal-Use Debugging
|
||||
//
|
||||
// @note The following HCI VS debugging commands are implemented in Bluetooth controller pre-compiled libraries.
|
||||
// These commands are not linked into the application binary, unless the function `esp_ble_internalTestFeaturesEnable(true)`is called from the application.
|
||||
// They are intended for Espressif's internal use only. Application developers **should not** call `esp_ble_internalTestFeaturesEnable(true)` in their applications.
|
||||
//
|
||||
|
||||
#define ESP_BT_VS_CFG_TEST_RELATED_OCF (0x0113)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_SUBCMD (0X00)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_ADV_DELAY_SUBCMD (0X01)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_PREF_CODED_SUBCMD (0X02)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_DEFAULT_PRIV_MODE_SUBCMD (0X03)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCAN_FOREVER_SUBCMD (0X04)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_EXPECTED_PEER_SUBCMD (0X05)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_ADV_TXED_CNT_SUBCMD (0X06)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_SCAN_RXED_CNT_SUBCMD (0X07)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_TXPWR_LVL_SUBCMD (0X08)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXPWR_LVL_SUBCMD (0X09)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_TXPWR_LVL_ENH_SUBCMD (0X0a)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXPWR_LVL_ENH_SUBCMD (0X0b)
|
||||
#define ESP_BT_VS_CFG_TEST_IGNORE_WL_FOR_DIR_ADV_SUBCMD (0X0c)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_ADV_RXED_RSSI_SUBCMD (0X0d)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_CCA_SUBCMD (0X0e)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_CCA_WIN_SUBCMD (0X0f)
|
||||
#define ESP_BT_VS_CFG_TEST_READ_CCA_DATA_SUBCM (0X10)
|
||||
#define ESP_BT_VS_CFG_TEST_CLEAR_RAND_ADDR_SUBCMD (0X11)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_MAX_TXPWR_SUBCMD (0X12)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXPWR_RANGE_SUBCMD (0X13)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCAN_AA_SUBCMD (0X14)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_ADV_AA_SUBCMD (0X15)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCAN_CHAN_SUBCMD (0X16)
|
||||
#define ESP_BT_VS_CFG_TEST_SKIP_LIGHT_SLEEP_CHECK_SUBCMD (0X17)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_WAKEUP_OVERHEAD_SUBCMD (0X18)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_ADV_MIN_ITVL_SUBCMD (0X19)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_CTRL_STATUS_SUBCMD (0X1a)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_CONN_PHY_TXPWR_SUBCMD (0X1b)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_CONN_PHY_TXPWR_SUBCMD (0X1c)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_RXBUF_EMPTY_CNT_SUBCMD (0X1d)
|
||||
#define ESP_BT_VS_CFG_TEST_RESTART_SUBCMD (0X1e)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_RECODE_RX_STATE_SUBCMD (0X1f)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_RECODE_CNT_SUBCMD (0X20)
|
||||
#define ESP_BT_VS_CFG_TEST_CLR_RECODE_CNT_SUBCMD (0X21)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_CTRL_COMPILE_VER_SUBCMD (0X24)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_AUX_ADV_OFFSET_SUBCMD (0X25)
|
||||
#define ESP_BT_VS_CFG_TEST_INIT_FLEXIBLE_MODE_SUBCMD (0X26)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_FLEXIBLE_MODE_SUBCMD (0X27)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_FLEXIBLE_CONN_ERR_SUBCMD (0X28)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_FLEXIBLE_ADV_ERR_SUBCMD (0X29)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_FLEXIBLE_SCAN_ERR_SUBCMD (0X2a)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_TXED_CRCERR_SUBCMD (0X2c)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_BACKOFF_UPLIMIT_SUBCMD (0X2d)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_RXED_ADV_ADI_SUBCMD (0X2f)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCH_RAND_MODE_SUBCMD (0X30)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_RX_SENS_THRESH_SUBCMD (0X31)
|
||||
#define ESP_BT_VS_CFG_TEST_CHECK_MSYS_BUF_SUBCMD (0X32)
|
||||
#define ESP_BT_VS_CFG_TEST_UPDATE_BLE_TIMER_SUBCMD (0X33)
|
||||
#define ESP_BT_VS_CFG_TEST_UPDATE_BLE_RTC_SUBCMD (0X34)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_LOCKED_MEM_NUM_SUBCMD (0X35)
|
||||
#define ESP_BT_VS_CFG_TEST_ALLOW_MEM_ALLOC_SUBCMD (0X36)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_SCH_RAND_INFO_PTR_SUBCMD (0X37)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_DIAG_IO_SUBCMD (0X38)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_AGC_MAX_GAIN_SUBCMD (0X39)
|
||||
#define ESP_BT_VS_CFG_TEST_ENABLE_CHAN_ASSESS_SUBCMD (0X40)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_BACKOFF_UPLIMIT_SUBCMD (0X41)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_CONN_TOP_PRIO_RESV_THRESH_SUBCMD (0X42)
|
||||
#define ESP_BT_VS_CFG_TEST_SET_TEST_EVT_MSK_SUBCMD (0X43)
|
||||
#define ESP_BT_VS_CFG_TEST_GET_WAKEUP_TIMEOUT_SUBCMD (0X45)
|
||||
#define ESP_BT_VS_CFG_TEST_RELATED_SUBCMD_MAX (0Xff)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enablePktCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_WR_DM1_ENABLE_OCF (0x0181)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableClkCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_CLK_UPDATE_OCF (0x0183)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_AFH_OCF (0x0187)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableBasicVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_EVT_MASK_OCF (0x0188)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_AFH_REPORTING_MODE_OCF (0x0189)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_MASK_RMT_CHANNEL_CLASSIFICATION_OCF (0x018a)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableDTMVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_DTM_TX_TEST_START_OCF (0x018c)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableDTMVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_DTM_RX_TEST_START_OCF (0x018d)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableDTMVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_DTM_TX_TEST_END_OCF (0x018e)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableDTMVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_DTM_RX_TEST_END_OCF (0x018f)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_PCA_OCF (0x0190)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_DISCARD_PING_OCF (0x0191)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LMP_DBG_ENABLE_OCF (0x019a)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SEND_LMP_OCF (0x019b)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LMP_DBG_SAVE_OCF (0x019c)
|
||||
|
||||
//
|
||||
// @brief HCI VS Events for Espressif's Internal-Use Debugging
|
||||
//
|
||||
// @note The following HCI VS debugging events are implemented in Bluetooth controller pre-compiled libraries.
|
||||
// These events are not linked into the application binary, unless the function `esp_ble_internalTestFeaturesEnable(true)`is called from the application.
|
||||
// Application developers **should not** call `esp_ble_internalTestFeaturesEnable(true)` in their applications.
|
||||
//
|
||||
|
||||
#define ESP_BT_VS_LE_RUNNING_STATUS_EVT_SUBCODE (0xC3)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_AFH_CHG_EVT_SUBCODE (0x05)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_CH_CLASSIFICATION_EVT_SUBCODE (0x06)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_CH_CLASSIFICATION_REPORTING_MODE_EVT_SUBCODE (0x07)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LMP_RECEIVED_EVT_SUBCODE (0x0a)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LMP_TX_CFM_EVT_SUBCODE (0x0b)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LMP_DBG_ENTERED_EVT_SUBCODE (0x0c)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include "../../common/btdm_le_vs.h"
|
||||
|
||||
Reference in New Issue
Block a user