mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
Merge branch 'feat/add_ble_core_6x_feature_for_bluedroid' into 'master'
Feat/add ble core 6x feature for bluedroid See merge request espressif/esp-idf!49409
This commit is contained in:
@@ -17,6 +17,15 @@ tBTM_BLE_EXTENDED_CB extend_adv_cb;
|
||||
|
||||
tBTM_BLE_5_HCI_CBACK ble_5_hci_cb;
|
||||
|
||||
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
static UINT8 btm_ble_local_supp_le_features[BLE_LL_EXT_FEAT_DATA_LEN];
|
||||
static UINT8 btm_ble_remote_supp_le_features[BLE_LL_EXT_FEAT_DATA_LEN];
|
||||
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
static tBTM_BLE_MIN_CONN_INTERVAL_GROUP btm_ble_min_conn_interval_groups[BTM_BLE_MAX_CONN_INTERVAL_GROUPS];
|
||||
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
|
||||
#define INVALID_VALUE_8BIT 0XFF
|
||||
#define INVALID_VALUE_16BIT 0XFFFF
|
||||
#define INVALID_VALUE_32BIT 0XFFFFFFFF
|
||||
@@ -1411,6 +1420,352 @@ 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)
|
||||
{
|
||||
tHCI_STATUS err;
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if ((err = btsnd_hcic_ble_set_decision_data(adv_handle, decision_type_flags, data_len, p_data)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("LE SetDecisionData: cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.status = status;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_SET_DECISION_DATA_COMPLETE_EVT, &cb_params);
|
||||
return status;
|
||||
}
|
||||
|
||||
tBTM_STATUS BTM_BleSetDecisionInstructions(UINT8 num_tests, const UINT8 *test_flags,
|
||||
const UINT8 *test_fields, const UINT8 *test_params)
|
||||
{
|
||||
tHCI_STATUS err;
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if ((err = btsnd_hcic_ble_set_decision_instructions(num_tests, test_flags, test_fields,
|
||||
test_params)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("LE SetDecisionInstructions: cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.status = status;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_SET_DECISION_INSTRUCTIONS_COMPLETE_EVT, &cb_params);
|
||||
return status;
|
||||
}
|
||||
#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)
|
||||
{
|
||||
tHCI_STATUS err;
|
||||
|
||||
err = btsnd_hcic_ble_frame_space_update(conn_handle, frame_space_min, frame_space_max,
|
||||
phys, spacing_types);
|
||||
if (err != HCI_SUCCESS) {
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
cb_params.frame_space_update.status = BTM_HCI_ERROR | err;
|
||||
cb_params.frame_space_update.conn_handle = conn_handle;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_FRAME_SPACE_UPDATE_COMPLETE_EVT, &cb_params);
|
||||
return BTM_NO_RESOURCES;
|
||||
}
|
||||
return BTM_CMD_STARTED;
|
||||
}
|
||||
|
||||
void btm_frame_space_update_cmd_status(UINT8 status, UINT16 conn_handle)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if (status == HCI_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
cb_params.frame_space_update.status = status | BTM_HCI_ERROR;
|
||||
cb_params.frame_space_update.conn_handle = conn_handle;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_FRAME_SPACE_UPDATE_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void btm_ble_frame_space_update_complete_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
STREAM_TO_UINT8(cb_params.frame_space_update.status, p);
|
||||
STREAM_TO_UINT16(cb_params.frame_space_update.conn_handle, p);
|
||||
STREAM_TO_UINT8(cb_params.frame_space_update.initiator, p);
|
||||
STREAM_TO_UINT16(cb_params.frame_space_update.frame_space, p);
|
||||
STREAM_TO_UINT8(cb_params.frame_space_update.phys, p);
|
||||
STREAM_TO_UINT16(cb_params.frame_space_update.spacing_types, p);
|
||||
|
||||
if (cb_params.frame_space_update.status != HCI_SUCCESS) {
|
||||
cb_params.frame_space_update.status |= BTM_HCI_ERROR;
|
||||
}
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_FRAME_SPACE_UPDATE_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
|
||||
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
tBTM_STATUS BTM_BleReadAllLocalSuppFeatures(void)
|
||||
{
|
||||
if (!btsnd_hcic_ble_read_all_local_supp_features()) {
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
cb_params.read_all_local_supp_feat.status = BTM_HCI_ERROR | HCI_ERR_MEMORY_FULL;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_READ_ALL_LOCAL_SUPP_FEAT_COMPLETE_EVT, &cb_params);
|
||||
return BTM_NO_RESOURCES;
|
||||
}
|
||||
return BTM_CMD_STARTED;
|
||||
}
|
||||
|
||||
void btm_ble_read_all_local_supp_features_complete(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
STREAM_TO_UINT8(cb_params.read_all_local_supp_feat.status, p);
|
||||
if (cb_params.read_all_local_supp_feat.status == HCI_SUCCESS) {
|
||||
STREAM_TO_UINT8(cb_params.read_all_local_supp_feat.max_page, p);
|
||||
cb_params.read_all_local_supp_feat.le_features = btm_ble_local_supp_le_features;
|
||||
STREAM_TO_ARRAY(btm_ble_local_supp_le_features, p, BLE_LL_EXT_FEAT_DATA_LEN);
|
||||
} else {
|
||||
cb_params.read_all_local_supp_feat.status |= BTM_HCI_ERROR;
|
||||
}
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_READ_ALL_LOCAL_SUPP_FEAT_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
|
||||
tBTM_STATUS BTM_BleReadAllRemoteFeatures(UINT16 conn_handle, UINT8 page_requested)
|
||||
{
|
||||
tHCI_STATUS err;
|
||||
|
||||
err = btsnd_hcic_ble_read_all_remote_features(conn_handle, page_requested);
|
||||
if (err != HCI_SUCCESS) {
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
cb_params.read_all_remote_feat.status = BTM_HCI_ERROR | err;
|
||||
cb_params.read_all_remote_feat.conn_handle = conn_handle;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_READ_ALL_REMOTE_FEAT_COMPLETE_EVT, &cb_params);
|
||||
return BTM_NO_RESOURCES;
|
||||
}
|
||||
return BTM_CMD_STARTED;
|
||||
}
|
||||
|
||||
void btm_read_all_remote_feat_cmd_status(UINT8 status)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if (status == HCI_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
cb_params.read_all_remote_feat.status = status | BTM_HCI_ERROR;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_READ_ALL_REMOTE_FEAT_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void btm_ble_read_all_remote_features_complete_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
STREAM_TO_UINT8(cb_params.read_all_remote_feat.status, p);
|
||||
STREAM_TO_UINT16(cb_params.read_all_remote_feat.conn_handle, p);
|
||||
if (cb_params.read_all_remote_feat.status == HCI_SUCCESS) {
|
||||
STREAM_TO_UINT8(cb_params.read_all_remote_feat.max_remote_page, p);
|
||||
STREAM_TO_UINT8(cb_params.read_all_remote_feat.max_valid_page, p);
|
||||
cb_params.read_all_remote_feat.le_features = btm_ble_remote_supp_le_features;
|
||||
STREAM_TO_ARRAY(btm_ble_remote_supp_le_features, p, BLE_LL_EXT_FEAT_DATA_LEN);
|
||||
} else {
|
||||
cb_params.read_all_remote_feat.status |= BTM_HCI_ERROR;
|
||||
}
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_READ_ALL_REMOTE_FEAT_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
#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)
|
||||
{
|
||||
tHCI_STATUS err;
|
||||
|
||||
err = btsnd_hcic_ble_connection_rate_request(conn_handle, conn_interval_min, conn_interval_max,
|
||||
subrate_min, subrate_max, max_latency,
|
||||
continuation_number, supervision_timeout,
|
||||
min_ce_len, max_ce_len);
|
||||
if (err != HCI_SUCCESS) {
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
cb_params.conn_rate_request.status = BTM_HCI_ERROR | err;
|
||||
cb_params.conn_rate_request.conn_handle = conn_handle;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_CONNECTION_RATE_REQUEST_COMPLETE_EVT, &cb_params);
|
||||
return BTM_NO_RESOURCES;
|
||||
}
|
||||
return BTM_CMD_STARTED;
|
||||
}
|
||||
|
||||
void btm_conn_rate_req_cmd_status(UINT8 status, UINT16 conn_handle)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if (status != HCI_SUCCESS) {
|
||||
status = (status | BTM_HCI_ERROR);
|
||||
}
|
||||
cb_params.conn_rate_request.status = status;
|
||||
cb_params.conn_rate_request.conn_handle = conn_handle;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_CONNECTION_RATE_REQUEST_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void btm_ble_conn_rate_change_evt(tBTM_BLE_CONN_RATE_CHANGE *params)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if (!params) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Like btm_ble_subrate_change_evt(), notify the application only.
|
||||
* Do not fold interval*subrate into L2CAP current_used_conn_interval:
|
||||
* that field is UINT16 in 1.25 ms units and cannot represent SCI
|
||||
* effective intervals; apps use ESP_GAP_BLE_CONN_RATE_CHANGE_EVT and
|
||||
* ESP_BLE_GAP_CONN_RATE_EFF_INTERVAL_US() instead. */
|
||||
cb_params.conn_rate_change = *params;
|
||||
if (cb_params.conn_rate_change.status != HCI_SUCCESS) {
|
||||
cb_params.conn_rate_change.status |= BTM_HCI_ERROR;
|
||||
}
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_CONN_RATE_CHANGE_EVT, &cb_params);
|
||||
}
|
||||
|
||||
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 status = BTM_SUCCESS;
|
||||
tHCI_STATUS err = HCI_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if ((err = btsnd_hcic_ble_set_default_rate_parameters(conn_interval_min, conn_interval_max,
|
||||
subrate_min, subrate_max, max_latency,
|
||||
continuation_number, supervision_timeout,
|
||||
min_ce_len, max_ce_len)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err=0x%x", __func__, err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.status = status;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_SET_DEFAULT_RATE_PARAMETERS_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
|
||||
tBTM_STATUS BTM_BleReadMinSuppConnInterval(void)
|
||||
{
|
||||
if (!btsnd_hcic_ble_read_min_supp_conn_interval()) {
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
cb_params.read_min_supp_conn_interval.status = BTM_HCI_ERROR | HCI_ERR_MEMORY_FULL;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_READ_MIN_SUPP_CONN_INTERVAL_COMPLETE_EVT, &cb_params);
|
||||
return BTM_NO_RESOURCES;
|
||||
}
|
||||
return BTM_CMD_STARTED;
|
||||
}
|
||||
|
||||
void btm_ble_read_min_supp_conn_interval_cmd_status(UINT8 status)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if (status == HCI_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
cb_params.read_min_supp_conn_interval.status = status | BTM_HCI_ERROR;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_READ_MIN_SUPP_CONN_INTERVAL_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void btm_ble_read_min_supp_conn_interval_complete(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
UINT8 num_groups;
|
||||
|
||||
if (!p) {
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(cb_params.read_min_supp_conn_interval.status, p);
|
||||
if (cb_params.read_min_supp_conn_interval.status == HCI_SUCCESS) {
|
||||
STREAM_TO_UINT8(cb_params.read_min_supp_conn_interval.min_supported_conn_interval, p);
|
||||
STREAM_TO_UINT8(num_groups, p);
|
||||
if (num_groups > BTM_BLE_MAX_CONN_INTERVAL_GROUPS) {
|
||||
BTM_TRACE_WARNING("%s num_groups %u exceeds max %u", __func__, num_groups,
|
||||
BTM_BLE_MAX_CONN_INTERVAL_GROUPS);
|
||||
num_groups = BTM_BLE_MAX_CONN_INTERVAL_GROUPS;
|
||||
}
|
||||
cb_params.read_min_supp_conn_interval.num_groups = num_groups;
|
||||
cb_params.read_min_supp_conn_interval.groups = btm_ble_min_conn_interval_groups;
|
||||
for (UINT8 i = 0; i < num_groups; i++) {
|
||||
STREAM_TO_UINT16(btm_ble_min_conn_interval_groups[i].min_125us, p);
|
||||
STREAM_TO_UINT16(btm_ble_min_conn_interval_groups[i].max_125us, p);
|
||||
STREAM_TO_UINT16(btm_ble_min_conn_interval_groups[i].stride_125us, p);
|
||||
}
|
||||
} else {
|
||||
cb_params.read_min_supp_conn_interval.status |= BTM_HCI_ERROR;
|
||||
}
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_READ_MIN_SUPP_CONN_INTERVAL_COMPLETE_EVT, &cb_params);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
|
||||
#if (BLE_FEAT_LE_UTP == TRUE)
|
||||
tBTM_STATUS BTM_BleEnableUtpOtaMode(UINT8 enable)
|
||||
{
|
||||
tHCI_STATUS err;
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if ((err = btsnd_hcic_ble_enable_utp_ota_mode(enable)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("LE EnableUtpOtaMode: cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.status = status;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_ENABLE_UTP_OTA_MODE_COMPLETE_EVT, &cb_params);
|
||||
return status;
|
||||
}
|
||||
|
||||
tBTM_STATUS BTM_BleUtpSend(UINT8 data_len, const UINT8 *p_data)
|
||||
{
|
||||
tHCI_STATUS err;
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if ((err = btsnd_hcic_ble_utp_send(data_len, p_data)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("LE UtpSend: cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.status = status;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_UTP_SEND_COMPLETE_EVT, &cb_params);
|
||||
return status;
|
||||
}
|
||||
|
||||
void btm_ble_utp_receive_evt(UINT8 *p, UINT16 len)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
UINT8 data_len;
|
||||
|
||||
if (!p || len < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(data_len, p);
|
||||
if (data_len == 0 || len < (UINT16)(1 + data_len)) {
|
||||
return;
|
||||
}
|
||||
|
||||
cb_params.utp_receive.len = data_len;
|
||||
cb_params.utp_receive.data = p;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_5_GAP_UTP_RECEIVE_EVT, &cb_params);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
void btm_ble_scan_req_received_evt(tBTM_BLE_SCAN_REQ_RECEIVED *params)
|
||||
{
|
||||
@@ -2247,3 +2602,39 @@ void btm_ble_cs_subevt_continue_result_evt(tBTM_BLE_CS_SUBEVT_RESULT_CONTINUE_EV
|
||||
}
|
||||
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
|
||||
/* Host does not validate conn_handle range or CS_Security_Requirements reserved bits; Controller checks. */
|
||||
void BTM_BleGapCsSetSecurityRequirements(UINT16 conn_handle, UINT64 cs_security_requirements)
|
||||
{
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
tHCI_STATUS err = HCI_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if ((err = btsnd_hcic_ble_cs_set_security_requirements(conn_handle, cs_security_requirements)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("cs set security requirements, cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.cs_set_security_requirements.status = status;
|
||||
cb_params.cs_set_security_requirements.conn_handle = conn_handle;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_SET_SECURITY_REQUIREMENTS_CMPL_EVT, &cb_params);
|
||||
}
|
||||
|
||||
/* Host does not validate CS_Security_Requirements reserved bits; Controller checks. */
|
||||
void BTM_BleGapCsSetDefaultSecurityRequirements(UINT64 cs_security_requirements)
|
||||
{
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
tHCI_STATUS err = HCI_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
if ((err = btsnd_hcic_ble_cs_set_default_security_requirements(cs_security_requirements)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("cs set default security requirements, cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.cs_set_default_security_requirements.status = status;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_SET_DEFAULT_SECURITY_REQUIREMENTS_CMPL_EVT, &cb_params);
|
||||
}
|
||||
|
||||
#endif // (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
|
||||
|
||||
@@ -599,6 +599,20 @@ void btm_ble_transmit_power_report_evt(tBTM_BLE_TRANS_POWER_REPORT_EVT *params);
|
||||
#if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
void btm_ble_subrate_change_evt(tBTM_BLE_SUBRATE_CHANGE_EVT *params);
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
void btm_ble_frame_space_update_complete_evt(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
void btm_ble_read_all_local_supp_features_complete(UINT8 *p);
|
||||
void btm_ble_read_all_remote_features_complete_evt(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
void btm_ble_conn_rate_change_evt(tBTM_BLE_CONN_RATE_CHANGE *params);
|
||||
void btm_ble_read_min_supp_conn_interval_complete(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
#if (BLE_FEAT_LE_UTP == TRUE)
|
||||
void btm_ble_utp_receive_evt(UINT8 *p, UINT16 len);
|
||||
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
void btm_ble_pa_subevt_data_req_evt(tBTM_BLE_PA_SUBEVT_DATA_REQ_EVT *params);
|
||||
void btm_ble_pa_rsp_rpt_evt(tBTM_BLE_PA_RSP_REPORT_EVT *params);
|
||||
|
||||
@@ -1201,6 +1201,19 @@ void btm_read_remote_trans_pwr_level_cmpl(UINT8 status);
|
||||
void btm_subrate_req_cmd_status(UINT8 status);
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
|
||||
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
void btm_frame_space_update_cmd_status(UINT8 status, UINT16 conn_handle);
|
||||
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
|
||||
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
void btm_read_all_remote_feat_cmd_status(UINT8 status);
|
||||
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
void btm_conn_rate_req_cmd_status(UINT8 status, UINT16 conn_handle);
|
||||
void btm_ble_read_min_supp_conn_interval_cmd_status(UINT8 status);
|
||||
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
void btm_ble_cs_read_local_supp_caps_cmpl_evt(UINT8 *p);
|
||||
void btm_ble_cs_read_remote_supp_caps_cmd_status(UINT8 status);
|
||||
|
||||
@@ -174,6 +174,18 @@ static void btu_ble_ext_adv_report_evt(UINT8 *p, UINT16 evt_len);
|
||||
#if (BLE_FEAT_ADV_MONITOR == TRUE)
|
||||
static void btu_ble_monitor_adv_report_evt(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
|
||||
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
static void btu_ble_read_all_remote_feat_complete_evt(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
static void btu_ble_frame_space_update_complete_evt(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
#if (BLE_FEAT_LE_UTP == TRUE)
|
||||
static void btu_ble_utp_receive_evt(UINT8 *p, UINT16 evt_len);
|
||||
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
|
||||
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
static void btu_ble_conn_rate_change_evt(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
static void btu_ble_periodic_adv_sync_establish_evt(UINT8 *p, bool v2_evt);
|
||||
static void btu_ble_periodic_adv_report_evt(UINT8 *p, UINT8 evt_len, bool v2_evt);
|
||||
@@ -560,6 +572,16 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
btu_ble_monitor_adv_report_evt(p);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
|
||||
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
case HCI_BLE_READ_ALL_REMOTE_FEAT_COMPLETE_EVT:
|
||||
btu_ble_read_all_remote_feat_complete_evt(p);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
case HCI_BLE_FRAME_SPACE_UPDATE_COMPLETE_EVT:
|
||||
btu_ble_frame_space_update_complete_evt(p);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||
case HCI_BLE_PERIOD_ADV_SYNC_TRANS_RECV_EVT:
|
||||
btu_ble_periodic_adv_sync_trans_recv(p);
|
||||
@@ -629,6 +651,16 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
btu_ble_subrate_change_evt(p);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
#if (BLE_FEAT_LE_UTP == TRUE)
|
||||
case HCI_BLE_UTP_RECEIVE_EVT:
|
||||
btu_ble_utp_receive_evt(p, hci_evt_len);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
|
||||
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
case HCI_BLE_CONN_RATE_CHANGE_EVT:
|
||||
btu_ble_conn_rate_change_evt(p);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
case HCI_BLE_PA_SUBEVT_DATA_REQUEST_EVT:
|
||||
btu_ble_pa_subevt_data_request_evt(p);
|
||||
@@ -1483,6 +1515,16 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
btm_ble_read_monitor_adv_list_size_complete(p);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
|
||||
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
case HCI_BLE_READ_ALL_LOCAL_SUPP_FEATURES:
|
||||
btm_ble_read_all_local_supp_features_complete(p);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
case HCI_BLE_READ_MIN_SUPP_CONN_INTERVAL:
|
||||
btm_ble_read_min_supp_conn_interval_complete(p);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
#endif /* (BLE_INCLUDED == TRUE) */
|
||||
|
||||
default: {
|
||||
@@ -1652,6 +1694,38 @@ static void btu_hcif_hdl_command_status (UINT16 opcode, UINT8 status, UINT8 *p_c
|
||||
btm_subrate_req_cmd_status(status);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
case HCI_BLE_FRAME_SPACE_UPDATE:
|
||||
{
|
||||
UINT16 conn_handle = HCI_INVALID_HANDLE;
|
||||
if (p_cmd != NULL) {
|
||||
p_cmd++; /* skip param length */
|
||||
STREAM_TO_UINT16(conn_handle, p_cmd);
|
||||
}
|
||||
btm_frame_space_update_cmd_status(status, conn_handle);
|
||||
break;
|
||||
}
|
||||
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
case HCI_BLE_READ_ALL_REMOTE_FEATURES:
|
||||
btm_read_all_remote_feat_cmd_status(status);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
case HCI_BLE_CONNECTION_RATE_REQUEST:
|
||||
{
|
||||
UINT16 conn_handle = HCI_INVALID_HANDLE;
|
||||
if (p_cmd != NULL) {
|
||||
p_cmd++; /* skip param length */
|
||||
STREAM_TO_UINT16(conn_handle, p_cmd);
|
||||
}
|
||||
btm_conn_rate_req_cmd_status(status, conn_handle);
|
||||
break;
|
||||
}
|
||||
case HCI_BLE_READ_MIN_SUPP_CONN_INTERVAL:
|
||||
btm_ble_read_min_supp_conn_interval_cmd_status(status);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
case HCI_BLE_CS_READ_REMOTE_SUPP_CAPS:
|
||||
btm_ble_cs_read_remote_supp_caps_cmd_status(status);
|
||||
@@ -2661,6 +2735,20 @@ static void btu_ble_monitor_adv_report_evt(UINT8 *p)
|
||||
}
|
||||
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
|
||||
|
||||
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
static void btu_ble_read_all_remote_feat_complete_evt(UINT8 *p)
|
||||
{
|
||||
btm_ble_read_all_remote_features_complete_evt(p);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
static void btu_ble_frame_space_update_complete_evt(UINT8 *p)
|
||||
{
|
||||
btm_ble_frame_space_update_complete_evt(p);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
static void btu_ble_periodic_adv_sync_establish_evt(UINT8 *p, bool v2_evt)
|
||||
{
|
||||
@@ -3335,6 +3423,40 @@ static void btu_ble_subrate_change_evt(UINT8 *p)
|
||||
}
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
|
||||
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
static void btu_ble_conn_rate_change_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_CONN_RATE_CHANGE conn_rate_change = {0};
|
||||
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(conn_rate_change.status, p);
|
||||
STREAM_TO_UINT16(conn_rate_change.conn_handle, p);
|
||||
STREAM_TO_UINT16(conn_rate_change.conn_interval, p);
|
||||
STREAM_TO_UINT16(conn_rate_change.subrate_factor, p);
|
||||
STREAM_TO_UINT16(conn_rate_change.peripheral_latency, p);
|
||||
STREAM_TO_UINT16(conn_rate_change.continuation_number, p);
|
||||
STREAM_TO_UINT16(conn_rate_change.supervision_timeout, p);
|
||||
|
||||
btm_ble_conn_rate_change_evt(&conn_rate_change);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
|
||||
#if (BLE_FEAT_LE_UTP == TRUE)
|
||||
static void btu_ble_utp_receive_evt(UINT8 *p, UINT16 evt_len)
|
||||
{
|
||||
if (!p || evt_len < 1) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
btm_ble_utp_receive_evt(p, evt_len);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
static void btu_ble_pa_subevt_data_request_evt(UINT8 *p)
|
||||
{
|
||||
|
||||
@@ -3054,6 +3054,262 @@ UINT8 btsnd_hcic_ble_enable_monitor_adv(UINT8 enable)
|
||||
}
|
||||
#endif // #if (BLE_FEAT_ADV_MONITOR == TRUE)
|
||||
|
||||
#if (BLE_FEAT_DBAF == TRUE)
|
||||
UINT8 btsnd_hcic_ble_set_decision_data(UINT8 adv_handle, UINT8 decision_type_flags,
|
||||
UINT8 data_len, const UINT8 *p_data)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
UINT8 param_len;
|
||||
|
||||
if (data_len > BLE_DECISION_DATA_MAX_LEN) {
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
if (data_len > 0 && p_data == NULL) {
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
|
||||
param_len = HCIC_PARAM_SIZE_SET_DECISION_DATA_HDR + data_len;
|
||||
if (param_len > HCIC_PARAM_SIZE_SET_DECISION_DATA_MAX) {
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
|
||||
HCIC_BLE_CMD_CREATED_U8(p, pp, param_len);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_DECISION_DATA);
|
||||
UINT8_TO_STREAM(pp, param_len);
|
||||
UINT8_TO_STREAM(pp, adv_handle);
|
||||
UINT8_TO_STREAM(pp, decision_type_flags);
|
||||
UINT8_TO_STREAM(pp, data_len);
|
||||
if (data_len > 0) {
|
||||
ARRAY_TO_STREAM(pp, p_data, data_len);
|
||||
}
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_set_decision_instructions(UINT8 num_tests, const UINT8 *test_flags,
|
||||
const UINT8 *test_fields, const UINT8 *test_params)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
UINT8 param_len;
|
||||
|
||||
if (num_tests == 0 || num_tests > BLE_DECISION_MAX_TESTS) {
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
if (test_flags == NULL || test_fields == NULL || test_params == NULL) {
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
|
||||
param_len = HCIC_PARAM_SIZE_SET_DECISION_INSTRUCTIONS(num_tests);
|
||||
if (param_len > HCIC_PARAM_SIZE_SET_DECISION_INSTRUCTIONS_MAX) {
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
|
||||
HCIC_BLE_CMD_CREATED_U8(p, pp, param_len);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_DECISION_INSTRUCTIONS);
|
||||
UINT8_TO_STREAM(pp, param_len);
|
||||
UINT8_TO_STREAM(pp, num_tests);
|
||||
for (UINT8 i = 0; i < num_tests; i++) {
|
||||
UINT8_TO_STREAM(pp, test_flags[i]);
|
||||
UINT8_TO_STREAM(pp, test_fields[i]);
|
||||
ARRAY_TO_STREAM(pp, test_params + i * BLE_DECISION_TEST_PARAM_LEN,
|
||||
BLE_DECISION_TEST_PARAM_LEN);
|
||||
}
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_DBAF == TRUE)
|
||||
|
||||
#if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
UINT8 btsnd_hcic_ble_frame_space_update(UINT16 conn_handle, UINT16 frame_space_min,
|
||||
UINT16 frame_space_max, UINT8 phys, UINT16 spacing_types)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCIC_BLE_CMD_CREATED_U8(p, pp, HCIC_PARAM_SIZE_FRAME_SPACE_UPDATE);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_FRAME_SPACE_UPDATE);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_FRAME_SPACE_UPDATE);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT16_TO_STREAM(pp, frame_space_min);
|
||||
UINT16_TO_STREAM(pp, frame_space_max);
|
||||
UINT8_TO_STREAM(pp, phys);
|
||||
UINT16_TO_STREAM(pp, spacing_types);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return HCI_SUCCESS;
|
||||
}
|
||||
#endif // #if (BLE_FEAT_FRAME_SPACE_UPDATE == TRUE)
|
||||
|
||||
#if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
BOOLEAN btsnd_hcic_ble_read_all_local_supp_features(void)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
if ((p = HCI_GET_CMD_BUF(0)) == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
pp = (UINT8 *)(p + 1);
|
||||
p->len = HCIC_PREAMBLE_SIZE;
|
||||
p->offset = 0;
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_READ_ALL_LOCAL_SUPP_FEATURES);
|
||||
UINT8_TO_STREAM(pp, 0);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_read_all_remote_features(UINT16 conn_handle, UINT8 page_requested)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
if (page_requested > BLE_LL_EXT_FEAT_MAX_PAGE) {
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
|
||||
HCIC_BLE_CMD_CREATED_U8(p, pp, HCIC_PARAM_SIZE_READ_ALL_REMOTE_FEATURES);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_READ_ALL_REMOTE_FEATURES);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_READ_ALL_REMOTE_FEATURES);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, page_requested);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return HCI_SUCCESS;
|
||||
}
|
||||
#endif // #if (BLE_FEAT_LL_EXT_FEAT == TRUE)
|
||||
|
||||
#if (BLE_FEAT_LE_UTP == TRUE)
|
||||
UINT8 btsnd_hcic_ble_enable_utp_ota_mode(UINT8 enable)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
if (enable > 1) {
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
|
||||
HCIC_BLE_CMD_CREATED_U8(p, pp, HCIC_PARAM_SIZE_ENABLE_UTP_OTA_MODE);
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_ENABLE_UTP_OTA_MODE);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ENABLE_UTP_OTA_MODE);
|
||||
UINT8_TO_STREAM(pp, enable);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_utp_send(UINT8 data_len, const UINT8 *p_data)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
UINT16 param_len;
|
||||
|
||||
if (data_len == 0 || data_len > BLE_UTP_DATA_MAX_LEN || p_data == NULL) {
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
|
||||
param_len = HCIC_PARAM_SIZE_UTP_SEND_HDR + data_len;
|
||||
if (param_len > HCIC_PARAM_SIZE_UTP_SEND_MAX) {
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
|
||||
HCIC_BLE_CMD_CREATED_U8(p, pp, param_len);
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_UTP_SEND);
|
||||
UINT8_TO_STREAM(pp, param_len);
|
||||
UINT8_TO_STREAM(pp, data_len);
|
||||
ARRAY_TO_STREAM(pp, p_data, data_len);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_LE_UTP == TRUE)
|
||||
|
||||
#if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
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)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("hci conn rate req, handle %u int [%u, %u] subrate [%u, %u] latency %u cont %u timeout %u ce [%u, %u]",
|
||||
conn_handle, conn_interval_min, conn_interval_max, subrate_min, subrate_max,
|
||||
max_latency, continuation_number, supervision_timeout, min_ce_len, max_ce_len);
|
||||
|
||||
HCIC_BLE_CMD_CREATED_U8(p, pp, HCIC_PARAM_SIZE_CONNECTION_RATE_REQUEST);
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CONNECTION_RATE_REQUEST);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_CONNECTION_RATE_REQUEST);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT16_TO_STREAM(pp, conn_interval_min);
|
||||
UINT16_TO_STREAM(pp, conn_interval_max);
|
||||
UINT16_TO_STREAM(pp, subrate_min);
|
||||
UINT16_TO_STREAM(pp, subrate_max);
|
||||
UINT16_TO_STREAM(pp, max_latency);
|
||||
UINT16_TO_STREAM(pp, continuation_number);
|
||||
UINT16_TO_STREAM(pp, supervision_timeout);
|
||||
UINT16_TO_STREAM(pp, min_ce_len);
|
||||
UINT16_TO_STREAM(pp, max_ce_len);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return HCI_SUCCESS;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("hci set default rate, int [%u, %u] subrate [%u, %u] latency %u cont %u timeout %u ce [%u, %u]",
|
||||
conn_interval_min, conn_interval_max, subrate_min, subrate_max,
|
||||
max_latency, continuation_number, supervision_timeout, min_ce_len, max_ce_len);
|
||||
|
||||
HCIC_BLE_CMD_CREATED_U8(p, pp, HCIC_PARAM_SIZE_SET_DEFAULT_RATE_PARAMETERS);
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_DEFAULT_RATE_PARAMETERS);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_DEFAULT_RATE_PARAMETERS);
|
||||
UINT16_TO_STREAM(pp, conn_interval_min);
|
||||
UINT16_TO_STREAM(pp, conn_interval_max);
|
||||
UINT16_TO_STREAM(pp, subrate_min);
|
||||
UINT16_TO_STREAM(pp, subrate_max);
|
||||
UINT16_TO_STREAM(pp, max_latency);
|
||||
UINT16_TO_STREAM(pp, continuation_number);
|
||||
UINT16_TO_STREAM(pp, supervision_timeout);
|
||||
UINT16_TO_STREAM(pp, min_ce_len);
|
||||
UINT16_TO_STREAM(pp, max_ce_len);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_read_min_supp_conn_interval(void)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
if ((p = HCI_GET_CMD_BUF(0)) == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
pp = (UINT8 *)(p + 1);
|
||||
p->len = HCIC_PREAMBLE_SIZE;
|
||||
p->offset = 0;
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_READ_MIN_SUPP_CONN_INTERVAL);
|
||||
UINT8_TO_STREAM(pp, 0);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
}
|
||||
#endif // #if (BLE_FEAT_SHORTER_CONN_INTERVALS == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_subevt_data(UINT8 adv_handle, UINT8 num_subevents_with_data, ble_subevent_params *subevent_params)
|
||||
{
|
||||
@@ -3514,3 +3770,42 @@ UINT8 btsnd_hcic_ble_cs_procedure_enable(UINT16 conn_handle, UINT8 config_id, UI
|
||||
return TRUE;
|
||||
}
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
|
||||
UINT8 btsnd_hcic_ble_cs_set_security_requirements(UINT16 conn_handle, UINT64 cs_security_requirements)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs set security requirements conn_handle %d", conn_handle);
|
||||
|
||||
HCIC_BLE_CMD_CREATED_U8(p, pp, HCIC_PARAM_SIZE_CS_SET_SECURITY_REQUIREMENTS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_SET_SECURITY_REQUIREMENTS);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_CS_SET_SECURITY_REQUIREMENTS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
ARRAY_TO_STREAM(pp, (UINT8 *)&cs_security_requirements, 8);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_set_default_security_requirements(UINT64 cs_security_requirements)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs set default security requirements");
|
||||
|
||||
HCIC_BLE_CMD_CREATED_U8(p, pp, HCIC_PARAM_SIZE_CS_SET_DEFAULT_SECURITY_REQUIREMENTS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_SET_DEFAULT_SECURITY_REQUIREMENTS);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_CS_SET_DEFAULT_SECURITY_REQUIREMENTS_LEN);
|
||||
ARRAY_TO_STREAM(pp, (UINT8 *)&cs_security_requirements, 8);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
#endif // (BT_BLE_FEAT_CS_SECURITY_REQUIREMENTS == TRUE)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user