Merge branch 'feat/add_ble_core_6x_feature_for_bluedroid_v6.1' into 'release/v6.1'

Feat/add ble core 6x feature for bluedroid (6.1)

See merge request espressif/esp-idf!50054
This commit is contained in:
Jiang Jiang Jian
2026-06-30 14:21:41 +08:00
20 changed files with 3204 additions and 4 deletions
@@ -990,7 +990,33 @@ typedef void (tBTM_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_CMPL_CBACK) (tBTM_STATUS st
#define BTM_BLE_5_GAP_READ_MONITOR_ADV_LIST_SIZE_COMPLETE_EVT 74
#define BTM_BLE_5_GAP_ENABLE_MONITOR_ADV_COMPLETE_EVT 75
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
#define BTM_BLE_5_GAP_UNKNOWN_EVT 76
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#define BTM_BLE_5_GAP_READ_ALL_LOCAL_SUPP_FEAT_COMPLETE_EVT 76
#define BTM_BLE_5_GAP_READ_ALL_REMOTE_FEAT_COMPLETE_EVT 77
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#define BTM_BLE_5_GAP_FRAME_SPACE_UPDATE_COMPLETE_EVT 78
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#if (BLE_FEAT_DBAF == TRUE)
#define BTM_BLE_5_GAP_SET_DECISION_DATA_COMPLETE_EVT 79
#define BTM_BLE_5_GAP_SET_DECISION_INSTRUCTIONS_COMPLETE_EVT 80
#endif // #if (BLE_FEAT_DBAF == TRUE)
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
#define BTM_BLE_5_GAP_CONNECTION_RATE_REQUEST_COMPLETE_EVT 81
#define BTM_BLE_5_GAP_CONN_RATE_CHANGE_EVT 82
#define BTM_BLE_5_GAP_SET_DEFAULT_RATE_PARAMETERS_COMPLETE_EVT 86
#define BTM_BLE_5_GAP_READ_MIN_SUPP_CONN_INTERVAL_COMPLETE_EVT 87
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
#if (BLE_FEAT_LE_UTP == TRUE)
#define BTM_BLE_5_GAP_ENABLE_UTP_OTA_MODE_COMPLETE_EVT 83
#define BTM_BLE_5_GAP_UTP_SEND_COMPLETE_EVT 84
#define BTM_BLE_5_GAP_UTP_RECEIVE_EVT 85
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
#if (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
#define BTM_BLE_GAP_CS_SET_SECURITY_REQUIREMENTS_CMPL_EVT 88
#define BTM_BLE_GAP_CS_SET_DEFAULT_SECURITY_REQUIREMENTS_CMPL_EVT 89
#endif // (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
#define BTM_BLE_5_GAP_UNKNOWN_EVT 90
typedef UINT8 tBTM_BLE_5_GAP_EVENT;
#if (BLE_FEAT_ISO_EN == TRUE)
@@ -1240,6 +1266,76 @@ typedef struct {
} tBTM_BLE_MONITOR_ADV_LIST_SIZE;
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#ifndef BLE_LL_EXT_FEAT_DATA_LEN
#define BLE_LL_EXT_FEAT_DATA_LEN 248
#endif
typedef struct {
tBTM_STATUS status;
UINT8 max_page;
UINT8 *le_features;
} tBTM_BLE_READ_ALL_LOCAL_SUPP_FEAT;
typedef struct {
tBTM_STATUS status;
UINT16 conn_handle;
UINT8 max_remote_page;
UINT8 max_valid_page;
UINT8 *le_features;
} tBTM_BLE_READ_ALL_REMOTE_FEAT;
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
typedef struct {
tBTM_STATUS status;
UINT16 conn_handle;
UINT8 initiator;
UINT16 frame_space;
UINT8 phys;
UINT16 spacing_types;
} tBTM_BLE_FRAME_SPACE_UPDATE;
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
typedef struct {
tBTM_STATUS status;
UINT16 conn_handle;
} tBTM_BLE_CONNECTION_RATE_REQUEST_CMPL;
typedef struct {
tBTM_STATUS status;
UINT16 conn_handle;
UINT16 conn_interval;
UINT16 subrate_factor;
UINT16 peripheral_latency;
UINT16 continuation_number;
UINT16 supervision_timeout;
} tBTM_BLE_CONN_RATE_CHANGE;
#define BTM_BLE_MAX_CONN_INTERVAL_GROUPS 41
typedef struct {
UINT16 min_125us;
UINT16 max_125us;
UINT16 stride_125us;
} tBTM_BLE_MIN_CONN_INTERVAL_GROUP;
typedef struct {
tBTM_STATUS status;
UINT8 min_supported_conn_interval;
UINT8 num_groups;
tBTM_BLE_MIN_CONN_INTERVAL_GROUP *groups;
} tBTM_BLE_READ_MIN_SUPP_CONN_INTERVAL;
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
#if (BLE_FEAT_LE_UTP == TRUE)
typedef struct {
UINT8 len;
UINT8 *data;
} tBTM_BLE_UTP_RECEIVE;
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
typedef struct {
UINT16 sync_handle;
UINT8 tx_power;
@@ -1463,6 +1559,17 @@ typedef struct {
UINT16 conn_handle;
} tBTM_BLE_CS_SEC_ENABLE_CMPL_EVT;
#if (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
typedef struct {
UINT8 status;
UINT16 conn_handle;
} tBTM_BLE_CS_SET_SECURITY_REQUIREMENTS_CMPL_EVT;
typedef struct {
UINT8 status;
} tBTM_BLE_CS_SET_DEFAULT_SECURITY_REQUIREMENTS_CMPL_EVT;
#endif // (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
typedef struct {
UINT8 status;
UINT16 conn_handle;
@@ -1949,6 +2056,25 @@ typedef union {
tBTM_BLE_MONITOR_ADV_REPORT monitor_adv_report;
tBTM_BLE_MONITOR_ADV_LIST_SIZE monitor_adv_list_size;
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
tBTM_BLE_READ_ALL_LOCAL_SUPP_FEAT read_all_local_supp_feat;
tBTM_BLE_READ_ALL_REMOTE_FEAT read_all_remote_feat;
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
tBTM_BLE_FRAME_SPACE_UPDATE frame_space_update;
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
tBTM_BLE_CONNECTION_RATE_REQUEST_CMPL conn_rate_request;
tBTM_BLE_CONN_RATE_CHANGE conn_rate_change;
tBTM_BLE_READ_MIN_SUPP_CONN_INTERVAL read_min_supp_conn_interval;
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
#if (BLE_FEAT_LE_UTP == TRUE)
tBTM_BLE_UTP_RECEIVE utp_receive;
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
#if (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
tBTM_BLE_CS_SET_SECURITY_REQUIREMENTS_CMPL_EVT cs_set_security_requirements;
tBTM_BLE_CS_SET_DEFAULT_SECURITY_REQUIREMENTS_CMPL_EVT cs_set_default_security_requirements;
#endif // (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
} tBTM_BLE_5_GAP_CB_PARAMS;
typedef struct {
@@ -3109,6 +3235,41 @@ tBTM_STATUS BTM_BleClearMonitorAdvList(void);
tBTM_STATUS BTM_BleReadMonitorAdvListSize(void);
tBTM_STATUS BTM_BleEnableMonitorAdv(UINT8 enable);
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
#if (BLE_FEAT_DBAF == TRUE)
tBTM_STATUS BTM_BleSetDecisionData(UINT8 adv_handle, UINT8 decision_type_flags,
UINT8 data_len, const UINT8 *p_data);
tBTM_STATUS BTM_BleSetDecisionInstructions(UINT8 num_tests, const UINT8 *test_flags,
const UINT8 *test_fields, const UINT8 *test_params);
#endif // #if (BLE_FEAT_DBAF == TRUE)
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
tBTM_STATUS BTM_BleFrameSpaceUpdate(UINT16 conn_handle, UINT16 frame_space_min,
UINT16 frame_space_max, UINT8 phys, UINT16 spacing_types);
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
tBTM_STATUS BTM_BleReadAllLocalSuppFeatures(void);
tBTM_STATUS BTM_BleReadAllRemoteFeatures(UINT16 conn_handle, UINT8 page_requested);
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
tBTM_STATUS BTM_BleConnectionRateRequest(UINT16 conn_handle, UINT16 conn_interval_min,
UINT16 conn_interval_max, UINT16 subrate_min,
UINT16 subrate_max, UINT16 max_latency,
UINT16 continuation_number, UINT16 supervision_timeout,
UINT16 min_ce_len, UINT16 max_ce_len);
void BTM_BleSetDefaultRateParameters(UINT16 conn_interval_min, UINT16 conn_interval_max,
UINT16 subrate_min, UINT16 subrate_max, UINT16 max_latency,
UINT16 continuation_number, UINT16 supervision_timeout,
UINT16 min_ce_len, UINT16 max_ce_len);
tBTM_STATUS BTM_BleReadMinSuppConnInterval(void);
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
#if (BLE_FEAT_LE_UTP == TRUE)
tBTM_STATUS BTM_BleEnableUtpOtaMode(UINT8 enable);
tBTM_STATUS BTM_BleUtpSend(UINT8 data_len, const UINT8 *p_data);
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_50_DTM_TEST_EN == TRUE)
@@ -3254,5 +3415,9 @@ void BTM_BleGapCsSetProcPatams(UINT16 conn_handle, UINT8 config_id, UINT16 max_p
UINT8 SNR_control_initiator, UINT8 SNR_control_reflector);
void BTM_BleGapCsProcEnable(UINT16 conn_handle, UINT8 config_id, UINT8 enable);
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
#if (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
void BTM_BleGapCsSetSecurityRequirements(UINT16 conn_handle, UINT64 cs_security_requirements);
void BTM_BleGapCsSetDefaultSecurityRequirements(UINT64 cs_security_requirements);
#endif // (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
#endif
@@ -439,6 +439,10 @@
#define HCI_BLE_ENABLE_MONITOR_ADV (0x009C | HCI_GRP_BLE_CMDS)
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#define HCI_BLE_FRAME_SPACE_UPDATE (0x009D | HCI_GRP_BLE_CMDS)
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
#define HCI_BLE_ENH_READ_TRANS_POWER_LEVEL (0x0076 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_READ_REMOTE_TRANS_POWER_LEVEL (0x0077 | HCI_GRP_BLE_CMDS)
@@ -464,6 +468,16 @@
#define HCI_BLE_SET_PERIOD_ADV_PARAMS_V2 (0x0086 | HCI_GRP_BLE_CMDS)
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#define HCI_BLE_READ_ALL_LOCAL_SUPP_FEATURES (0x0087 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_READ_ALL_REMOTE_FEATURES (0x0088 | HCI_GRP_BLE_CMDS)
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#if (BLE_FEAT_DBAF == TRUE)
#define HCI_BLE_SET_DECISION_DATA (0x0080 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_SET_DECISION_INSTRUCTIONS (0x0081 | HCI_GRP_BLE_CMDS)
#endif // #if (BLE_FEAT_DBAF == TRUE)
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
#define HCI_BLE_CS_READ_LOCAL_SUPP_CAPS (0x0089 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_CS_READ_REMOTE_SUPP_CAPS (0x008A | HCI_GRP_BLE_CMDS)
@@ -479,6 +493,22 @@
#define HCI_BLE_CS_SET_PROCEDURE_ENABLE (0x0094 | HCI_GRP_BLE_CMDS)
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
#if (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
#define HCI_BLE_CS_SET_SECURITY_REQUIREMENTS (0x00A7 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_CS_SET_DEFAULT_SECURITY_REQUIREMENTS (0x00A8 | HCI_GRP_BLE_CMDS)
#endif // (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
#if (BLE_FEAT_LE_UTP == TRUE)
#define HCI_BLE_ENABLE_UTP_OTA_MODE (0x009F | HCI_GRP_BLE_CMDS)
#define HCI_BLE_UTP_SEND (0x00A0 | HCI_GRP_BLE_CMDS)
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
#define HCI_BLE_CONNECTION_RATE_REQUEST (0x00A1 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_SET_DEFAULT_RATE_PARAMETERS (0x00A2 | HCI_GRP_BLE_CMDS)
#define HCI_BLE_READ_MIN_SUPP_CONN_INTERVAL (0x00A3 | HCI_GRP_BLE_CMDS)
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
// Vendor OGF define
#define HCI_VENDOR_OGF 0x3F
@@ -970,10 +1000,26 @@
#define HCI_BLE_PA_RESPONSE_REPORT_EVT 0x28
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#define HCI_BLE_READ_ALL_REMOTE_FEAT_COMPLETE_EVT 0x2B
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#if (BLE_FEAT_ADV_MONITOR == TRUE)
#define HCI_BLE_MONITOR_ADV_REPORT_EVT 0x34
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#define HCI_BLE_FRAME_SPACE_UPDATE_COMPLETE_EVT 0x35
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#if (BLE_FEAT_LE_UTP == TRUE)
#define HCI_BLE_UTP_RECEIVE_EVT 0x36
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
#define HCI_BLE_CONN_RATE_CHANGE_EVT 0x37
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
#define HCI_BLE_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT 0x2C
#define HCI_BLE_CS_READ_REMOTE_FAE_TAB_CMPL_EVT 0x2D
@@ -825,6 +825,66 @@ BOOLEAN btsnd_hcic_ble_read_monitor_adv_list_size(void);
UINT8 btsnd_hcic_ble_enable_monitor_adv(UINT8 enable);
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
#if (BLE_FEAT_DBAF == TRUE)
#define HCIC_PARAM_SIZE_SET_DECISION_DATA_HDR 3
#define HCIC_PARAM_SIZE_SET_DECISION_DATA_MAX 251
#define HCIC_PARAM_SIZE_SET_DECISION_INSTRUCTIONS_HDR 1
#define HCIC_PARAM_SIZE_SET_DECISION_INSTRUCTIONS_MAX 251
#define BLE_DECISION_DATA_MAX_LEN 248
#define BLE_DECISION_MAX_TESTS 8
#define BLE_DECISION_TEST_PARAM_LEN 16
#define BLE_DECISION_TEST_PARAMS_MAX_LEN (BLE_DECISION_MAX_TESTS * BLE_DECISION_TEST_PARAM_LEN)
#define HCIC_PARAM_SIZE_SET_DECISION_INSTRUCTIONS(n) (HCIC_PARAM_SIZE_SET_DECISION_INSTRUCTIONS_HDR + (n) * 18)
UINT8 btsnd_hcic_ble_set_decision_data(UINT8 adv_handle, UINT8 decision_type_flags,
UINT8 data_len, const UINT8 *p_data);
UINT8 btsnd_hcic_ble_set_decision_instructions(UINT8 num_tests, const UINT8 *test_flags,
const UINT8 *test_fields, const UINT8 *test_params);
#endif // #if (BLE_FEAT_DBAF == TRUE)
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#define HCIC_PARAM_SIZE_FRAME_SPACE_UPDATE 9
UINT8 btsnd_hcic_ble_frame_space_update(UINT16 conn_handle, UINT16 frame_space_min,
UINT16 frame_space_max, UINT8 phys, UINT16 spacing_types);
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#define HCIC_PARAM_SIZE_READ_ALL_REMOTE_FEATURES 3
#define BLE_LL_EXT_FEAT_DATA_LEN 248
#define BLE_LL_EXT_FEAT_MAX_PAGE 10
BOOLEAN btsnd_hcic_ble_read_all_local_supp_features(void);
UINT8 btsnd_hcic_ble_read_all_remote_features(UINT16 conn_handle, UINT8 page_requested);
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
#if (BLE_FEAT_LE_UTP == TRUE)
#define HCIC_PARAM_SIZE_ENABLE_UTP_OTA_MODE 1
#define HCIC_PARAM_SIZE_UTP_SEND_HDR 1
#define HCIC_PARAM_SIZE_UTP_SEND_MAX 255
#define BLE_UTP_DATA_MAX_LEN 254
UINT8 btsnd_hcic_ble_enable_utp_ota_mode(UINT8 enable);
UINT8 btsnd_hcic_ble_utp_send(UINT8 data_len, const UINT8 *p_data);
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
#define HCIC_PARAM_SIZE_CONNECTION_RATE_REQUEST 20
#define HCIC_PARAM_SIZE_SET_DEFAULT_RATE_PARAMETERS 18
UINT8 btsnd_hcic_ble_connection_rate_request(UINT16 conn_handle, UINT16 conn_interval_min,
UINT16 conn_interval_max, UINT16 subrate_min,
UINT16 subrate_max, UINT16 max_latency,
UINT16 continuation_number, UINT16 supervision_timeout,
UINT16 min_ce_len, UINT16 max_ce_len);
UINT8 btsnd_hcic_ble_set_default_rate_parameters(UINT16 conn_interval_min, UINT16 conn_interval_max,
UINT16 subrate_min, UINT16 subrate_max,
UINT16 max_latency, UINT16 continuation_number,
UINT16 supervision_timeout, UINT16 min_ce_len,
UINT16 max_ce_len);
BOOLEAN btsnd_hcic_ble_read_min_supp_conn_interval(void);
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
/* ULP HCI command */
BOOLEAN btsnd_hcic_ble_set_evt_mask (BT_EVENT_MASK event_mask);
@@ -1355,4 +1415,12 @@ UINT8 btsnd_hcic_ble_cs_set_procedure_params(UINT16 conn_handle, UINT8 config_id
UINT8 btsnd_hcic_ble_cs_procedure_enable(UINT16 conn_handle, UINT8 config_id, UINT8 enable);
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
#if (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
#define HCIC_PARAM_SIZE_CS_SET_SECURITY_REQUIREMENTS_LEN 10
#define HCIC_PARAM_SIZE_CS_SET_DEFAULT_SECURITY_REQUIREMENTS_LEN 8
UINT8 btsnd_hcic_ble_cs_set_security_requirements(UINT16 conn_handle, UINT64 cs_security_requirements);
UINT8 btsnd_hcic_ble_cs_set_default_security_requirements(UINT64 cs_security_requirements);
#endif // (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
#endif