mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
Merge branch 'feat/support_bluedroid_host_pawr_v6.0' into 'release/v6.0'
feat(ble/bluedroid): Add bluedroid host PAwR and Advertising Coding Selection features (backport for v6.0) See merge request espressif/esp-idf!43398
This commit is contained in:
@@ -1874,6 +1874,7 @@ int bt_mesh_gattc_conn_create(const bt_mesh_addr_t *addr, uint16_t service_uuid)
|
||||
BTA_GATTC_Enh_Open(bt_mesh_gattc_if, bt_mesh_gattc_info[i].addr.val,
|
||||
bt_mesh_gattc_info[i].addr.type, true,
|
||||
BTA_GATT_TRANSPORT_LE, TRUE, BLE_ADDR_UNKNOWN_TYPE,
|
||||
false, 0xFF, 0xFF,
|
||||
BTA_BLE_PHY_1M_MASK, &conn_1m_param, NULL, NULL);
|
||||
#else /* CONFIG_BLE_MESH_USE_BLE_50 */
|
||||
/* Min_interval: 15ms
|
||||
@@ -1889,6 +1890,7 @@ int bt_mesh_gattc_conn_create(const bt_mesh_addr_t *addr, uint16_t service_uuid)
|
||||
BTA_GATTC_Enh_Open(bt_mesh_gattc_if, bt_mesh_gattc_info[i].addr.val,
|
||||
bt_mesh_gattc_info[i].addr.type, true,
|
||||
BTA_GATT_TRANSPORT_LE, FALSE, BLE_ADDR_UNKNOWN_TYPE,
|
||||
false, 0xFF, 0xFF,
|
||||
BTA_BLE_PHY_1M_MASK, &conn_1m_param, NULL, NULL);
|
||||
#endif /* CONFIG_BLE_MESH_USE_BLE_50 */
|
||||
|
||||
|
||||
@@ -358,6 +358,13 @@ config BT_GATTS_APPEARANCE_WRITABLE
|
||||
help
|
||||
Enabling this option allows remote GATT clients to write appearance
|
||||
|
||||
config BT_GATTS_SECURITY_LEVELS_CHAR
|
||||
bool "Enable LE GATT Security Levels Characteristic"
|
||||
depends on BT_GATTS_ENABLE
|
||||
default n
|
||||
help
|
||||
Enable LE GATT Security Levels Characteristic
|
||||
|
||||
menuconfig BT_GATTC_ENABLE
|
||||
bool "Include GATT client module(GATTC)"
|
||||
depends on BT_BLE_ENABLED
|
||||
@@ -1317,7 +1324,7 @@ config BT_BLE_RPA_TIMEOUT
|
||||
Default is 900 s (15 minutes). Range is 1 s to 1 hour (3600 s).
|
||||
|
||||
menuconfig BT_BLE_50_FEATURES_SUPPORTED
|
||||
bool "Enable BLE 5.0 features(please disable BLE 4.2 if enable BLE 5.0)"
|
||||
bool "Enable BLE 5.0 and above features(please disable BLE 4.2 if enable BLE 5.0)"
|
||||
depends on (BT_BLE_ENABLED && ((BT_CONTROLLER_ENABLED && SOC_BLE_50_SUPPORTED) || BT_CONTROLLER_DISABLED))
|
||||
default y
|
||||
help
|
||||
@@ -1381,37 +1388,6 @@ config BT_BLE_FEAT_CREATE_SYNC_ENH
|
||||
help
|
||||
Enable the create sync enhancements
|
||||
|
||||
menuconfig BT_BLE_42_FEATURES_SUPPORTED
|
||||
bool "Enable BLE 4.2 features(please disable BLE 5.0 if enable BLE 4.2)"
|
||||
depends on BT_BLE_ENABLED
|
||||
default y if IDF_TARGET_ESP32
|
||||
default n
|
||||
help
|
||||
This enables BLE 4.2 features.
|
||||
This option is universally supported by all ESP chips with BLE capabilities.
|
||||
BLE 4.2 and BLE 5.0 cannot be used simultaneously.
|
||||
|
||||
config BT_BLE_42_DTM_TEST_EN
|
||||
bool "Enable BLE 4.2 DTM test"
|
||||
depends on BT_BLE_42_FEATURES_SUPPORTED
|
||||
default y
|
||||
help
|
||||
This enables BLE 4.2 direct test mode
|
||||
|
||||
config BT_BLE_42_ADV_EN
|
||||
bool "Enable BLE 4.2 advertising"
|
||||
depends on BT_BLE_42_FEATURES_SUPPORTED
|
||||
default y
|
||||
help
|
||||
This enables BLE v4.2 advertising
|
||||
|
||||
config BT_BLE_42_SCAN_EN
|
||||
bool "Enable BLE 4.2 scan"
|
||||
depends on BT_BLE_42_FEATURES_SUPPORTED
|
||||
default y
|
||||
help
|
||||
This enables BLE v4.2 scan
|
||||
|
||||
menuconfig BT_BLE_FEAT_ISO_EN
|
||||
bool "Enable BLE 5.2 iso feature"
|
||||
depends on (BT_BLE_50_FEATURES_SUPPORTED && ((BT_CONTROLLER_ENABLED && SOC_BLE_AUDIO_SUPPORTED) || BT_CONTROLLER_DISABLED)) # NOERROR
|
||||
@@ -1524,6 +1500,58 @@ config BT_BLE_FEAT_CONN_SUBRATING
|
||||
help
|
||||
Enable BLE connection subrating feature
|
||||
|
||||
config BT_BLE_FEAT_PAWR_EN
|
||||
bool "Enable Periodic Advertisement with Response(PAwR)"
|
||||
depends on (BT_BLE_50_FEATURES_SUPPORTED && ((BT_CONTROLLER_ENABLED && SOC_BLE_PAWR_SUPPORTED) || BT_CONTROLLER_DISABLED)) # NOERROR
|
||||
default n
|
||||
help
|
||||
Enable BLE Periodic Advertisement with Response(PAwR) feature
|
||||
|
||||
config BT_BLE_FEAT_ADV_CODING_SELECTION
|
||||
bool "Enable Advertising Coding Selection"
|
||||
depends on (BT_BLE_50_FEATURES_SUPPORTED && ((BT_CONTROLLER_ENABLED && SOC_BLE_ADV_CODING_SELECT_SUPPORTED) || BT_CONTROLLER_DISABLED)) # NOERROR
|
||||
default n
|
||||
help
|
||||
Enable Advertising Coding Selection
|
||||
|
||||
config BT_BLE_FEAT_CHANNEL_SOUNDING
|
||||
bool "Enable BLE channel sounding"
|
||||
depends on (BT_BLE_50_FEATURES_SUPPORTED && ((BT_CONTROLLER_ENABLED && SOC_BLE_CHANNEL_SOUNDING_SUPPORTED) || BT_CONTROLLER_DISABLED)) # NOERROR
|
||||
default n
|
||||
help
|
||||
Enable BLE channel sounding
|
||||
|
||||
menuconfig BT_BLE_42_FEATURES_SUPPORTED
|
||||
bool "Enable BLE 4.2 features(please disable BLE 5.0 if enable BLE 4.2)"
|
||||
depends on BT_BLE_ENABLED
|
||||
default y if IDF_TARGET_ESP32
|
||||
default n
|
||||
help
|
||||
This enables BLE 4.2 features.
|
||||
This option is universally supported by all ESP chips with BLE capabilities.
|
||||
BLE 4.2 and BLE 5.0 cannot be used simultaneously.
|
||||
|
||||
config BT_BLE_42_DTM_TEST_EN
|
||||
bool "Enable BLE 4.2 DTM test"
|
||||
depends on BT_BLE_42_FEATURES_SUPPORTED
|
||||
default y
|
||||
help
|
||||
This enables BLE 4.2 direct test mode
|
||||
|
||||
config BT_BLE_42_ADV_EN
|
||||
bool "Enable BLE 4.2 advertising"
|
||||
depends on BT_BLE_42_FEATURES_SUPPORTED
|
||||
default y
|
||||
help
|
||||
This enables BLE v4.2 advertising
|
||||
|
||||
config BT_BLE_42_SCAN_EN
|
||||
bool "Enable BLE 4.2 scan"
|
||||
depends on BT_BLE_42_FEATURES_SUPPORTED
|
||||
default y
|
||||
help
|
||||
This enables BLE v4.2 scan
|
||||
|
||||
config BT_BLE_VENDOR_HCI_EN
|
||||
bool "Enable BLE Vendor HCI command and event"
|
||||
depends on BT_BLE_ENABLED
|
||||
|
||||
@@ -2027,3 +2027,437 @@ esp_err_t esp_ble_gap_set_host_feature(uint16_t bit_num, uint8_t bit_val)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
esp_err_t esp_ble_gap_set_periodic_adv_subevent_data(esp_ble_per_adv_subevent_data_params *subevent_data_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if ((!subevent_data_params) || (!subevent_data_params->subevent_params)) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
if ((subevent_data_params->num_subevents_with_data > 0x0F) || (!subevent_data_params->num_subevents_with_data)) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < subevent_data_params->num_subevents_with_data; i++)
|
||||
{
|
||||
if (subevent_data_params->subevent_params[i].subevent_data_len && (subevent_data_params->subevent_params[i].subevent_data == NULL)) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_SET_PA_SUBEVT_DATA;
|
||||
|
||||
arg.per_adv_subevent_data_params.adv_handle = subevent_data_params->adv_handle;
|
||||
arg.per_adv_subevent_data_params.num_subevents_with_data = subevent_data_params->num_subevents_with_data;
|
||||
arg.per_adv_subevent_data_params.subevent_params = subevent_data_params->subevent_params;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy, btc_gap_ble_arg_deep_free)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_set_periodic_adv_response_data(esp_ble_per_adv_response_data_params *rsp_data_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!rsp_data_params) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
if ((rsp_data_params->response_data == NULL) && rsp_data_params->response_data_len) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_SET_PA_RSP_DATA;
|
||||
|
||||
arg.per_adv_response_data_params.sync_handle = rsp_data_params->sync_handle;
|
||||
arg.per_adv_response_data_params.request_event = rsp_data_params->request_event;
|
||||
arg.per_adv_response_data_params.request_subevent = rsp_data_params->request_subevent;
|
||||
arg.per_adv_response_data_params.response_subevent = rsp_data_params->response_subevent;
|
||||
arg.per_adv_response_data_params.response_slot = rsp_data_params->response_slot;
|
||||
arg.per_adv_response_data_params.response_data_len = rsp_data_params->response_data_len;
|
||||
arg.per_adv_response_data_params.response_data = rsp_data_params->response_data;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy, btc_gap_ble_arg_deep_free)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_gap_set_periodic_sync_subevent(esp_ble_per_sync_subevent_params *sync_subevent_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!sync_subevent_params) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
if ((sync_subevent_params->subevent == NULL) && sync_subevent_params->num_subevents_to_sync) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_SET_PA_SYNC_SUBEVT;
|
||||
|
||||
arg.per_sync_subevent_params.sync_handle = sync_subevent_params->sync_handle;
|
||||
arg.per_sync_subevent_params.periodic_adv_properties = sync_subevent_params->periodic_adv_properties;
|
||||
arg.per_sync_subevent_params.num_subevents_to_sync = sync_subevent_params->num_subevents_to_sync;
|
||||
arg.per_sync_subevent_params.subevent = sync_subevent_params->subevent;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), btc_gap_ble_arg_deep_copy, btc_gap_ble_arg_deep_free)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
esp_err_t esp_ble_cs_read_local_supported_capabilities(void)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_READ_LOCAL_SUPPORTED_CAPS;
|
||||
|
||||
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_read_remote_supported_capabilities(uint16_t conn_handle)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_READ_REMOTE_SUPPORTED_CAPS;
|
||||
|
||||
arg.cs_read_remote_supp_caps.conn_handle = conn_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_write_cached_remote_supported_capabilities(esp_ble_cs_write_cached_remote_supp_caps_params *cached_remote_supp_caps_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg = {0};
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!cached_remote_supp_caps_params) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPS;
|
||||
|
||||
arg.cs_write_cached_remote_supp_caps.conn_handle = cached_remote_supp_caps_params->conn_handle;
|
||||
arg.cs_write_cached_remote_supp_caps.num_config_supported = cached_remote_supp_caps_params->num_config_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.max_consecutive_proc_supported = cached_remote_supp_caps_params->max_consecutive_proc_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.num_ant_supported = cached_remote_supp_caps_params->num_ant_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.max_ant_paths_supported = cached_remote_supp_caps_params->max_ant_paths_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.modes_supported = cached_remote_supp_caps_params->modes_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.rtt_capability = cached_remote_supp_caps_params->rtt_capability;
|
||||
arg.cs_write_cached_remote_supp_caps.rtt_aa_only_n = cached_remote_supp_caps_params->rtt_aa_only_n;
|
||||
arg.cs_write_cached_remote_supp_caps.rtt_sounding_n = cached_remote_supp_caps_params->rtt_sounding_n;
|
||||
arg.cs_write_cached_remote_supp_caps.rtt_random_payload_n = cached_remote_supp_caps_params->rtt_random_payload_n;
|
||||
arg.cs_write_cached_remote_supp_caps.NADM_sounding_capability = cached_remote_supp_caps_params->NADM_sounding_capability;
|
||||
arg.cs_write_cached_remote_supp_caps.NADM_random_capability = cached_remote_supp_caps_params->NADM_random_capability;
|
||||
arg.cs_write_cached_remote_supp_caps.subfeatures_supported = cached_remote_supp_caps_params->subfeatures_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.T_IP1_times_supported = cached_remote_supp_caps_params->T_IP1_times_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.T_IP2_times_supported = cached_remote_supp_caps_params->T_IP2_times_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.T_FCS_times_supported = cached_remote_supp_caps_params->T_FCS_times_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.T_PM_times_supported = cached_remote_supp_caps_params->T_PM_times_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.T_SW_times_supported = cached_remote_supp_caps_params->T_SW_times_supported;
|
||||
arg.cs_write_cached_remote_supp_caps.TX_SNR_capability = cached_remote_supp_caps_params->TX_SNR_capability;
|
||||
if (cached_remote_supp_caps_params->initiator_role_supported) {
|
||||
arg.cs_write_cached_remote_supp_caps.roles_supported |= ESP_BLE_CS_INITIATOR_ROLE_SUPPORTED;
|
||||
}
|
||||
if (cached_remote_supp_caps_params->reflector_role_supported) {
|
||||
arg.cs_write_cached_remote_supp_caps.roles_supported |= ESP_BLE_CS_REFLECTOR_ROLE_SUPPORTED;
|
||||
}
|
||||
if (cached_remote_supp_caps_params->cs_sync_2m_phy_supported) {
|
||||
arg.cs_write_cached_remote_supp_caps.cs_sync_phys_supported |= ESP_BLE_CS_SYNC_PHYS_2M_SUPPORTED;
|
||||
}
|
||||
if (cached_remote_supp_caps_params->cs_sync_2m_2bt_phy_supported) {
|
||||
arg.cs_write_cached_remote_supp_caps.cs_sync_phys_supported |= ESP_BLE_CS_SYNC_PHYS_2M_2BT_SUPPORTED;
|
||||
}
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_security_enable(uint16_t conn_handle)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_SECURITY_ENABLE;
|
||||
|
||||
arg.cs_security_enable.conn_handle = conn_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_set_default_settings(esp_ble_cs_set_default_settings_params *default_setting_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg = {0};
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!default_setting_params) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_SET_DEFAULT_SETTINGS;
|
||||
|
||||
arg.cs_set_default_settings_params.conn_handle = default_setting_params->conn_handle;
|
||||
arg.cs_set_default_settings_params.cs_sync_ant_selection = default_setting_params->cs_sync_ant_selection;
|
||||
arg.cs_set_default_settings_params.max_tx_power = default_setting_params->max_tx_power;
|
||||
if (default_setting_params->initiator_role_enable) {
|
||||
arg.cs_set_default_settings_params.role_enable |= ESP_BLE_CS_INITIATOR_ROLE_ENABLED;
|
||||
}
|
||||
if (default_setting_params->reflector_role_enable) {
|
||||
arg.cs_set_default_settings_params.role_enable |= ESP_BLE_CS_REFLECTOR_ROLE_ENABLED;
|
||||
}
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_read_remote_fae_table(uint16_t conn_handle)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_READ_REMOTE_FAE_TABLE;
|
||||
|
||||
arg.cs_read_remote_tab.conn_handle = conn_handle;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_write_cached_remote_fae_table(esp_ble_cs_write_cached_remote_fae_table_params *write_cached_remote_fae_tab_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg = {0};
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!write_cached_remote_fae_tab_params) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_WRITE_CACHED_REMOTE_FAE_TABLE;
|
||||
|
||||
arg.cs_write_cached_remote_fae_table_params.conn_handle = write_cached_remote_fae_tab_params->conn_handle;
|
||||
memcpy(arg.cs_write_cached_remote_fae_table_params.remote_fae_table, write_cached_remote_fae_tab_params->remote_fae_table, sizeof(arg.cs_write_cached_remote_fae_table_params.remote_fae_table));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_create_config(esp_ble_cs_create_config_params *create_config_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg = {0};
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!create_config_params) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
arg.cs_create_config_params.conn_handle = create_config_params->conn_handle;
|
||||
arg.cs_create_config_params.config_id = create_config_params->config_id;
|
||||
arg.cs_create_config_params.create_context = create_config_params->create_context;
|
||||
arg.cs_create_config_params.main_mode_type = create_config_params->main_mode_type;
|
||||
arg.cs_create_config_params.sub_mode_type = create_config_params->sub_mode_type;
|
||||
arg.cs_create_config_params.min_main_mode_steps = create_config_params->min_main_mode_steps;
|
||||
arg.cs_create_config_params.max_main_mode_steps = create_config_params->max_main_mode_steps;
|
||||
arg.cs_create_config_params.main_mode_repetition = create_config_params->main_mode_repetition;
|
||||
arg.cs_create_config_params.mode_0_steps = create_config_params->mode_0_steps;
|
||||
arg.cs_create_config_params.role = create_config_params->role;
|
||||
arg.cs_create_config_params.rtt_type = create_config_params->rtt_type;
|
||||
arg.cs_create_config_params.cs_sync_phy = create_config_params->cs_sync_phy;
|
||||
memcpy(arg.cs_create_config_params.channel_map, create_config_params->channel_map, sizeof(arg.cs_create_config_params.channel_map));
|
||||
arg.cs_create_config_params.channel_map_repetition = create_config_params->channel_map_repetition;
|
||||
arg.cs_create_config_params.channel_selection_type = create_config_params->channel_selection_type;
|
||||
arg.cs_create_config_params.ch3c_shape = create_config_params->ch3c_shape;
|
||||
arg.cs_create_config_params.ch3c_jump = create_config_params->ch3c_jump;
|
||||
arg.cs_create_config_params.reserved = create_config_params->reserved;
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_CREATE_CONFIG;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_remove_config(esp_ble_cs_remove_config_params *remove_config_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!remove_config_params) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_REMOVE_CONFIG;
|
||||
|
||||
arg.cs_remove_config_params.conn_handle = remove_config_params->conn_handle;
|
||||
arg.cs_remove_config_params.config_id = remove_config_params->config_id;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_set_channel_classification(esp_ble_cs_set_channel_class_params *channel_class_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!channel_class_params) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_SET_CAHNNEL_CLASSIFICATION;
|
||||
|
||||
memcpy(arg.cs_set_channel_class_params.channel_class, channel_class_params->channel_class, sizeof(arg.cs_set_channel_class_params));
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_set_procedure_params(esp_ble_cs_set_proc_params *procedure_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!procedure_params) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_SET_PROCEDURE_PARAMS;
|
||||
|
||||
arg.cs_set_procedure_params.conn_handle = procedure_params->conn_handle;
|
||||
arg.cs_set_procedure_params.config_id = procedure_params->config_id;
|
||||
arg.cs_set_procedure_params.max_procedure_len = procedure_params->max_procedure_len;
|
||||
arg.cs_set_procedure_params.min_procedure_interval = procedure_params->min_procedure_interval;
|
||||
arg.cs_set_procedure_params.max_procedure_interval = procedure_params->max_procedure_interval;
|
||||
arg.cs_set_procedure_params.max_procedure_count = procedure_params->max_procedure_count;
|
||||
arg.cs_set_procedure_params.min_subevent_len = (procedure_params->min_subevent_len & 0x00FFFFFF);
|
||||
arg.cs_set_procedure_params.max_subevent_len = (procedure_params->max_subevent_len & 0x00FFFFFF);
|
||||
arg.cs_set_procedure_params.tone_ant_config_selection = procedure_params->tone_ant_config_selection;
|
||||
arg.cs_set_procedure_params.phy = procedure_params->phy;
|
||||
arg.cs_set_procedure_params.tx_power_delta = procedure_params->tx_power_delta;
|
||||
arg.cs_set_procedure_params.preferred_peer_antenna = procedure_params->preferred_peer_antenna;
|
||||
arg.cs_set_procedure_params.SNR_control_initiator = procedure_params->SNR_control_initiator;
|
||||
arg.cs_set_procedure_params.SNR_control_reflector = procedure_params->SNR_control_reflector;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
esp_err_t esp_ble_cs_procedure_enable(esp_ble_cs_procedure_enable_params *procedure_enable_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_5_gap_args_t arg;
|
||||
|
||||
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (!procedure_enable_params) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GAP_BLE;
|
||||
msg.act = BTC_GAP_BLE_CS_PROCEDURE_ENABLE;
|
||||
|
||||
arg.cs_procedure_enable_params.conn_handle = procedure_enable_params->conn_handle;
|
||||
arg.cs_procedure_enable_params.config_id = procedure_enable_params->config_id;
|
||||
arg.cs_procedure_enable_params.enable = procedure_enable_params->enable;
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
|
||||
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -88,6 +88,11 @@ esp_err_t esp_ble_gattc_enh_open(esp_gatt_if_t gattc_if, esp_ble_gatt_creat_conn
|
||||
arg.open.remote_addr_type = creat_conn_params->remote_addr_type;
|
||||
arg.open.is_direct = creat_conn_params->is_direct;
|
||||
arg.open.is_aux= creat_conn_params->is_aux;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
arg.open.is_pawr_synced = false;
|
||||
arg.open.adv_handle = 0xFF;
|
||||
arg.open.subevent = 0xFF;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
arg.open.own_addr_type = creat_conn_params->own_addr_type;
|
||||
arg.open.phy_mask = creat_conn_params->phy_mask;
|
||||
|
||||
@@ -198,6 +203,106 @@ esp_err_t esp_ble_gattc_aux_open(esp_gatt_if_t gattc_if, esp_bd_addr_t remote_bd
|
||||
}
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
esp_err_t esp_ble_gattc_aux_open_with_pawr_synced(esp_gatt_if_t gattc_if, esp_ble_gatt_pawr_conn_params_t *pawr_conn_params)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
btc_ble_gattc_args_t arg;
|
||||
const esp_ble_conn_params_t *conn_params;
|
||||
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
if (!pawr_conn_params) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
msg.sig = BTC_SIG_API_CALL;
|
||||
msg.pid = BTC_PID_GATTC;
|
||||
msg.act = BTC_GATTC_ACT_OPEN;
|
||||
arg.open.gattc_if = gattc_if;
|
||||
memcpy(arg.open.remote_bda, pawr_conn_params->remote_bda, ESP_BD_ADDR_LEN);
|
||||
arg.open.remote_addr_type = pawr_conn_params->remote_addr_type;
|
||||
arg.open.is_direct = true;
|
||||
arg.open.is_aux = true;
|
||||
arg.open.is_pawr_synced = true;
|
||||
arg.open.adv_handle = pawr_conn_params->adv_handle;
|
||||
arg.open.subevent = pawr_conn_params->subevent;
|
||||
arg.open.own_addr_type = pawr_conn_params->own_addr_type;
|
||||
arg.open.phy_mask = pawr_conn_params->phy_mask;
|
||||
|
||||
if (pawr_conn_params->phy_mask & ESP_BLE_PHY_1M_PREF_MASK) {
|
||||
if (!pawr_conn_params->phy_1m_conn_params) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
conn_params = pawr_conn_params->phy_1m_conn_params;
|
||||
if (ESP_BLE_IS_VALID_PARAM(conn_params->interval_min, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(conn_params->interval_max, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(conn_params->supervision_timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
|
||||
(conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
|
||||
((conn_params->supervision_timeout * 10) >= ((1 + conn_params->latency) * ((conn_params->interval_max * 5) >> 1))) &&
|
||||
(conn_params->interval_min <= conn_params->interval_max)) {
|
||||
memcpy(&arg.open.phy_1m_conn_params, conn_params, sizeof(esp_ble_conn_params_t));
|
||||
} else {
|
||||
LOG_ERROR("%s, invalid 1M PHY connection params: min_int = %d, max_int = %d, latency = %d, timeout = %d", __func__,
|
||||
conn_params->interval_min,
|
||||
conn_params->interval_max,
|
||||
conn_params->latency,
|
||||
conn_params->supervision_timeout);
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
|
||||
if (pawr_conn_params->phy_mask & ESP_BLE_PHY_2M_PREF_MASK) {
|
||||
if (!pawr_conn_params->phy_2m_conn_params) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
conn_params = pawr_conn_params->phy_2m_conn_params;
|
||||
if (ESP_BLE_IS_VALID_PARAM(conn_params->interval_min, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(conn_params->interval_max, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(conn_params->supervision_timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
|
||||
(conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
|
||||
((conn_params->supervision_timeout * 10) >= ((1 + conn_params->latency) * ((conn_params->interval_max * 5) >> 1))) &&
|
||||
(conn_params->interval_min <= conn_params->interval_max)) {
|
||||
memcpy(&arg.open.phy_2m_conn_params, conn_params, sizeof(esp_ble_conn_params_t));
|
||||
} else {
|
||||
LOG_ERROR("%s, invalid 2M PHY connection params: min_int = %d, max_int = %d, latency = %d, timeout = %d", __func__,
|
||||
conn_params->interval_min,
|
||||
conn_params->interval_max,
|
||||
conn_params->latency,
|
||||
conn_params->supervision_timeout);
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
|
||||
if (pawr_conn_params->phy_mask & ESP_BLE_PHY_CODED_PREF_MASK) {
|
||||
if (!pawr_conn_params->phy_coded_conn_params) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
conn_params = pawr_conn_params->phy_coded_conn_params;
|
||||
if (ESP_BLE_IS_VALID_PARAM(conn_params->interval_min, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(conn_params->interval_max, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
|
||||
ESP_BLE_IS_VALID_PARAM(conn_params->supervision_timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
|
||||
(conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
|
||||
((conn_params->supervision_timeout * 10) >= ((1 + conn_params->latency) * ((conn_params->interval_max * 5) >> 1))) &&
|
||||
(conn_params->interval_min <= conn_params->interval_max)) {
|
||||
memcpy(&arg.open.phy_coded_conn_params, conn_params, sizeof(esp_ble_conn_params_t));
|
||||
} else {
|
||||
LOG_ERROR("%s, invalid Coded PHY connection params: min_int = %d, max_int = %d, latency = %d, timeout = %d", __func__,
|
||||
conn_params->interval_min,
|
||||
conn_params->interval_max,
|
||||
conn_params->latency,
|
||||
conn_params->supervision_timeout);
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
|
||||
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||
}
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
esp_err_t esp_ble_gattc_close (esp_gatt_if_t gattc_if, uint16_t conn_id)
|
||||
{
|
||||
btc_msg_t msg = {0};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -695,6 +695,19 @@ typedef struct {
|
||||
const esp_ble_conn_params_t *phy_coded_conn_params; /*!< Connection parameters for the LE Coded PHY */
|
||||
} esp_ble_gatt_creat_conn_params_t;
|
||||
|
||||
/** @brief Represents a creat connection element. */
|
||||
typedef struct {
|
||||
esp_bd_addr_t remote_bda; /*!< The Bluetooth address of the remote device */
|
||||
esp_ble_addr_type_t remote_addr_type; /*!< Address type of the remote device */
|
||||
esp_ble_addr_type_t own_addr_type; /*!< Specifies the address type used in the connection request. Set to 0xFF if the address type is unknown. */
|
||||
uint8_t adv_handle; /*!< Advertising_Handle identifying the periodic advertising train. Range: 0x00 to 0xEF or 0xFF */
|
||||
uint8_t subevent; /*!< Subevent where the connection request is to be sent. Range: 0x00 to 0x7F or 0xFF */
|
||||
esp_ble_phy_mask_t phy_mask; /*!< Indicates which PHY connection parameters will be used. When is_aux is false, only the connection params for 1M PHY can be specified */
|
||||
const esp_ble_conn_params_t *phy_1m_conn_params; /*!< Connection parameters for the LE 1M PHY */
|
||||
const esp_ble_conn_params_t *phy_2m_conn_params; /*!< Connection parameters for the LE 2M PHY */
|
||||
const esp_ble_conn_params_t *phy_coded_conn_params; /*!< Connection parameters for the LE Coded PHY */
|
||||
} esp_ble_gatt_pawr_conn_params_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -6347,6 +6347,106 @@ void bta_dm_ble_set_host_feature(tBTA_DM_MSG *p_data)
|
||||
}
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
void bta_dm_api_set_periodic_adv_subevt_data(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleSetPaSubeventData(p_data->pa_subevt_data.adv_handle, p_data->pa_subevt_data.num_subevents_with_data, (uint8_t *)(p_data->pa_subevt_data.subevent_params));
|
||||
}
|
||||
|
||||
void bta_dm_api_set_periodic_adv_response_data(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleSetPaResponseData(p_data->pa_rsp_data.sync_handle, p_data->pa_rsp_data.request_event, p_data->pa_rsp_data.request_subevent,
|
||||
p_data->pa_rsp_data.rsp_subevent, p_data->pa_rsp_data.rsp_slot, p_data->pa_rsp_data.rsp_data_len,
|
||||
p_data->pa_rsp_data.rsp_data);
|
||||
}
|
||||
|
||||
void bta_dm_api_set_periodic_sync_subevt(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleSetPaSyncSubevt(p_data->pa_sync_subevt.sync_handle, p_data->pa_sync_subevt.periodic_adv_properties, p_data->pa_sync_subevt.num_subevents_to_sync, p_data->pa_sync_subevt.subevent);
|
||||
}
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
void bta_dm_api_cs_read_local_supported_caps(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleCSReadLocalSuppCaps();
|
||||
}
|
||||
|
||||
void bta_dm_api_cs_read_remote_supported_caps(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleCSReadRemoteSuppCaps(p_data->read_remote_supp_caps.conn_handle);
|
||||
}
|
||||
|
||||
void bta_dm_api_cs_write_cached_remote_supported_caps(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
tBTA_DM_API_CS_WRITE_CACHED_REMOTE_SUPP_CAPS *p = &p_data->write_cached_remote_caps;
|
||||
BTM_BleGapWriteCachedRemoteSupportedCaps(p->conn_handle, p->num_config_supported, p->max_consecutive_proc_supported,
|
||||
p->num_ant_supported, p->max_ant_paths_supported, p->roles_supported,
|
||||
p->modes_supported, p->rtt_capability, p->rtt_aa_only_n,
|
||||
p->rtt_sounding_n, p->rtt_random_payload_n, p->NADM_sounding_capability,
|
||||
p->NADM_random_capability, p->cs_sync_phys_supported, p->subfeatures_supported,
|
||||
p->T_IP1_times_supported, p->T_IP2_times_supported, p->T_FCS_times_supported,
|
||||
p->T_PM_times_supported, p->T_SW_times_supported, p->TX_SNR_capability);
|
||||
}
|
||||
|
||||
void bta_dm_api_cs_security_enable(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleGapCsSecurityEnable(p_data->security_enable.conn_handle);
|
||||
}
|
||||
|
||||
void bta_dm_api_cs_set_default_settings(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleGapCsSetDefaultSetting(p_data->set_default_setting_params.conn_handle, p_data->set_default_setting_params.role_enable,
|
||||
p_data->set_default_setting_params.cs_sync_ant_selection, p_data->set_default_setting_params.max_tx_power);
|
||||
}
|
||||
|
||||
void bta_dm_api_cs_read_remote_fae_table(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleGapCsReadRemoteFaeTable(p_data->read_remote_tab.conn_handle);
|
||||
}
|
||||
|
||||
void bta_dm_api_cs_write_cached_remote_fae_table(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleGapWriteCachedRemoteFaeTable(p_data->write_cached_remote_fae_tab_params.conn_handle, p_data->write_cached_remote_fae_tab_params.remote_fae_table);
|
||||
}
|
||||
|
||||
void bta_dm_api_cs_create_config(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
tBTA_DM_API_CS_CREATE_CONFIG_PARAMS *p = &p_data->create_config_params;
|
||||
BTM_BleGapCsCreateConfig(p->conn_handle, p->config_id, p->create_context,
|
||||
p->main_mode_type, p->sub_mode_type, p->min_main_mode_steps,
|
||||
p->max_main_mode_steps, p->main_mode_repetition, p->mode_0_steps,
|
||||
p->role, p->rtt_type, p->cs_sync_phy, &p->channel_map[0],
|
||||
p->channel_map_repetition, p->channel_selection_type, p->ch3c_shape,
|
||||
p->ch3c_jump, p->reserved);
|
||||
}
|
||||
|
||||
void bta_dm_api_cs_remove_config(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleGapCsRemoveConfig(p_data->remove_config_params.conn_handle, p_data->remove_config_params.config_id);
|
||||
}
|
||||
|
||||
void bta_dm_api_cs_set_channel_classification(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleGapCsSetChannelClass(p_data->set_channel_class_params.channel_class);
|
||||
}
|
||||
void bta_dm_api_cs_set_procedure_params(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
tBTA_DM_API_CS_SET_PROC_PARAMS *p = &p_data->set_proc_params;
|
||||
BTM_BleGapCsSetProcPatams(p->conn_handle, p->config_id, p->max_procedure_len,
|
||||
p->min_procedure_interval, p->max_procedure_interval,
|
||||
p->max_procedure_count, p->min_subevent_len,
|
||||
p->max_subevent_len, p->tone_ant_config_selection,
|
||||
p->phy, p->tx_power_delta, p->preferred_peer_antenna,
|
||||
p->SNR_control_initiator, p->SNR_control_reflector);
|
||||
}
|
||||
|
||||
void bta_dm_api_cs_procedure_enable(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_BleGapCsProcEnable(p_data->proc_enable_params.conn_handle, p_data->proc_enable_params.config_id, p_data->proc_enable_params.enable);
|
||||
}
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -6942,7 +7042,7 @@ void btm_dm_start_gatt_discovery (BD_ADDR bd_addr)
|
||||
} else {
|
||||
//TODO need to add addr_type in future
|
||||
BTA_GATTC_Enh_Open(bta_dm_search_cb.client_if, bd_addr, BLE_ADDR_UNKNOWN_TYPE, TRUE,
|
||||
BTA_GATT_TRANSPORT_LE, FALSE, BLE_ADDR_UNKNOWN_TYPE, 0, NULL, NULL, NULL);
|
||||
BTA_GATT_TRANSPORT_LE, FALSE, BLE_ADDR_UNKNOWN_TYPE, false, 0xFF, 0xFF, 0, NULL, NULL, NULL);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3169,6 +3169,217 @@ void BTA_DmBleGapSetHostFeature(uint16_t bit_num, uint8_t bit_val)
|
||||
}
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
void BTA_DmBleGapSetPASubevtData(uint8_t adv_handle, uint8_t num_subevents_with_data, uint8_t *subevent_params)
|
||||
{
|
||||
tBTA_DM_API_BLE_PA_SUBEVENT_DATA *p_msg;
|
||||
tBTA_BLE_SUBEVENT_PARAMS *p_subevent_params = (tBTA_BLE_SUBEVENT_PARAMS*)subevent_params;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_PA_SUBEVENT_DATA *)osi_malloc(sizeof(tBTA_DM_API_BLE_PA_SUBEVENT_DATA) + num_subevents_with_data * sizeof(tBTA_DM_API_BLE_SUBEVENT_PARAMS)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_SET_PA_SUBEVT_DATA;
|
||||
p_msg->adv_handle = adv_handle;
|
||||
p_msg->num_subevents_with_data = num_subevents_with_data;
|
||||
p_msg->subevent_params = (tBTA_DM_API_BLE_SUBEVENT_PARAMS *)(p_msg + 1);
|
||||
for (uint8_t i = 0; i < num_subevents_with_data; i++)
|
||||
{
|
||||
p_msg->subevent_params[i].subevent = p_subevent_params[i].subevent;
|
||||
p_msg->subevent_params[i].response_slot_start = p_subevent_params[i].response_slot_start;
|
||||
p_msg->subevent_params[i].response_slot_count = p_subevent_params[i].response_slot_count;
|
||||
p_msg->subevent_params[i].subevent_data_len = p_subevent_params[i].subevent_data_len;
|
||||
memcpy(&(p_msg->subevent_params[i].subevent_data), p_subevent_params[i].subevent_data, p_subevent_params[i].subevent_data_len);
|
||||
}
|
||||
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetPeriodicAdvRspData(uint16_t sync_handle, uint16_t request_event, uint8_t request_subevent,
|
||||
uint8_t rsp_subevent, uint8_t rsp_slot, uint8_t rsp_data_len, uint8_t *rsp_data)
|
||||
{
|
||||
tBTA_DM_API_BLE_PA_RSP_DATA *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_PA_RSP_DATA *)osi_malloc(sizeof(tBTA_DM_API_BLE_PA_RSP_DATA) + rsp_data_len))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_SET_PA_RSP_DATA;
|
||||
p_msg->sync_handle = sync_handle;
|
||||
p_msg->request_event = request_event;
|
||||
p_msg->request_subevent = request_subevent;
|
||||
p_msg->rsp_subevent = rsp_subevent;
|
||||
p_msg->rsp_slot = rsp_slot;
|
||||
p_msg->rsp_data_len = rsp_data_len;
|
||||
p_msg->rsp_data = (UINT8 *)(p_msg + 1);
|
||||
if (rsp_data_len && rsp_data) {
|
||||
memcpy(p_msg->rsp_data, rsp_data, rsp_data_len);
|
||||
} else if (rsp_data_len) {
|
||||
APPL_TRACE_ERROR("%s rsp_data is NULL", __func__);
|
||||
}
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapSetPeriodicSyncSubevt(uint16_t sync_handle, uint16_t periodic_adv_properties, uint8_t num_subevents_to_sync, uint8_t *subevent)
|
||||
{
|
||||
tBTA_DM_API_BLE_PA_SYNC_SUBEVT *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_BLE_PA_SYNC_SUBEVT *)osi_malloc(sizeof(tBTA_DM_API_BLE_PA_SYNC_SUBEVT) + num_subevents_to_sync))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_SET_PA_SYNC_SUBEVT;
|
||||
p_msg->sync_handle = sync_handle;
|
||||
p_msg->periodic_adv_properties = periodic_adv_properties;
|
||||
p_msg->num_subevents_to_sync = num_subevents_to_sync;
|
||||
p_msg->subevent = (UINT8 *)(p_msg + 1);
|
||||
if (num_subevents_to_sync && subevent) {
|
||||
memcpy(p_msg->subevent, subevent, num_subevents_to_sync);
|
||||
} else if (num_subevents_to_sync) {
|
||||
APPL_TRACE_ERROR("%s subevent is NULL", __func__);
|
||||
}
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
void BTA_DmBleGapReadLocalSupportedCaps(void)
|
||||
{
|
||||
tBTA_DM_API_CS_READ_LOCAL_SUPP_CAPS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_READ_LOCAL_SUPP_CAPS *)osi_malloc(sizeof(tBTA_DM_API_CS_READ_LOCAL_SUPP_CAPS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_READ_LOCAL_SUPPORTED_CAPS;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapReadRemoteSupportedCaps(uint16_t conn_handle)
|
||||
{
|
||||
tBTA_DM_API_CS_READ_REMOTE_SUPP_CAPS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_READ_REMOTE_SUPP_CAPS *)osi_malloc(sizeof(tBTA_DM_API_CS_READ_REMOTE_SUPP_CAPS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_READ_REMOTE_SUPPORTED_CAPS;
|
||||
p_msg->conn_handle = conn_handle;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapWriteCachedRemoteSupportedCaps(tBTA_DM_CS_WRITE_CACHED_REMOTE_SUPP_CAPS *write_cachedremote_supp_caps)
|
||||
{
|
||||
tBTA_DM_API_CS_WRITE_CACHED_REMOTE_SUPP_CAPS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_WRITE_CACHED_REMOTE_SUPP_CAPS *)osi_malloc(sizeof(tBTA_DM_API_CS_WRITE_CACHED_REMOTE_SUPP_CAPS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPS;
|
||||
memcpy(&p_msg->conn_handle, &write_cachedremote_supp_caps->conn_handle, sizeof(tBTA_DM_CS_WRITE_CACHED_REMOTE_SUPP_CAPS));
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapCsSecurityEnable(uint16_t conn_handle)
|
||||
{
|
||||
tBTA_DM_API_CS_SECURITY_ENABLE *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_SECURITY_ENABLE *)osi_malloc(sizeof(tBTA_DM_API_CS_SECURITY_ENABLE))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_SECURITY_ENABLE;
|
||||
p_msg->conn_handle = conn_handle;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapCsSetDefaultSetting(uint16_t conn_handle, uint8_t role_enable, uint8_t cs_sync_ant_selection, int8_t max_tx_power)
|
||||
{
|
||||
tBTA_DM_API_CS_SET_DEFAULT_SETTING_PARAMS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_SET_DEFAULT_SETTING_PARAMS *)osi_malloc(sizeof(tBTA_DM_API_CS_SET_DEFAULT_SETTING_PARAMS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_SET_DEFAULT_SETTINGS;
|
||||
p_msg->conn_handle = conn_handle;
|
||||
p_msg->role_enable = role_enable;
|
||||
p_msg->cs_sync_ant_selection = cs_sync_ant_selection;
|
||||
p_msg->max_tx_power = max_tx_power;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
void BTA_DmBleGapCsReadRemoteFaeTable(uint16_t conn_handle)
|
||||
{
|
||||
tBTA_DM_API_CS_READ_REMOTE_TAB *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_READ_REMOTE_TAB *)osi_malloc(sizeof(tBTA_DM_API_CS_READ_REMOTE_TAB))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_READ_REMOTE_FAE_TABLE;
|
||||
p_msg->conn_handle = conn_handle;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapWriteCachedRemoteFaeTable(uint16_t conn_handle, uint8_t *remote_fae_table, uint8_t table_len)
|
||||
{
|
||||
tBTA_DM_API_CS_WRITE_CACHED_REMOTE_FAE_TAB_PARAMS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_WRITE_CACHED_REMOTE_FAE_TAB_PARAMS *)osi_malloc(sizeof(tBTA_DM_API_CS_WRITE_CACHED_REMOTE_FAE_TAB_PARAMS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_WRITE_CACHED_REMOTE_FAE_TABLE;
|
||||
p_msg->conn_handle = conn_handle;
|
||||
memcpy(&p_msg->remote_fae_table[0], remote_fae_table, table_len);
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapCsCreateConfig(tBTA_DM_CS_CREATE_CONFIG_PARAMS *create_config_params)
|
||||
{
|
||||
tBTA_DM_API_CS_CREATE_CONFIG_PARAMS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_CREATE_CONFIG_PARAMS *)osi_malloc(sizeof(tBTA_DM_API_CS_CREATE_CONFIG_PARAMS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_CREATE_CONFIG;
|
||||
memcpy(&p_msg->conn_handle, &create_config_params->conn_handle, sizeof(tBTA_DM_CS_CREATE_CONFIG_PARAMS));
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapCsRemoveConfig(uint16_t conn_handle, uint8_t config_id)
|
||||
{
|
||||
tBTA_DM_API_CS_REMOVE_CONFIG_PARAMS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_REMOVE_CONFIG_PARAMS *)osi_malloc(sizeof(tBTA_DM_API_CS_REMOVE_CONFIG_PARAMS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_REMOVE_CONFIG;
|
||||
p_msg->conn_handle = conn_handle;
|
||||
p_msg->config_id = config_id;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapCsSetChannelClass(uint8_t *channel_class, uint8_t channl_len)
|
||||
{
|
||||
tBTA_DM_API_CS_SET_CHANNEL_CLASS_PARAMS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_SET_CHANNEL_CLASS_PARAMS *)osi_malloc(sizeof(tBTA_DM_API_CS_SET_CHANNEL_CLASS_PARAMS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_SET_CAHNNEL_CLASSIFICATION;
|
||||
memcpy(&p_msg->channel_class[0], channel_class, channl_len);
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapCsSetProcPatams(tBTA_DM_CS_SET_PROC_PARAMS *set_proc_params)
|
||||
{
|
||||
tBTA_DM_API_CS_SET_PROC_PARAMS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_SET_PROC_PARAMS *)osi_malloc(sizeof(tBTA_DM_API_CS_SET_PROC_PARAMS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_SET_PROCEDURE_PARAMS;
|
||||
memcpy(&p_msg->conn_handle, &set_proc_params->conn_handle, sizeof(tBTA_DM_CS_SET_PROC_PARAMS));
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleGapCsProcEnable(uint16_t conn_handle, uint8_t config_id, uint8_t enable)
|
||||
{
|
||||
tBTA_DM_API_CS_PROC_ENABLE_PARAMS *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_CS_PROC_ENABLE_PARAMS *)osi_malloc(sizeof(tBTA_DM_API_CS_PROC_ENABLE_PARAMS))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_CS_PROCEDURE_ENABLE;
|
||||
p_msg->conn_handle = conn_handle;
|
||||
p_msg->config_id = config_id;
|
||||
p_msg->enable = enable;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_VendorInit
|
||||
|
||||
@@ -344,6 +344,25 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
bta_dm_ble_set_host_feature, /* BTA_DM_API_SET_HOST_FEATURE_EVT */
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
bta_dm_api_set_periodic_adv_subevt_data, /* BTA_DM_API_SET_PA_SUBEVT_DATA */
|
||||
bta_dm_api_set_periodic_adv_response_data, /* BTA_DM_API_SET_PA_RSP_DATA */
|
||||
bta_dm_api_set_periodic_sync_subevt, /* BTA_DM_API_SET_PA_SYNC_SUBEVT */
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
bta_dm_api_cs_read_local_supported_caps, /* BTA_DM_API_CS_READ_LOCAL_SUPPORTED_CAPS */
|
||||
bta_dm_api_cs_read_remote_supported_caps, /* BTA_DM_API_CS_READ_REMOTE_SUPPORTED_CAPS */
|
||||
bta_dm_api_cs_write_cached_remote_supported_caps, /* BTA_DM_API_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPS */
|
||||
bta_dm_api_cs_security_enable, /* BTA_DM_API_CS_SECURITY_ENABLE */
|
||||
bta_dm_api_cs_set_default_settings, /* BTA_DM_API_CS_SET_DEFAULT_SETTINGS */
|
||||
bta_dm_api_cs_read_remote_fae_table, /* BTA_DM_API_CS_READ_REMOTE_FAE_TABLE */
|
||||
bta_dm_api_cs_write_cached_remote_fae_table, /* BTA_DM_API_CS_WRITE_CACHED_REMOTE_FAE_TABLE */
|
||||
bta_dm_api_cs_create_config, /* BTA_DM_API_CS_CREATE_CONFIG */
|
||||
bta_dm_api_cs_remove_config, /* BTA_DM_API_CS_REMOVE_CONFIG */
|
||||
bta_dm_api_cs_set_channel_classification, /* BTA_DM_API_CS_SET_CAHNNEL_CLASSIFICATION */
|
||||
bta_dm_api_cs_set_procedure_params, /* BTA_DM_API_CS_SET_PROCEDURE_PARAMS */
|
||||
bta_dm_api_cs_procedure_enable, /* BTA_DM_API_CS_PROCEDURE_ENABLE */
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -335,6 +335,25 @@ enum {
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
BTA_DM_API_SET_HOST_FEATURE_EVT,
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
BTA_DM_API_SET_PA_SUBEVT_DATA,
|
||||
BTA_DM_API_SET_PA_RSP_DATA,
|
||||
BTA_DM_API_SET_PA_SYNC_SUBEVT,
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
BTA_DM_API_CS_READ_LOCAL_SUPPORTED_CAPS,
|
||||
BTA_DM_API_CS_READ_REMOTE_SUPPORTED_CAPS,
|
||||
BTA_DM_API_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPS,
|
||||
BTA_DM_API_CS_SECURITY_ENABLE,
|
||||
BTA_DM_API_CS_SET_DEFAULT_SETTINGS,
|
||||
BTA_DM_API_CS_READ_REMOTE_FAE_TABLE,
|
||||
BTA_DM_API_CS_WRITE_CACHED_REMOTE_FAE_TABLE,
|
||||
BTA_DM_API_CS_CREATE_CONFIG,
|
||||
BTA_DM_API_CS_REMOVE_CONFIG,
|
||||
BTA_DM_API_CS_SET_CAHNNEL_CLASSIFICATION,
|
||||
BTA_DM_API_CS_SET_PROCEDURE_PARAMS,
|
||||
BTA_DM_API_CS_PROCEDURE_ENABLE,
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
BTA_DM_MAX_EVT
|
||||
};
|
||||
|
||||
@@ -1156,6 +1175,167 @@ typedef struct {
|
||||
} tBTA_DM_API_SET_HOST_FEATURE;
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
typedef struct {
|
||||
UINT8 subevent;
|
||||
UINT8 response_slot_start;
|
||||
UINT8 response_slot_count;
|
||||
UINT8 subevent_data_len;
|
||||
UINT8 *subevent_data;
|
||||
} tBTA_BLE_SUBEVENT_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 subevent;
|
||||
UINT8 response_slot_start;
|
||||
UINT8 response_slot_count;
|
||||
UINT8 subevent_data_len;
|
||||
UINT8 subevent_data[251];
|
||||
} tBTA_DM_API_BLE_SUBEVENT_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT8 adv_handle;
|
||||
UINT8 num_subevents_with_data;
|
||||
tBTA_DM_API_BLE_SUBEVENT_PARAMS *subevent_params;
|
||||
} tBTA_DM_API_BLE_PA_SUBEVENT_DATA;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 sync_handle;
|
||||
UINT16 request_event;
|
||||
UINT8 request_subevent;
|
||||
UINT8 rsp_subevent;
|
||||
UINT8 rsp_slot;
|
||||
UINT8 rsp_data_len;
|
||||
UINT8 *rsp_data;
|
||||
} tBTA_DM_API_BLE_PA_RSP_DATA;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 sync_handle;
|
||||
UINT16 periodic_adv_properties;
|
||||
UINT8 num_subevents_to_sync;
|
||||
UINT8 *subevent;
|
||||
} tBTA_DM_API_BLE_PA_SYNC_SUBEVT;
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
} tBTA_DM_API_CS_READ_LOCAL_SUPP_CAPS;
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 conn_handle;
|
||||
} tBTA_DM_API_CS_READ_REMOTE_SUPP_CAPS;
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 conn_handle;
|
||||
UINT8 num_config_supported;
|
||||
UINT16 max_consecutive_proc_supported;
|
||||
UINT8 num_ant_supported;
|
||||
UINT8 max_ant_paths_supported;
|
||||
UINT8 roles_supported;
|
||||
UINT8 modes_supported;
|
||||
UINT8 rtt_capability;
|
||||
UINT8 rtt_aa_only_n;
|
||||
UINT8 rtt_sounding_n;
|
||||
UINT8 rtt_random_payload_n;
|
||||
UINT16 NADM_sounding_capability;
|
||||
UINT16 NADM_random_capability;
|
||||
UINT8 cs_sync_phys_supported;
|
||||
UINT16 subfeatures_supported;
|
||||
UINT16 T_IP1_times_supported;
|
||||
UINT16 T_IP2_times_supported;
|
||||
UINT16 T_FCS_times_supported;
|
||||
UINT16 T_PM_times_supported;
|
||||
UINT8 T_SW_times_supported;
|
||||
UINT8 TX_SNR_capability;
|
||||
} tBTA_DM_API_CS_WRITE_CACHED_REMOTE_SUPP_CAPS;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 conn_handle;
|
||||
} tBTA_DM_API_CS_SECURITY_ENABLE;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 conn_handle;
|
||||
UINT8 role_enable;
|
||||
UINT8 cs_sync_ant_selection;
|
||||
INT8 max_tx_power;
|
||||
} tBTA_DM_API_CS_SET_DEFAULT_SETTING_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 conn_handle;
|
||||
} tBTA_DM_API_CS_READ_REMOTE_TAB;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 conn_handle;
|
||||
UINT8 remote_fae_table[72];
|
||||
} tBTA_DM_API_CS_WRITE_CACHED_REMOTE_FAE_TAB_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 conn_handle;
|
||||
UINT8 config_id;
|
||||
UINT8 create_context;
|
||||
UINT8 main_mode_type;
|
||||
UINT8 sub_mode_type;
|
||||
UINT8 min_main_mode_steps;
|
||||
UINT8 max_main_mode_steps;
|
||||
UINT8 main_mode_repetition;
|
||||
UINT8 mode_0_steps;
|
||||
UINT8 role;
|
||||
UINT8 rtt_type;
|
||||
UINT8 cs_sync_phy;
|
||||
UINT8 channel_map[10];
|
||||
UINT8 channel_map_repetition;
|
||||
UINT8 channel_selection_type;
|
||||
UINT8 ch3c_shape;
|
||||
UINT8 ch3c_jump;
|
||||
UINT8 reserved;
|
||||
} tBTA_DM_API_CS_CREATE_CONFIG_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 conn_handle;
|
||||
UINT8 config_id;
|
||||
} tBTA_DM_API_CS_REMOVE_CONFIG_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT8 channel_class[10];
|
||||
} tBTA_DM_API_CS_SET_CHANNEL_CLASS_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 conn_handle;
|
||||
UINT8 config_id;
|
||||
UINT16 max_procedure_len;
|
||||
UINT16 min_procedure_interval;
|
||||
UINT16 max_procedure_interval;
|
||||
UINT16 max_procedure_count;
|
||||
UINT32 min_subevent_len;
|
||||
UINT32 max_subevent_len;
|
||||
UINT8 tone_ant_config_selection;
|
||||
UINT8 phy;
|
||||
UINT8 tx_power_delta;
|
||||
UINT8 preferred_peer_antenna;
|
||||
UINT8 SNR_control_initiator;
|
||||
UINT8 SNR_control_reflector;
|
||||
} tBTA_DM_API_CS_SET_PROC_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 conn_handle;
|
||||
UINT8 config_id;
|
||||
UINT8 enable;
|
||||
} tBTA_DM_API_CS_PROC_ENABLE_PARAMS;
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
#endif /* BLE_INCLUDED */
|
||||
|
||||
#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE)
|
||||
@@ -1876,6 +2056,25 @@ typedef union {
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
tBTA_DM_API_SET_HOST_FEATURE set_host_feat;
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
tBTA_DM_API_BLE_PA_SUBEVENT_DATA pa_subevt_data;
|
||||
tBTA_DM_API_BLE_PA_RSP_DATA pa_rsp_data;
|
||||
tBTA_DM_API_BLE_PA_SYNC_SUBEVT pa_sync_subevt;
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
tBTA_DM_API_CS_READ_LOCAL_SUPP_CAPS read_local_supp_caps;
|
||||
tBTA_DM_API_CS_READ_REMOTE_SUPP_CAPS read_remote_supp_caps;
|
||||
tBTA_DM_API_CS_WRITE_CACHED_REMOTE_SUPP_CAPS write_cached_remote_caps;
|
||||
tBTA_DM_API_CS_SECURITY_ENABLE security_enable;
|
||||
tBTA_DM_API_CS_SET_DEFAULT_SETTING_PARAMS set_default_setting_params;
|
||||
tBTA_DM_API_CS_READ_REMOTE_TAB read_remote_tab;
|
||||
tBTA_DM_API_CS_WRITE_CACHED_REMOTE_FAE_TAB_PARAMS write_cached_remote_fae_tab_params;
|
||||
tBTA_DM_API_CS_CREATE_CONFIG_PARAMS create_config_params;
|
||||
tBTA_DM_API_CS_REMOVE_CONFIG_PARAMS remove_config_params;
|
||||
tBTA_DM_API_CS_SET_CHANNEL_CLASS_PARAMS set_channel_class_params;
|
||||
tBTA_DM_API_CS_SET_PROC_PARAMS set_proc_params;
|
||||
tBTA_DM_API_CS_PROC_ENABLE_PARAMS proc_enable_params;
|
||||
#endif
|
||||
} tBTA_DM_MSG;
|
||||
|
||||
|
||||
@@ -2543,4 +2742,23 @@ void bta_dm_api_subrate_request(tBTA_DM_MSG *p_data);
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
extern void bta_dm_ble_set_host_feature(tBTA_DM_MSG *p_data);
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
void bta_dm_api_set_periodic_adv_subevt_data(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_set_periodic_adv_response_data(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_set_periodic_sync_subevt(tBTA_DM_MSG *p_data);
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
void bta_dm_api_cs_read_local_supported_caps(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_read_remote_supported_caps(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_write_cached_remote_supported_caps(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_security_enable(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_set_default_settings(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_read_remote_fae_table(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_write_cached_remote_fae_table(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_create_config(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_remove_config(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_set_channel_classification(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_set_procedure_params(tBTA_DM_MSG *p_data);
|
||||
void bta_dm_api_cs_procedure_enable(tBTA_DM_MSG *p_data);
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
#endif /* BTA_DM_INT_H */
|
||||
|
||||
@@ -511,6 +511,10 @@ void bta_gattc_open(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
||||
tGATT_TCB *p_tcb;
|
||||
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
|
||||
|
||||
BOOLEAN is_pawr_synced = FALSE;
|
||||
UINT8 adv_handle = 0xFF;
|
||||
UINT8 subevent = 0xFF;
|
||||
|
||||
if (!p_clcb || !p_data) {
|
||||
return;
|
||||
}
|
||||
@@ -545,10 +549,15 @@ void bta_gattc_open(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
||||
APPL_TRACE_ERROR("Unknown Device, setting rejected");
|
||||
}
|
||||
}
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
is_pawr_synced = p_data->api_conn.is_pawr_synced;
|
||||
adv_handle = p_data->api_conn.adv_handle;
|
||||
subevent = p_data->api_conn.subevent;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
/* open/hold a connection */
|
||||
if (!GATT_Connect(p_clcb->p_rcb->client_if, p_data->api_conn.remote_bda, p_data->api_conn.remote_addr_type,
|
||||
TRUE, p_data->api_conn.transport, p_data->api_conn.is_aux)) {
|
||||
TRUE, p_data->api_conn.transport, p_data->api_conn.is_aux, is_pawr_synced,
|
||||
adv_handle, subevent)) {
|
||||
APPL_TRACE_ERROR("Connection open failure");
|
||||
|
||||
bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_OPEN_FAIL_EVT, p_data);
|
||||
@@ -585,7 +594,7 @@ void bta_gattc_init_bk_conn(tBTA_GATTC_API_OPEN *p_data, tBTA_GATTC_RCB *p_clreg
|
||||
/* always call open to hold a connection */
|
||||
if (!GATT_Connect(p_data->client_if, p_data->remote_bda,
|
||||
p_data->remote_addr_type, FALSE,
|
||||
p_data->transport, p_data->is_aux)) {
|
||||
p_data->transport, p_data->is_aux, FALSE, 0xFF, 0xFF)) {
|
||||
#if (!CONFIG_BT_STACK_NO_LOG)
|
||||
uint8_t *bda = (uint8_t *)p_data->remote_bda;
|
||||
#endif
|
||||
|
||||
@@ -144,6 +144,7 @@ void BTA_GATTC_AppDeregister(tBTA_GATTC_IF client_if)
|
||||
*******************************************************************************/
|
||||
void BTA_GATTC_Enh_Open(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, tBTA_ADDR_TYPE remote_addr_type,
|
||||
BOOLEAN is_direct, tBTA_GATT_TRANSPORT transport, BOOLEAN is_aux, tBTA_ADDR_TYPE own_addr_type,
|
||||
BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent,
|
||||
UINT8 phy_mask, tBTA_BLE_CONN_PARAMS *phy_1m_conn_params, tBTA_BLE_CONN_PARAMS *phy_2m_conn_params,
|
||||
tBTA_BLE_CONN_PARAMS *phy_coded_conn_params)
|
||||
{
|
||||
@@ -156,6 +157,11 @@ void BTA_GATTC_Enh_Open(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, tBTA_ADDR_T
|
||||
p_buf->is_direct = is_direct;
|
||||
p_buf->transport = transport;
|
||||
p_buf->is_aux = is_aux;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
p_buf->is_pawr_synced = is_pawr_synced;
|
||||
p_buf->adv_handle = adv_handle;
|
||||
p_buf->subevent = subevent;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
p_buf->remote_addr_type = remote_addr_type;
|
||||
p_buf->own_addr_type = own_addr_type;
|
||||
p_buf->phy_mask = phy_mask;
|
||||
|
||||
@@ -757,7 +757,7 @@ void bta_gatts_open (tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA *p_msg)
|
||||
if ((p_rcb = bta_gatts_find_app_rcb_by_app_if(p_msg->api_open.server_if)) != NULL) {
|
||||
/* should always get the connection ID */
|
||||
if (GATT_Connect(p_rcb->gatt_if, p_msg->api_open.remote_bda, BLE_ADDR_UNKNOWN_TYPE,
|
||||
p_msg->api_open.is_direct, p_msg->api_open.transport, FALSE)) {
|
||||
p_msg->api_open.is_direct, p_msg->api_open.transport, FALSE, FALSE, 0xFF, 0xFF)) {
|
||||
status = BTA_GATT_OK;
|
||||
|
||||
if (GATT_GetConnIdIfConnected(p_rcb->gatt_if, p_msg->api_open.remote_bda,
|
||||
|
||||
@@ -130,6 +130,11 @@ typedef struct {
|
||||
tBTA_GATTC_IF client_if;
|
||||
BOOLEAN is_direct;
|
||||
BOOLEAN is_aux;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
BOOLEAN is_pawr_synced;
|
||||
UINT8 adv_handle;
|
||||
UINT8 subevent;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
tBTA_TRANSPORT transport;
|
||||
tBTA_ADDR_TYPE own_addr_type;
|
||||
UINT8 phy_mask;
|
||||
|
||||
@@ -2603,7 +2603,7 @@ static void bta_hh_le_add_dev_bg_conn(tBTA_HH_DEV_CB *p_cb, BOOLEAN check_bond)
|
||||
!p_cb->in_bg_conn && to_add) {
|
||||
/* add device into BG connection to accept remote initiated connection */
|
||||
BTA_GATTC_Enh_Open(bta_hh_cb.gatt_if, p_cb->addr, BLE_ADDR_UNKNOWN_TYPE, FALSE,
|
||||
BTA_GATT_TRANSPORT_LE, FALSE, BLE_ADDR_UNKNOWN_TYPE, 0, NULL, NULL);
|
||||
BTA_GATT_TRANSPORT_LE, FALSE, BLE_ADDR_UNKNOWN_TYPE, false, 0xFF, 0xFF, 0, NULL, NULL);
|
||||
p_cb->in_bg_conn = TRUE;
|
||||
|
||||
BTA_DmBleSetBgConnType(BTA_DM_BLE_CONN_AUTO, NULL);
|
||||
|
||||
@@ -1228,6 +1228,71 @@ typedef struct {
|
||||
tBTA_DM_SEARCH *p_data; /* Union of all search callback structures */
|
||||
} tBTA_DM_SEARCH_PARAM;
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
typedef struct {
|
||||
UINT16 conn_handle;
|
||||
UINT8 num_config_supported;
|
||||
UINT16 max_consecutive_proc_supported;
|
||||
UINT8 num_ant_supported;
|
||||
UINT8 max_ant_paths_supported;
|
||||
UINT8 roles_supported;
|
||||
UINT8 modes_supported;
|
||||
UINT8 rtt_capability;
|
||||
UINT8 rtt_aa_only_n;
|
||||
UINT8 rtt_sounding_n;
|
||||
UINT8 rtt_random_payload_n;
|
||||
UINT16 NADM_sounding_capability;
|
||||
UINT16 NADM_random_capability;
|
||||
UINT8 cs_sync_phys_supported;
|
||||
UINT16 subfeatures_supported;
|
||||
UINT16 T_IP1_times_supported;
|
||||
UINT16 T_IP2_times_supported;
|
||||
UINT16 T_FCS_times_supported;
|
||||
UINT16 T_PM_times_supported;
|
||||
UINT8 T_SW_times_supported;
|
||||
UINT8 TX_SNR_capability;
|
||||
} tBTA_DM_CS_WRITE_CACHED_REMOTE_SUPP_CAPS;
|
||||
|
||||
typedef struct {
|
||||
UINT16 conn_handle;
|
||||
UINT8 config_id;
|
||||
UINT8 create_context;
|
||||
UINT8 main_mode_type;
|
||||
UINT8 sub_mode_type;
|
||||
UINT8 min_main_mode_steps;
|
||||
UINT8 max_main_mode_steps;
|
||||
UINT8 main_mode_repetition;
|
||||
UINT8 mode_0_steps;
|
||||
UINT8 role;
|
||||
UINT8 rtt_type;
|
||||
UINT8 cs_sync_phy;
|
||||
UINT8 channel_map[10];
|
||||
UINT8 channel_map_repetition;
|
||||
UINT8 channel_selection_type;
|
||||
UINT8 ch3c_shape;
|
||||
UINT8 ch3c_jump;
|
||||
UINT8 reserved;
|
||||
} tBTA_DM_CS_CREATE_CONFIG_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
UINT16 conn_handle;
|
||||
UINT8 config_id;
|
||||
UINT16 max_procedure_len;
|
||||
UINT16 min_procedure_interval;
|
||||
UINT16 max_procedure_interval;
|
||||
UINT16 max_procedure_count;
|
||||
uint32_t min_subevent_len;
|
||||
uint32_t max_subevent_len;
|
||||
UINT8 tone_ant_config_selection;
|
||||
UINT8 phy;
|
||||
UINT8 tx_power_delta;
|
||||
UINT8 preferred_peer_antenna;
|
||||
UINT8 SNR_control_initiator;
|
||||
UINT8 SNR_control_reflector;
|
||||
} tBTA_DM_CS_SET_PROC_PARAMS;
|
||||
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
/* Search callback */
|
||||
typedef void (tBTA_DM_SEARCH_CBACK)(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data);
|
||||
|
||||
@@ -1573,6 +1638,10 @@ typedef struct {
|
||||
tBTA_DM_BLE_GAP_PHY secondary_phy;
|
||||
UINT8 sid;
|
||||
BOOLEAN scan_req_notif;
|
||||
#if (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
uint8_t primary_adv_phy_options;
|
||||
uint8_t secondary_adv_phy_options;
|
||||
#endif // (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
} tBTA_DM_BLE_GAP_EXT_ADV_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
@@ -1584,7 +1653,14 @@ typedef struct {
|
||||
typedef struct {
|
||||
UINT16 interval_min;
|
||||
UINT16 interval_max;
|
||||
UINT8 properties;
|
||||
UINT16 properties;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
UINT8 num_subevents;
|
||||
UINT8 subevent_interval;
|
||||
UINT8 rsp_slot_delay;
|
||||
UINT8 rsp_slot_spacing;
|
||||
UINT8 num_rsp_slots;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
} tBTA_DM_BLE_Periodic_Adv_Params;
|
||||
|
||||
typedef struct {
|
||||
@@ -1701,6 +1777,30 @@ typedef struct {
|
||||
#define BTA_BLE_GAP_SET_HOST_FEATURE_EVT BTM_BLE_GAP_SET_HOST_FEATURE_EVT
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#define BTA_BLE_GAP_SET_PERIODIC_ADV_SUBEVT_DATA_EVT BTM_BLE_GAP_SET_PERIODIC_ADV_SUBEVT_DATA_EVT
|
||||
#define BTA_BLE_GAP_SET_PERIODIC_ADV_RESPONSE_DATA_EVT BTM_BLE_GAP_SET_PERIODIC_ADV_RESPONSE_DATA_EVT
|
||||
#define BTA_BLE_GAP_SET_PERIODIC_SYNC_SUBEVT_EVT BTM_BLE_GAP_SET_PERIODIC_SYNC_SUBEVT_EVT
|
||||
#define BTA_BLE_GAP_PERIODIC_ADV_SUBEVT_DATA_REQUEST_EVT BTM_BLE_GAP_PERIODIC_ADV_SUBEVT_DATA_REQUEST_EVT
|
||||
#define BTA_BLE_GAP_PERIODIC_ADV_RESPONSE_REPORT_EVT BTM_BLE_GAP_PERIODIC_ADV_RESPONSE_REPORT_EVT
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
#define BTA_BLE_GAP_CS_READ_LOCAL_SUPP_CAPS_EVT BTM_BLE_GAP_CS_READ_LOCAL_SUPP_CAPS_EVT
|
||||
#define BTA_BLE_GAP_CS_WRITE_CACHED_REMOTE_SUPP_CAPS_EVT BTM_BLE_GAP_CS_WRITE_CACHED_REMOTE_SUPP_CAPS_EVT
|
||||
#define BTA_BLE_GAP_CS_SET_DEFAULT_SETTINGS_EVT BTM_BLE_GAP_CS_SET_DEFAULT_SETTINGS_EVT
|
||||
#define BTA_BLE_GAP_CS_WRITE_CACHED_REMOTE_FAE_TAB_EVT BTM_BLE_GAP_CS_WRITE_CACHED_REMOTE_FAE_TAB_EVT
|
||||
#define BTA_BLE_GAP_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT BTM_BLE_GAP_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT
|
||||
#define BTA_BLE_GAP_CS_SET_CHANNEL_CLASS_CMPL_EVT BTM_BLE_GAP_CS_SET_CHANNEL_CLASS_CMPL_EVT
|
||||
#define BTA_BLE_GAP_CS_PROC_PARAMS_CMPL_EVT BTM_BLE_GAP_CS_PROC_PARAMS_CMPL_EVT
|
||||
#define BTA_BLE_GAP_CS_PROC_ENABLE_CMPL_EVT BTM_BLE_GAP_CS_PROC_ENABLE_CMPL_EVT
|
||||
#define BTA_BLE_GAP_CS_READ_REMOTE_FAE_TABLE_CMPL_EVT BTM_BLE_GAP_CS_READ_REMOTE_FAE_TABLE_CMPL_EVT
|
||||
#define BTA_BLE_GAP_CS_SECURITY_ENABLE_CMPL_EVT BTM_BLE_GAP_CS_SECURITY_ENABLE_CMPL_EVT
|
||||
#define BTA_BLE_GAP_CS_CONFIG_CMPL_EVT BTM_BLE_GAP_CS_CONFIG_CMPL_EVT
|
||||
#define BTA_BLE_GAP_CS_SUBEVENT_RESULT_EVT BTM_BLE_GAP_CS_SUBEVENT_RESULT_EVT
|
||||
#define BTA_BLE_GAP_CS_SUBEVENT_RESULT_CONTINUE_EVT BTM_BLE_GAP_CS_SUBEVENT_RESULT_CONTINUE_EVT
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
#define BTA_DM_BLE_5_GAP_UNKNOWN_EVT BTM_BLE_5_GAP_UNKNOWN_EVT
|
||||
typedef tBTM_BLE_5_GAP_EVENT tBTA_DM_BLE_5_GAP_EVENT;
|
||||
|
||||
@@ -3094,6 +3194,28 @@ void BTA_DmBleGapSubrateReqest(uint16_t conn_handle, uint16_t subrate_min, uint1
|
||||
extern void BTA_DmBleGapSetHostFeature(uint16_t bit_num, uint8_t bit_val);
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
void BTA_DmBleGapSetPASubevtData(uint8_t adv_handle, uint8_t num_subevents_with_data, uint8_t *subevent_params);
|
||||
void BTA_DmBleGapSetPeriodicAdvRspData(uint16_t sync_handle, uint16_t request_event, uint8_t request_subevent,
|
||||
uint8_t rsp_subevent, uint8_t rsp_slot, uint8_t rsp_data_len, uint8_t *rsp_data);
|
||||
void BTA_DmBleGapSetPeriodicSyncSubevt(uint16_t sync_handle, uint16_t periodic_adv_properties, uint8_t num_subevents_to_sync, uint8_t *subevent);
|
||||
#endif// (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
void BTA_DmBleGapReadLocalSupportedCaps(void);
|
||||
void BTA_DmBleGapReadRemoteSupportedCaps(uint16_t conn_handle);
|
||||
void BTA_DmBleGapWriteCachedRemoteSupportedCaps(tBTA_DM_CS_WRITE_CACHED_REMOTE_SUPP_CAPS *write_cachedremote_supp_caps);
|
||||
void BTA_DmBleGapCsSecurityEnable(uint16_t conn_handle);
|
||||
void BTA_DmBleGapCsSetDefaultSetting(uint16_t conn_handle, uint8_t role_enable, uint8_t cs_sync_ant_selection, int8_t max_tx_power);
|
||||
void BTA_DmBleGapCsReadRemoteFaeTable(uint16_t conn_handle);
|
||||
void BTA_DmBleGapWriteCachedRemoteFaeTable(uint16_t conn_handle, uint8_t *remote_fae_table, uint8_t table_len);
|
||||
void BTA_DmBleGapCsCreateConfig(tBTA_DM_CS_CREATE_CONFIG_PARAMS *create_config_params);
|
||||
void BTA_DmBleGapCsRemoveConfig(uint16_t conn_handle, uint8_t config_id);
|
||||
void BTA_DmBleGapCsSetChannelClass(uint8_t *channel_class, uint8_t channl_len);
|
||||
void BTA_DmBleGapCsSetProcPatams(tBTA_DM_CS_SET_PROC_PARAMS *set_proc_params);
|
||||
void BTA_DmBleGapCsProcEnable(uint16_t conn_handle, uint8_t config_id, uint8_t enable);
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleSetStorageParams
|
||||
|
||||
@@ -819,6 +819,7 @@ extern void BTA_GATTC_AppDeregister (tBTA_GATTC_IF client_if);
|
||||
*******************************************************************************/
|
||||
extern void BTA_GATTC_Enh_Open(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, tBTA_ADDR_TYPE remote_addr_type,
|
||||
BOOLEAN is_direct, tBTA_GATT_TRANSPORT transport, BOOLEAN is_aux, tBTA_ADDR_TYPE own_addr_type,
|
||||
BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent,
|
||||
UINT8 phy_mask, tBTA_BLE_CONN_PARAMS *phy_1m_conn_params, tBTA_BLE_CONN_PARAMS *phy_2m_conn_params,
|
||||
tBTA_BLE_CONN_PARAMS *phy_coded_conn_params);
|
||||
|
||||
|
||||
@@ -2923,7 +2923,7 @@ void bta_jv_l2cap_connect_le(tBTA_JV_MSG *p_data)
|
||||
id = t->id;
|
||||
t->init_called = FALSE;
|
||||
|
||||
if (L2CA_ConnectFixedChnl(t->chan, t->remote_addr, BLE_ADDR_UNKNOWN_TYPE, FALSE)) {
|
||||
if (L2CA_ConnectFixedChnl(t->chan, t->remote_addr, BLE_ADDR_UNKNOWN_TYPE, FALSE, FALSE, 0xFF, 0xFF)) {
|
||||
|
||||
evt.l2c_cl_init.status = BTA_JV_SUCCESS;
|
||||
evt.l2c_cl_init.handle = id;
|
||||
|
||||
@@ -1155,6 +1155,10 @@ void btc_ble_5_gap_callback(tBTA_DM_BLE_5_GAP_EVENT event,
|
||||
#if (BLE_FEAT_CTE_EN == TRUE)
|
||||
param.period_adv_report.params.cte_type = params->period_adv_report.cte_type;
|
||||
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
param.period_adv_report.params.periodic_evt_counter = params->period_adv_report.periodic_evt_cnt;
|
||||
param.period_adv_report.params.subevt = params->period_adv_report.subevt;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
param.period_adv_report.params.data_status = params->period_adv_report.data_status;
|
||||
param.period_adv_report.params.data_length = params->period_adv_report.data_length;
|
||||
if (params->period_adv_report.data) {
|
||||
@@ -1179,6 +1183,12 @@ void btc_ble_5_gap_callback(tBTA_DM_BLE_5_GAP_EVENT event,
|
||||
param.periodic_adv_sync_estab.adv_phy = params->sync_estab.adv_phy;
|
||||
param.periodic_adv_sync_estab.period_adv_interval = params->sync_estab.period_adv_interval;
|
||||
param.periodic_adv_sync_estab.adv_clk_accuracy = params->sync_estab.adv_clk_accuracy;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
param.periodic_adv_sync_estab.num_subevt = params->sync_estab.num_subevt;
|
||||
param.periodic_adv_sync_estab.subevt_interval = params->sync_estab.subevt_interval;
|
||||
param.periodic_adv_sync_estab.rsp_slot_delay = params->sync_estab.rsp_slot_delay;
|
||||
param.periodic_adv_sync_estab.rsp_slot_spacing = params->sync_estab.rsp_slot_spacing;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
break;
|
||||
}
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
@@ -1287,12 +1297,198 @@ void btc_ble_5_gap_callback(tBTA_DM_BLE_5_GAP_EVENT event,
|
||||
param.host_feature.status = btc_btm_status_to_esp_status(params->status);
|
||||
break;
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
case BTA_BLE_GAP_SET_PERIODIC_ADV_SUBEVT_DATA_EVT:
|
||||
msg.act = ESP_GAP_BLE_SET_PERIODIC_ADV_SUBEVT_DATA_EVT;
|
||||
param.pa_subevt_data_evt.status = btc_btm_status_to_esp_status(params->pa_subevt_data_evt.status);
|
||||
param.pa_subevt_data_evt.adv_handle = params->pa_subevt_data_evt.adv_handle;
|
||||
break;
|
||||
case BTA_BLE_GAP_SET_PERIODIC_ADV_RESPONSE_DATA_EVT:
|
||||
msg.act = ESP_GAP_BLE_SET_PERIODIC_ADV_RESPONSE_DATA_EVT;
|
||||
param.pa_rsp_data_evt.status = btc_btm_status_to_esp_status(params->pa_rsp_data_evt.status);
|
||||
param.pa_rsp_data_evt.sync_handle = params->pa_rsp_data_evt.sync_handle;
|
||||
break;
|
||||
case BTA_BLE_GAP_SET_PERIODIC_SYNC_SUBEVT_EVT:
|
||||
msg.act = ESP_GAP_BLE_SET_PERIODIC_SYNC_SUBEVT_EVT;
|
||||
param.pa_sync_subevt_evt.status = btc_btm_status_to_esp_status(params->pa_sync_subevt_evt.status);
|
||||
param.pa_sync_subevt_evt.sync_handle = params->pa_sync_subevt_evt.sync_handle;
|
||||
break;
|
||||
case BTA_BLE_GAP_PERIODIC_ADV_SUBEVT_DATA_REQUEST_EVT:
|
||||
msg.act = ESP_GAP_BLE_PERIODIC_ADV_SUBEVT_DATA_REQUEST_EVT;
|
||||
param.pa_subevt_data_req_evt.adv_handle = params->pa_subevent_data_req_evt.adv_handle;
|
||||
param.pa_subevt_data_req_evt.subevt_start = params->pa_subevent_data_req_evt.subevt_start;
|
||||
param.pa_subevt_data_req_evt.subevt_data_count = params->pa_subevent_data_req_evt.subevt_data_count;
|
||||
break;
|
||||
case BTA_BLE_GAP_PERIODIC_ADV_RESPONSE_REPORT_EVT:
|
||||
msg.act = ESP_GAP_BLE_PERIODIC_ADV_RESPONSE_REPORT_EVT;
|
||||
param.pa_rsp_rpt_evt.adv_handle = params->pa_rsp_rpt_evt.adv_handle;
|
||||
param.pa_rsp_rpt_evt.subevt = params->pa_rsp_rpt_evt.subevt;
|
||||
param.pa_rsp_rpt_evt.tx_status = params->pa_rsp_rpt_evt.tx_status;
|
||||
param.pa_rsp_rpt_evt.num_rsp = params->pa_rsp_rpt_evt.num_rsp;
|
||||
param.pa_rsp_rpt_evt.pa_rsp_info = (esp_ble_pa_rsp_info *)params->pa_rsp_rpt_evt.rsp_data_info;
|
||||
break;
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
case BTA_BLE_GAP_CS_READ_LOCAL_SUPP_CAPS_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_READ_LOCAL_SUPP_CAPS_EVT;
|
||||
param.cs_read_local_supp_caps.status = params->cs_read_local_supp_caps.status;
|
||||
param.cs_read_local_supp_caps.conn_handle = params->cs_read_local_supp_caps.conn_handle;
|
||||
param.cs_read_local_supp_caps.num_config_supported = params->cs_read_local_supp_caps.num_config_supported;
|
||||
param.cs_read_local_supp_caps.max_consecutive_proc_supported = params->cs_read_local_supp_caps.max_consecutive_proc_supported;
|
||||
param.cs_read_local_supp_caps.num_ant_supported = params->cs_read_local_supp_caps.num_ant_supported;
|
||||
param.cs_read_local_supp_caps.max_ant_paths_supported= params->cs_read_local_supp_caps.max_ant_paths_supported;
|
||||
param.cs_read_local_supp_caps.roles_supported = params->cs_read_local_supp_caps.roles_supported;
|
||||
param.cs_read_local_supp_caps.modes_supported = params->cs_read_local_supp_caps.modes_supported;
|
||||
param.cs_read_local_supp_caps.rtt_capability = params->cs_read_local_supp_caps.rtt_capability;
|
||||
param.cs_read_local_supp_caps.rtt_aa_only_n = params->cs_read_local_supp_caps.rtt_aa_only_n;
|
||||
param.cs_read_local_supp_caps.rtt_sounding_n = params->cs_read_local_supp_caps.rtt_sounding_n;
|
||||
param.cs_read_local_supp_caps.rtt_random_payload_n = params->cs_read_local_supp_caps.rtt_random_payload_n;
|
||||
param.cs_read_local_supp_caps.NADM_sounding_capability = params->cs_read_local_supp_caps.NADM_sounding_capability;
|
||||
param.cs_read_local_supp_caps.NADM_random_capability = params->cs_read_local_supp_caps.NADM_random_capability;
|
||||
param.cs_read_local_supp_caps.cs_sync_phys_supported = params->cs_read_local_supp_caps.cs_sync_phys_supported;
|
||||
param.cs_read_local_supp_caps.subfeatures_supported = params->cs_read_local_supp_caps.subfeatures_supported;
|
||||
param.cs_read_local_supp_caps.T_IP1_times_supported = params->cs_read_local_supp_caps.T_IP1_times_supported;
|
||||
param.cs_read_local_supp_caps.T_IP2_times_supported = params->cs_read_local_supp_caps.T_IP2_times_supported;
|
||||
param.cs_read_local_supp_caps.T_FCS_times_supported = params->cs_read_local_supp_caps.T_FCS_times_supported;
|
||||
param.cs_read_local_supp_caps.T_PM_times_supported = params->cs_read_local_supp_caps.T_PM_times_supported;
|
||||
param.cs_read_local_supp_caps.T_SW_times_supported = params->cs_read_local_supp_caps.T_SW_times_supported;
|
||||
param.cs_read_local_supp_caps.TX_SNR_capability = params->cs_read_local_supp_caps.TX_SNR_capability;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_WRITE_CACHED_REMOTE_SUPP_CAPS_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_WRITE_CACHED_REMOTE_SUPP_CAPS_EVT;
|
||||
param.cs_write_cached_remote_supp_caps.status = params->cs_write_cached_remote_supp_caps.status;
|
||||
param.cs_write_cached_remote_supp_caps.conn_handle = params->cs_write_cached_remote_supp_caps.conn_handle;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_SET_DEFAULT_SETTINGS_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_SET_DEFAULT_SETTINGS_EVT;
|
||||
param.cs_set_default_settings.status = params->cs_set_default_settings.status;
|
||||
param.cs_set_default_settings.conn_handle = params->cs_set_default_settings.conn_handle;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_WRITE_CACHED_REMOTE_FAE_TAB_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_WRITE_CACHED_REMOTE_FAE_TABLE_EVT;
|
||||
param.cs_write_cached_remote_fae_tab.status = params->cs_write_cached_remote_fae_tab.status;
|
||||
param.cs_write_cached_remote_fae_tab.conn_handle = params->cs_write_cached_remote_fae_tab.conn_handle;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT;
|
||||
param.cs_read_remote_supp_caps.status = params->cs_read_remote_supp_caps.status;
|
||||
param.cs_read_remote_supp_caps.conn_handle = params->cs_read_remote_supp_caps.conn_handle;
|
||||
param.cs_read_remote_supp_caps.num_config_supported = params->cs_read_remote_supp_caps.num_config_supported;
|
||||
param.cs_read_remote_supp_caps.max_consecutive_proc_supported = params->cs_read_remote_supp_caps.max_consecutive_proc_supported;
|
||||
param.cs_read_remote_supp_caps.num_ant_supported = params->cs_read_remote_supp_caps.num_ant_supported;
|
||||
param.cs_read_remote_supp_caps.max_ant_paths_supported = params->cs_read_remote_supp_caps.max_ant_paths_supported;
|
||||
param.cs_read_remote_supp_caps.roles_supported = params->cs_read_remote_supp_caps.roles_supported;
|
||||
param.cs_read_remote_supp_caps.modes_supported = params->cs_read_remote_supp_caps.modes_supported;
|
||||
param.cs_read_remote_supp_caps.rtt_capability = params->cs_read_remote_supp_caps.rtt_capability;
|
||||
param.cs_read_remote_supp_caps.rtt_aa_only_n = params->cs_read_remote_supp_caps.rtt_aa_only_n;
|
||||
param.cs_read_remote_supp_caps.rtt_sounding_n = params->cs_read_remote_supp_caps.rtt_sounding_n;
|
||||
param.cs_read_remote_supp_caps.rtt_random_payload_n = params->cs_read_remote_supp_caps.rtt_random_payload_n;
|
||||
param.cs_read_remote_supp_caps.NADM_sounding_capability = params->cs_read_remote_supp_caps.NADM_sounding_capability;
|
||||
param.cs_read_remote_supp_caps.NADM_random_capability = params->cs_read_remote_supp_caps.NADM_random_capability;
|
||||
param.cs_read_remote_supp_caps.cs_sync_phys_supported = params->cs_read_remote_supp_caps.cs_sync_phys_supported;
|
||||
param.cs_read_remote_supp_caps.subfeatures_supported = params->cs_read_remote_supp_caps.subfeatures_supported;
|
||||
param.cs_read_remote_supp_caps.T_IP1_times_supported = params->cs_read_remote_supp_caps.T_IP1_times_supported;
|
||||
param.cs_read_remote_supp_caps.T_IP2_times_supported = params->cs_read_remote_supp_caps.T_IP2_times_supported;
|
||||
param.cs_read_remote_supp_caps.T_FCS_times_supported = params->cs_read_remote_supp_caps.T_FCS_times_supported;
|
||||
param.cs_read_remote_supp_caps.T_PM_times_supported = params->cs_read_remote_supp_caps.T_PM_times_supported;
|
||||
param.cs_read_remote_supp_caps.T_SW_times_supported = params->cs_read_remote_supp_caps.T_SW_times_supported;
|
||||
param.cs_read_remote_supp_caps.TX_SNR_capability = params->cs_read_remote_supp_caps.TX_SNR_capability;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_SET_CHANNEL_CLASS_CMPL_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_SET_CHANNEL_CLASS_CMPL_EVT;
|
||||
param.cs_set_channel_class.status = params->status;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_PROC_PARAMS_CMPL_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_SET_PROC_PARAMS_CMPL_EVT;
|
||||
param.cs_set_proc_params.status = params->cs_set_proc_params.status;
|
||||
param.cs_set_proc_params.conn_handle = params->cs_set_proc_params.conn_handle;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_PROC_ENABLE_CMPL_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_PROC_ENABLE_CMPL_EVT;
|
||||
param.cs_proc_enable.status = params->cs_proc_en.status;
|
||||
param.cs_proc_enable.conn_handle = params->cs_proc_en.conn_handle;
|
||||
param.cs_proc_enable.config_id = params->cs_proc_en.config_id;
|
||||
param.cs_proc_enable.state = params->cs_proc_en.state;
|
||||
param.cs_proc_enable.tone_ant_config_select = params->cs_proc_en.tone_ant_config_select;
|
||||
param.cs_proc_enable.select_tx_power = params->cs_proc_en.select_tx_power;
|
||||
param.cs_proc_enable.subevent_Len = params->cs_proc_en.subevent_Len;
|
||||
param.cs_proc_enable.subevents_per_event = params->cs_proc_en.subevents_per_event;
|
||||
param.cs_proc_enable.subevent_interval = params->cs_proc_en.subevent_interval;
|
||||
param.cs_proc_enable.event_interval = params->cs_proc_en.event_interval;
|
||||
param.cs_proc_enable.procedure_interval = params->cs_proc_en.procedure_interval;
|
||||
param.cs_proc_enable.procedure_count = params->cs_proc_en.procedure_count;
|
||||
param.cs_proc_enable.max_procedure_len = params->cs_proc_en.max_procedure_len;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_READ_REMOTE_FAE_TABLE_CMPL_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_READ_REMOTE_FAE_TABLE_CMPL_EVT;
|
||||
param.cs_read_remote_fae_tab.status = params->cs_read_remote_fae_tab.status;
|
||||
param.cs_read_remote_fae_tab.conn_handle = params->cs_read_remote_fae_tab.conn_handle;
|
||||
memcpy(param.cs_read_remote_fae_tab.remote_fae_table, params->cs_read_remote_fae_tab.remote_fae_table, 72);
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_SECURITY_ENABLE_CMPL_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_SECURITY_ENABLE_CMPL_EVT;
|
||||
param.cs_security_enable.status = params->cs_security_enable.status;
|
||||
param.cs_security_enable.conn_handle = params->cs_security_enable.conn_handle;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_CONFIG_CMPL_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_CONFIG_CMPL_EVT;
|
||||
param.cs_config_update.status = params->cs_config_update.status;
|
||||
param.cs_config_update.conn_handle = params->cs_config_update.conn_handle;
|
||||
param.cs_config_update.config_id = params->cs_config_update.config_id;
|
||||
param.cs_config_update.action = params->cs_config_update.action;
|
||||
param.cs_config_update.main_mode_type = params->cs_config_update.main_mode_type;
|
||||
param.cs_config_update.sub_mode_type = params->cs_config_update.sub_mode_type;
|
||||
param.cs_config_update.min_main_mode_steps = params->cs_config_update.min_main_mode_steps;
|
||||
param.cs_config_update.max_main_mode_steps = params->cs_config_update.max_main_mode_steps;
|
||||
param.cs_config_update.main_mode_repetition = params->cs_config_update.main_mode_repetition;
|
||||
param.cs_config_update.mode_0_steps = params->cs_config_update.mode_0_steps;
|
||||
param.cs_config_update.role = params->cs_config_update.role;
|
||||
param.cs_config_update.rtt_type = params->cs_config_update.rtt_type;
|
||||
param.cs_config_update.cs_sync_phy = params->cs_config_update.cs_sync_phy;
|
||||
memcpy(param.cs_config_update.channel_map, params->cs_config_update.channel_map, 10);
|
||||
param.cs_config_update.channel_map_repetition = params->cs_config_update.channel_map_repetition;
|
||||
param.cs_config_update.channel_selection_type = params->cs_config_update.channel_selection_type;
|
||||
param.cs_config_update.ch3c_shape = params->cs_config_update.ch3c_shape;
|
||||
param.cs_config_update.ch3c_jump = params->cs_config_update.ch3c_jump;
|
||||
param.cs_config_update.reserved = params->cs_config_update.reserved;
|
||||
param.cs_config_update.t_ip1_time = params->cs_config_update.t_ip1_time;
|
||||
param.cs_config_update.t_ip2_time = params->cs_config_update.t_ip2_time;
|
||||
param.cs_config_update.t_fcs_time = params->cs_config_update.t_fcs_time;
|
||||
param.cs_config_update.t_pm_time = params->cs_config_update.t_pm_time;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_SUBEVENT_RESULT_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_SUBEVENT_RESULT_EVT;
|
||||
param.cs_subevt_result.conn_handle = params->cs_subevt_result.conn_handle;
|
||||
param.cs_subevt_result.config_id = params->cs_subevt_result.config_id;
|
||||
param.cs_subevt_result.start_acl_conn_event_counter = params->cs_subevt_result.start_acl_conn_event_counter;
|
||||
param.cs_subevt_result.procedure_counter = params->cs_subevt_result.procedure_counter;
|
||||
param.cs_subevt_result.frequency_compensation = params->cs_subevt_result.frequency_compensation;
|
||||
param.cs_subevt_result.reference_power_level = params->cs_subevt_result.reference_power_level;
|
||||
param.cs_subevt_result.procedure_done_status = params->cs_subevt_result.procedure_done_status;
|
||||
param.cs_subevt_result.subevent_done_status = params->cs_subevt_result.subevent_done_status;
|
||||
param.cs_subevt_result.abort_reason = params->cs_subevt_result.abort_reason;
|
||||
param.cs_subevt_result.num_ant_paths = params->cs_subevt_result.num_ant_paths;
|
||||
param.cs_subevt_result.num_steps_reported = params->cs_subevt_result.num_steps_reported;
|
||||
param.cs_subevt_result.step_info = (esp_ble_cs_step_info *)params->cs_subevt_result.step_info;
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_SUBEVENT_RESULT_CONTINUE_EVT:
|
||||
msg.act = ESP_GAP_BLE_CS_SUBEVENT_RESULT_CONTINUE_EVT;
|
||||
param.cs_subevt_result_continue.conn_handle = params->cs_subevt_result_continue.conn_handle;
|
||||
param.cs_subevt_result_continue.config_id = params->cs_subevt_result_continue.config_id;
|
||||
param.cs_subevt_result_continue.proc_done_status = params->cs_subevt_result_continue.proc_done_status;
|
||||
param.cs_subevt_result_continue.subevt_done_status = params->cs_subevt_result_continue.subevt_done_status;
|
||||
param.cs_subevt_result_continue.abort_reason = params->cs_subevt_result_continue.abort_reason;
|
||||
param.cs_subevt_result_continue.num_ant_paths = params->cs_subevt_result_continue.num_ant_paths;
|
||||
param.cs_subevt_result_continue.num_steps_reported = params->cs_subevt_result_continue.num_steps_reported;
|
||||
param.cs_subevt_result_continue.step_info = (esp_ble_cs_step_info *)params->cs_subevt_result_continue.step_info;
|
||||
break;
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ret = btc_transfer_context(&msg, ¶m,
|
||||
sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
|
||||
sizeof(esp_ble_gap_cb_param_t), btc_gap_ble_cb_deep_copy, btc_gap_ble_cb_deep_free);
|
||||
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||
@@ -1978,6 +2174,60 @@ void btc_gap_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
case BTC_GAP_BLE_SET_PA_SUBEVT_DATA: {
|
||||
btc_ble_5_gap_args_t *src = (btc_ble_5_gap_args_t *)p_src;
|
||||
btc_ble_5_gap_args_t *dst = (btc_ble_5_gap_args_t *)p_dest;
|
||||
if (src->per_adv_subevent_data_params.subevent_params) {
|
||||
uint16_t params_len = src->per_adv_subevent_data_params.num_subevents_with_data * sizeof(esp_ble_subevent_params);
|
||||
dst->per_adv_subevent_data_params.subevent_params = osi_malloc(params_len);
|
||||
if (dst->per_adv_subevent_data_params.subevent_params) {
|
||||
|
||||
for (uint8_t i = 0; i < src->per_adv_subevent_data_params.num_subevents_with_data; i++)
|
||||
{
|
||||
memcpy(&dst->per_adv_subevent_data_params.subevent_params[i], &src->per_adv_subevent_data_params.subevent_params[i], params_len);
|
||||
// dst->per_adv_subevent_data_params.subevent_params[i].subevent = src->per_adv_subevent_data_params.subevent_params[i].subevent;
|
||||
// dst->per_adv_subevent_data_params.subevent_params[i].response_slot_start = src->per_adv_subevent_data_params.subevent_params[i].response_slot_start;
|
||||
// dst->per_adv_subevent_data_params.subevent_params[i].response_slot_count = src->per_adv_subevent_data_params.subevent_params[i].response_slot_count;
|
||||
// dst->per_adv_subevent_data_params.subevent_params[i].subevent_data_len = src->per_adv_subevent_data_params.subevent_params[i].subevent_data_len;
|
||||
dst->per_adv_subevent_data_params.subevent_params[i].subevent_data = osi_malloc(src->per_adv_subevent_data_params.subevent_params[i].subevent_data_len);
|
||||
if (dst->per_adv_subevent_data_params.subevent_params[i].subevent_data) {
|
||||
memcpy(dst->per_adv_subevent_data_params.subevent_params[i].subevent_data, src->per_adv_subevent_data_params.subevent_params[i].subevent_data, src->per_adv_subevent_data_params.subevent_params[i].subevent_data_len);
|
||||
} else if (src->per_adv_subevent_data_params.subevent_params[i].subevent_data_len != 0) {
|
||||
BTC_TRACE_ERROR("%s %d no mem\n",__func__, msg->act);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BTC_GAP_BLE_SET_PA_RSP_DATA: {
|
||||
btc_ble_5_gap_args_t *src = (btc_ble_5_gap_args_t *)p_src;
|
||||
btc_ble_5_gap_args_t *dst = (btc_ble_5_gap_args_t *)p_dest;
|
||||
if (src->per_adv_response_data_params.response_data && src->per_adv_response_data_params.response_data_len) {
|
||||
dst->per_adv_response_data_params.response_data = osi_malloc(src->per_adv_response_data_params.response_data_len);
|
||||
if (dst->per_adv_response_data_params.response_data) {
|
||||
memcpy(dst->per_adv_response_data_params.response_data, src->per_adv_response_data_params.response_data, src->per_adv_response_data_params.response_data_len);
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s %d no mem\n",__func__, msg->act);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BTC_GAP_BLE_SET_PA_SYNC_SUBEVT: {
|
||||
btc_ble_5_gap_args_t *src = (btc_ble_5_gap_args_t *)p_src;
|
||||
btc_ble_5_gap_args_t *dst = (btc_ble_5_gap_args_t *)p_dest;
|
||||
if (src->per_sync_subevent_params.subevent && src->per_sync_subevent_params.num_subevents_to_sync) {
|
||||
dst->per_sync_subevent_params.subevent = osi_malloc(src->per_sync_subevent_params.num_subevents_to_sync);
|
||||
if (dst->per_sync_subevent_params.subevent) {
|
||||
memcpy(dst->per_sync_subevent_params.subevent, src->per_sync_subevent_params.subevent, src->per_sync_subevent_params.num_subevents_to_sync);
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s %d no mem\n",__func__, msg->act);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
default:
|
||||
BTC_TRACE_ERROR("Unhandled deep copy %d\n", msg->act);
|
||||
break;
|
||||
@@ -2014,8 +2264,84 @@ void btc_gap_ble_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
case ESP_GAP_BLE_PERIODIC_ADV_RESPONSE_REPORT_EVT:
|
||||
if (src->pa_rsp_rpt_evt.pa_rsp_info) {
|
||||
dst->pa_rsp_rpt_evt.pa_rsp_info = osi_malloc(src->pa_rsp_rpt_evt.num_rsp * sizeof(esp_ble_pa_rsp_info));
|
||||
if (dst->pa_rsp_rpt_evt.pa_rsp_info) {
|
||||
for (UINT8 i = 0; i < src->pa_rsp_rpt_evt.num_rsp; i++)
|
||||
{
|
||||
dst->pa_rsp_rpt_evt.pa_rsp_info[i].tx_power = src->pa_rsp_rpt_evt.pa_rsp_info[i].tx_power;
|
||||
dst->pa_rsp_rpt_evt.pa_rsp_info[i].rssi = src->pa_rsp_rpt_evt.pa_rsp_info[i].rssi;
|
||||
dst->pa_rsp_rpt_evt.pa_rsp_info[i].cte_type = src->pa_rsp_rpt_evt.pa_rsp_info[i].cte_type;
|
||||
dst->pa_rsp_rpt_evt.pa_rsp_info[i].rsp_slot = src->pa_rsp_rpt_evt.pa_rsp_info[i].rsp_slot;
|
||||
dst->pa_rsp_rpt_evt.pa_rsp_info[i].data_status = src->pa_rsp_rpt_evt.pa_rsp_info[i].data_status;
|
||||
dst->pa_rsp_rpt_evt.pa_rsp_info[i].data_len = src->pa_rsp_rpt_evt.pa_rsp_info[i].data_len;
|
||||
if (src->pa_rsp_rpt_evt.pa_rsp_info[i].data_len) {
|
||||
dst->pa_rsp_rpt_evt.pa_rsp_info[i].data = osi_malloc(src->pa_rsp_rpt_evt.pa_rsp_info[i].data_len);
|
||||
if (dst->pa_rsp_rpt_evt.pa_rsp_info[i].data) {
|
||||
memcpy(dst->pa_rsp_rpt_evt.pa_rsp_info[i].data, src->pa_rsp_rpt_evt.pa_rsp_info[i].data, src->pa_rsp_rpt_evt.pa_rsp_info[i].data_len);
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s, data, no enough memory.", __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s, pa_rsp_info, no enough memory.", __func__);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
case BTA_BLE_GAP_CS_SUBEVENT_RESULT_EVT:
|
||||
if (src->cs_subevt_result.step_info) {
|
||||
dst->cs_subevt_result.step_info = osi_malloc(src->cs_subevt_result.num_steps_reported * sizeof(esp_ble_cs_step_info));
|
||||
if (dst->cs_subevt_result.step_info) {
|
||||
for (UINT8 i = 0; i < src->cs_subevt_result.num_steps_reported; i++)
|
||||
{
|
||||
dst->cs_subevt_result.step_info[i].step_mode = src->cs_subevt_result.step_info[i].step_mode;
|
||||
dst->cs_subevt_result.step_info[i].step_channel = src->cs_subevt_result.step_info[i].step_channel;
|
||||
dst->cs_subevt_result.step_info[i].step_data_len = src->cs_subevt_result.step_info[i].step_data_len;
|
||||
if (src->cs_subevt_result.step_info[i].step_data_len) {
|
||||
dst->cs_subevt_result.step_info[i].data = osi_malloc(src->cs_subevt_result.step_info[i].step_data_len);
|
||||
if (dst->cs_subevt_result.step_info[i].data) {
|
||||
memcpy(dst->cs_subevt_result.step_info[i].data, src->cs_subevt_result.step_info[i].data, src->cs_subevt_result.step_info[i].step_data_len);
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s, data, no enough memory.", __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s, pa_rsp_info, no enough memory.", __func__);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_SUBEVENT_RESULT_CONTINUE_EVT:
|
||||
if (src->cs_subevt_result_continue.step_info) {
|
||||
dst->cs_subevt_result_continue.step_info = osi_malloc(src->cs_subevt_result_continue.num_steps_reported * sizeof(esp_ble_cs_step_info));
|
||||
if (dst->cs_subevt_result_continue.step_info) {
|
||||
for (UINT8 i = 0; i < src->cs_subevt_result_continue.num_steps_reported; i++)
|
||||
{
|
||||
dst->cs_subevt_result_continue.step_info[i].step_mode = src->cs_subevt_result_continue.step_info[i].step_mode;
|
||||
dst->cs_subevt_result_continue.step_info[i].step_channel = src->cs_subevt_result_continue.step_info[i].step_channel;
|
||||
dst->cs_subevt_result_continue.step_info[i].step_data_len = src->cs_subevt_result_continue.step_info[i].step_data_len;
|
||||
if (src->cs_subevt_result_continue.step_info[i].step_data_len) {
|
||||
dst->cs_subevt_result_continue.step_info[i].data = osi_malloc(src->cs_subevt_result_continue.step_info[i].step_data_len);
|
||||
if (dst->cs_subevt_result_continue.step_info[i].data) {
|
||||
memcpy(dst->cs_subevt_result_continue.step_info[i].data, src->cs_subevt_result_continue.step_info[i].data, src->cs_subevt_result.step_info[i].step_data_len);
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s, data, no enough memory.", __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s, pa_rsp_info, no enough memory.", __func__);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
default:
|
||||
BTC_TRACE_ERROR("%s, Unhandled deep copy %d\n", __func__, msg->act);
|
||||
// BTC_TRACE_ERROR("%s, Unhandled deep copy %d\n", __func__, msg->act);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2136,6 +2462,35 @@ void btc_gap_ble_arg_deep_free(btc_msg_t *msg)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
case BTC_GAP_BLE_SET_PA_SUBEVT_DATA: {
|
||||
struct per_adv_subevent_data_params_args *per_adv_subevent_data_params = &((btc_ble_5_gap_args_t *)msg->arg)->per_adv_subevent_data_params;
|
||||
if (per_adv_subevent_data_params->subevent_params) {
|
||||
for (uint8_t i = 0; i < per_adv_subevent_data_params->num_subevents_with_data; i++)
|
||||
{
|
||||
if (per_adv_subevent_data_params->subevent_params[i].subevent_data) {
|
||||
osi_free(per_adv_subevent_data_params->subevent_params[i].subevent_data);
|
||||
}
|
||||
}
|
||||
osi_free(per_adv_subevent_data_params->subevent_params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BTC_GAP_BLE_SET_PA_RSP_DATA: {
|
||||
uint8_t *response_data = ((btc_ble_5_gap_args_t *)msg->arg)->per_adv_response_data_params.response_data;
|
||||
if (response_data) {
|
||||
osi_free(response_data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BTC_GAP_BLE_SET_PA_SYNC_SUBEVT: {
|
||||
uint8_t *subevent = ((btc_ble_5_gap_args_t *)msg->arg)->per_sync_subevent_params.subevent;
|
||||
if (subevent) {
|
||||
osi_free(subevent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
default:
|
||||
BTC_TRACE_DEBUG("Unhandled deep free %d\n", msg->act);
|
||||
break;
|
||||
@@ -2167,6 +2522,52 @@ void btc_gap_ble_cb_deep_free(btc_msg_t *msg)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
case ESP_GAP_BLE_PERIODIC_ADV_RESPONSE_REPORT_EVT:
|
||||
esp_ble_pa_rsp_info *pa_rsp_info = ((esp_ble_gap_cb_param_t *)msg->arg)->pa_rsp_rpt_evt.pa_rsp_info;
|
||||
if (pa_rsp_info) {
|
||||
uint8_t num_rsp = ((esp_ble_gap_cb_param_t *)msg->arg)->pa_rsp_rpt_evt.num_rsp;
|
||||
for (UINT8 i = 0; i < num_rsp; i++) {
|
||||
if (pa_rsp_info[i].data) {
|
||||
osi_free(pa_rsp_info[i].data);
|
||||
}
|
||||
}
|
||||
osi_free(pa_rsp_info);
|
||||
}
|
||||
break;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
case BTA_BLE_GAP_CS_SUBEVENT_RESULT_EVT:
|
||||
{
|
||||
esp_ble_cs_step_info *step_info = ((esp_ble_gap_cb_param_t *)msg->arg)->cs_subevt_result.step_info;
|
||||
if (step_info) {
|
||||
uint8_t num_step = ((esp_ble_gap_cb_param_t *)msg->arg)->cs_subevt_result.num_steps_reported;
|
||||
for (uint8_t i = 0; i < num_step; i++)
|
||||
{
|
||||
if (step_info[i].data) {
|
||||
osi_free(step_info[i].data);
|
||||
}
|
||||
}
|
||||
osi_free(step_info);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case BTA_BLE_GAP_CS_SUBEVENT_RESULT_CONTINUE_EVT:
|
||||
{
|
||||
esp_ble_cs_step_info *step_info = ((esp_ble_gap_cb_param_t *)msg->arg)->cs_subevt_result_continue.step_info;
|
||||
if (step_info) {
|
||||
uint8_t num_step = ((esp_ble_gap_cb_param_t *)msg->arg)->cs_subevt_result_continue.num_steps_reported;
|
||||
for (uint8_t i = 0; i < num_step; i++)
|
||||
{
|
||||
if (step_info[i].data) {
|
||||
osi_free(step_info[i].data);
|
||||
}
|
||||
}
|
||||
osi_free(step_info);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
default:
|
||||
BTC_TRACE_DEBUG("Unhandled deep free %d", msg->act);
|
||||
break;
|
||||
@@ -2453,7 +2854,10 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
||||
params.secondary_phy = arg_5->ext_adv_set_params.params.secondary_phy;
|
||||
params.sid = arg_5->ext_adv_set_params.params.sid;
|
||||
params.scan_req_notif = arg_5->ext_adv_set_params.params.scan_req_notif;
|
||||
|
||||
#if (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
params.primary_adv_phy_options = arg_5->ext_adv_set_params.params.primary_adv_phy_options;
|
||||
params.secondary_adv_phy_options= arg_5->ext_adv_set_params.params.secondary_adv_phy_options;
|
||||
#endif // (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
memcpy(params.peer_addr, arg_5->ext_adv_set_params.params.peer_addr, sizeof(BD_ADDR));
|
||||
|
||||
BTC_TRACE_DEBUG("BTC_GAP_BLE_SET_EXT_ADV_PARAMS");
|
||||
@@ -2517,6 +2921,13 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
||||
params.interval_min = arg_5->peridic_adv_set_params.params.interval_min;
|
||||
params.interval_max = arg_5->peridic_adv_set_params.params.interval_max;
|
||||
params.properties = arg_5->peridic_adv_set_params.params.properties;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
params.num_subevents = arg_5->peridic_adv_set_params.params.num_subevents;
|
||||
params.subevent_interval = arg_5->peridic_adv_set_params.params.subevent_interval;
|
||||
params.rsp_slot_delay = arg_5->peridic_adv_set_params.params.rsp_slot_delay;
|
||||
params.rsp_slot_spacing = arg_5->peridic_adv_set_params.params.rsp_slot_spacing;
|
||||
params.num_rsp_slots = arg_5->peridic_adv_set_params.params.num_rsp_slots;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
BTC_TRACE_DEBUG("BTC_GAP_BLE_SET_PERIODIC_ADV_PARAMS");
|
||||
BTA_DmBleGapPeriodicAdvSetParams(arg_5->peridic_adv_set_params.instance,
|
||||
¶ms);
|
||||
@@ -2725,6 +3136,57 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
||||
BTA_DmBleGapSetHostFeature(arg_5->set_host_feature_params.bit_num, arg_5->set_host_feature_params.bit_val);
|
||||
break;
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
case BTC_GAP_BLE_SET_PA_SUBEVT_DATA:
|
||||
BTA_DmBleGapSetPASubevtData(arg_5->per_adv_subevent_data_params.adv_handle, arg_5->per_adv_subevent_data_params.num_subevents_with_data, (uint8_t *)(arg_5->per_adv_subevent_data_params.subevent_params));
|
||||
break;
|
||||
case BTC_GAP_BLE_SET_PA_RSP_DATA:
|
||||
BTA_DmBleGapSetPeriodicAdvRspData(arg_5->per_adv_response_data_params.sync_handle, arg_5->per_adv_response_data_params.request_event, arg_5->per_adv_response_data_params.request_subevent,
|
||||
arg_5->per_adv_response_data_params.response_subevent, arg_5->per_adv_response_data_params.response_slot, arg_5->per_adv_response_data_params.response_data_len, arg_5->per_adv_response_data_params.response_data);
|
||||
break;
|
||||
case BTC_GAP_BLE_SET_PA_SYNC_SUBEVT:
|
||||
BTA_DmBleGapSetPeriodicSyncSubevt(arg_5->per_sync_subevent_params.sync_handle, arg_5->per_sync_subevent_params.periodic_adv_properties, arg_5->per_sync_subevent_params.num_subevents_to_sync, arg_5->per_sync_subevent_params.subevent);
|
||||
break;
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
case BTC_GAP_BLE_CS_READ_LOCAL_SUPPORTED_CAPS:
|
||||
BTA_DmBleGapReadLocalSupportedCaps();
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_READ_REMOTE_SUPPORTED_CAPS:
|
||||
BTA_DmBleGapReadRemoteSupportedCaps(arg_5->cs_read_remote_supp_caps.conn_handle);
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPS:
|
||||
BTA_DmBleGapWriteCachedRemoteSupportedCaps((tBTA_DM_CS_WRITE_CACHED_REMOTE_SUPP_CAPS *)&arg_5->cs_write_cached_remote_supp_caps);
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_SECURITY_ENABLE:
|
||||
BTA_DmBleGapCsSecurityEnable(arg_5->cs_security_enable.conn_handle);
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_SET_DEFAULT_SETTINGS:
|
||||
BTA_DmBleGapCsSetDefaultSetting(arg_5->cs_set_default_settings_params.conn_handle, arg_5->cs_set_default_settings_params.role_enable,
|
||||
arg_5->cs_set_default_settings_params.cs_sync_ant_selection, arg_5->cs_set_default_settings_params.max_tx_power);
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_READ_REMOTE_FAE_TABLE:
|
||||
BTA_DmBleGapCsReadRemoteFaeTable(arg_5->cs_read_remote_tab.conn_handle);
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_WRITE_CACHED_REMOTE_FAE_TABLE:
|
||||
BTA_DmBleGapWriteCachedRemoteFaeTable(arg_5->cs_write_cached_remote_fae_table_params.conn_handle, &arg_5->cs_write_cached_remote_fae_table_params.remote_fae_table[0], 72);
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_CREATE_CONFIG:
|
||||
BTA_DmBleGapCsCreateConfig((tBTA_DM_CS_CREATE_CONFIG_PARAMS*)&arg_5->cs_create_config_params);
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_REMOVE_CONFIG:
|
||||
BTA_DmBleGapCsRemoveConfig(arg_5->cs_remove_config_params.conn_handle, arg_5->cs_remove_config_params.config_id);
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_SET_CAHNNEL_CLASSIFICATION:
|
||||
BTA_DmBleGapCsSetChannelClass(&arg_5->cs_set_channel_class_params.channel_class[0], 10);
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_SET_PROCEDURE_PARAMS:
|
||||
BTA_DmBleGapCsSetProcPatams((tBTA_DM_CS_SET_PROC_PARAMS *)&arg_5->cs_set_procedure_params);
|
||||
break;
|
||||
case BTC_GAP_BLE_CS_PROCEDURE_ENABLE:
|
||||
BTA_DmBleGapCsProcEnable(arg_5->cs_procedure_enable_params.conn_handle, arg_5->cs_procedure_enable_params.config_id, arg_5->cs_procedure_enable_params.enable);
|
||||
break;
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -213,12 +213,21 @@ static void btc_gattc_app_unregister(btc_ble_gattc_args_t *arg)
|
||||
static void btc_gattc_open(btc_ble_gattc_args_t *arg)
|
||||
{
|
||||
tBTA_GATT_TRANSPORT transport = BTA_GATT_TRANSPORT_LE;
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
BTA_GATTC_Enh_Open(arg->open.gattc_if, arg->open.remote_bda,
|
||||
arg->open.remote_addr_type, arg->open.is_direct,
|
||||
transport, arg->open.is_aux, arg->open.own_addr_type,
|
||||
arg->open.is_pawr_synced, arg->open.adv_handle, arg->open.subevent,
|
||||
arg->open.phy_mask, (void *)&arg->open.phy_1m_conn_params,
|
||||
(void *)&arg->open.phy_2m_conn_params, (void *)&arg->open.phy_coded_conn_params);
|
||||
#else
|
||||
BTA_GATTC_Enh_Open(arg->open.gattc_if, arg->open.remote_bda,
|
||||
arg->open.remote_addr_type, arg->open.is_direct,
|
||||
transport, arg->open.is_aux, arg->open.own_addr_type,
|
||||
false, 0xff, 0xff,
|
||||
arg->open.phy_mask, (void *)&arg->open.phy_1m_conn_params,
|
||||
(void *)&arg->open.phy_2m_conn_params, (void *)&arg->open.phy_coded_conn_params);
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
}
|
||||
|
||||
static void btc_gattc_close(btc_ble_gattc_args_t *arg)
|
||||
|
||||
@@ -141,6 +141,25 @@ typedef enum {
|
||||
BTC_GAP_ACT_SET_HOST_FEATURE,
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
BTC_GAP_BLE_READ_CHANNEL_MAP,
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
BTC_GAP_BLE_SET_PA_SUBEVT_DATA,
|
||||
BTC_GAP_BLE_SET_PA_RSP_DATA,
|
||||
BTC_GAP_BLE_SET_PA_SYNC_SUBEVT,
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
BTC_GAP_BLE_CS_READ_LOCAL_SUPPORTED_CAPS,
|
||||
BTC_GAP_BLE_CS_READ_REMOTE_SUPPORTED_CAPS,
|
||||
BTC_GAP_BLE_CS_WRITE_CACHED_REMOTE_SUPPORTED_CAPS,
|
||||
BTC_GAP_BLE_CS_SECURITY_ENABLE,
|
||||
BTC_GAP_BLE_CS_SET_DEFAULT_SETTINGS,
|
||||
BTC_GAP_BLE_CS_READ_REMOTE_FAE_TABLE,
|
||||
BTC_GAP_BLE_CS_WRITE_CACHED_REMOTE_FAE_TABLE,
|
||||
BTC_GAP_BLE_CS_CREATE_CONFIG,
|
||||
BTC_GAP_BLE_CS_REMOVE_CONFIG,
|
||||
BTC_GAP_BLE_CS_SET_CAHNNEL_CLASSIFICATION,
|
||||
BTC_GAP_BLE_CS_SET_PROCEDURE_PARAMS,
|
||||
BTC_GAP_BLE_CS_PROCEDURE_ENABLE,
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
} btc_gap_ble_act_t;
|
||||
|
||||
/* btc_ble_gap_args_t */
|
||||
@@ -531,9 +550,136 @@ typedef union {
|
||||
} subrate_req_param;
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
struct set_host_feature_arg {
|
||||
uint16_t bit_num;
|
||||
uint8_t bit_val;
|
||||
} set_host_feature_params;
|
||||
uint16_t bit_num;
|
||||
uint8_t bit_val;
|
||||
} set_host_feature_params;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
// BTC_GAP_BLE_SET_PA_SUBEVT_DATA
|
||||
struct per_adv_subevent_data_params_args {
|
||||
uint8_t adv_handle;
|
||||
uint8_t num_subevents_with_data;
|
||||
esp_ble_subevent_params *subevent_params;
|
||||
} per_adv_subevent_data_params;
|
||||
// BTC_GAP_BLE_SET_PA_RSP_DATA
|
||||
struct per_adv_response_data_params_args {
|
||||
uint16_t sync_handle;
|
||||
uint16_t request_event;
|
||||
uint8_t request_subevent;
|
||||
uint8_t response_subevent;
|
||||
uint8_t response_slot;
|
||||
uint8_t response_data_len;
|
||||
uint8_t *response_data;
|
||||
} per_adv_response_data_params;
|
||||
// BTC_GAP_BLE_SET_PA_SYNC_SUBEVT
|
||||
struct per_sync_subevent_params_args {
|
||||
uint16_t sync_handle;
|
||||
uint16_t periodic_adv_properties;
|
||||
uint8_t num_subevents_to_sync;
|
||||
uint8_t *subevent;
|
||||
} per_sync_subevent_params;
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
struct cs_read_remote_supp_caps_args {
|
||||
uint16_t conn_handle;
|
||||
} cs_read_remote_supp_caps;
|
||||
|
||||
struct cs_write_cached_remote_supp_caps_args {
|
||||
uint16_t conn_handle;
|
||||
uint8_t num_config_supported;
|
||||
uint16_t max_consecutive_proc_supported;
|
||||
uint8_t num_ant_supported;
|
||||
uint8_t max_ant_paths_supported;
|
||||
uint8_t roles_supported;
|
||||
uint8_t modes_supported;
|
||||
uint8_t rtt_capability;
|
||||
uint8_t rtt_aa_only_n;
|
||||
uint8_t rtt_sounding_n;
|
||||
uint8_t rtt_random_payload_n;
|
||||
uint16_t NADM_sounding_capability;
|
||||
uint16_t NADM_random_capability;
|
||||
uint8_t cs_sync_phys_supported;
|
||||
uint16_t subfeatures_supported;
|
||||
uint16_t T_IP1_times_supported;
|
||||
uint16_t T_IP2_times_supported;
|
||||
uint16_t T_FCS_times_supported;
|
||||
uint16_t T_PM_times_supported;
|
||||
uint8_t T_SW_times_supported;
|
||||
uint8_t TX_SNR_capability;
|
||||
} cs_write_cached_remote_supp_caps;
|
||||
|
||||
struct cs_security_enable_args {
|
||||
uint16_t conn_handle;
|
||||
} cs_security_enable;
|
||||
|
||||
struct cs_set_default_settings_params_args {
|
||||
uint16_t conn_handle;
|
||||
uint8_t role_enable;
|
||||
uint8_t cs_sync_ant_selection;
|
||||
int8_t max_tx_power;
|
||||
} cs_set_default_settings_params;
|
||||
|
||||
struct cs_read_remote_tab_args {
|
||||
uint16_t conn_handle;
|
||||
} cs_read_remote_tab;
|
||||
|
||||
struct cs_write_cached_remote_fae_table_params_args {
|
||||
uint16_t conn_handle;
|
||||
uint8_t remote_fae_table[72];
|
||||
} cs_write_cached_remote_fae_table_params;
|
||||
|
||||
struct cs_create_config_params_args {
|
||||
uint16_t conn_handle;
|
||||
uint8_t config_id;
|
||||
uint8_t create_context;
|
||||
uint8_t main_mode_type;
|
||||
uint8_t sub_mode_type;
|
||||
uint8_t min_main_mode_steps;
|
||||
uint8_t max_main_mode_steps;
|
||||
uint8_t main_mode_repetition;
|
||||
uint8_t mode_0_steps;
|
||||
uint8_t role;
|
||||
uint8_t rtt_type;
|
||||
uint8_t cs_sync_phy;
|
||||
uint8_t channel_map[10];
|
||||
uint8_t channel_map_repetition;
|
||||
uint8_t channel_selection_type;
|
||||
uint8_t ch3c_shape;
|
||||
uint8_t ch3c_jump;
|
||||
uint8_t reserved;
|
||||
} cs_create_config_params;
|
||||
|
||||
struct cs_remove_config_params_args {
|
||||
uint16_t conn_handle;
|
||||
uint8_t config_id;
|
||||
} cs_remove_config_params;
|
||||
|
||||
struct cs_set_channel_class_params_args {
|
||||
uint8_t channel_class[10];
|
||||
} cs_set_channel_class_params;
|
||||
|
||||
struct cs_set_procedure_params_args {
|
||||
uint16_t conn_handle;
|
||||
uint8_t config_id;
|
||||
uint16_t max_procedure_len;
|
||||
uint16_t min_procedure_interval;
|
||||
uint16_t max_procedure_interval;
|
||||
uint16_t max_procedure_count;
|
||||
uint32_t min_subevent_len;
|
||||
uint32_t max_subevent_len;
|
||||
uint8_t tone_ant_config_selection;
|
||||
uint8_t phy;
|
||||
uint8_t tx_power_delta;
|
||||
uint8_t preferred_peer_antenna;
|
||||
uint8_t SNR_control_initiator;
|
||||
uint8_t SNR_control_reflector;
|
||||
} cs_set_procedure_params;
|
||||
|
||||
struct cs_procedure_enable_params_args {
|
||||
uint16_t conn_handle;
|
||||
uint8_t config_id;
|
||||
uint8_t enable;
|
||||
} cs_procedure_enable_params;
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
} btc_ble_5_gap_args_t;
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
|
||||
@@ -58,6 +58,9 @@ typedef union {
|
||||
bool is_direct;
|
||||
bool is_aux;
|
||||
esp_ble_addr_type_t own_addr_type;
|
||||
bool is_pawr_synced;
|
||||
uint8_t adv_handle;
|
||||
uint8_t subevent;
|
||||
esp_ble_phy_mask_t phy_mask;
|
||||
esp_ble_conn_params_t phy_1m_conn_params;
|
||||
esp_ble_conn_params_t phy_2m_conn_params;
|
||||
|
||||
@@ -364,6 +364,24 @@
|
||||
#define UC_BT_BLE_FEAT_CONN_SUBRATING FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_FEAT_PAWR_EN
|
||||
#define UC_BT_BLE_FEAT_PAWR_EN CONFIG_BT_BLE_FEAT_PAWR_EN
|
||||
#else
|
||||
#define UC_BT_BLE_FEAT_PAWR_EN FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_FEAT_ADV_CODING_SELECTION
|
||||
#define UC_BT_BLE_FEAT_ADV_CODING_SELECTION CONFIG_BT_BLE_FEAT_ADV_CODING_SELECTION
|
||||
#else
|
||||
#define UC_BT_BLE_FEAT_ADV_CODING_SELECTION FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_FEAT_CHANNEL_SOUNDING
|
||||
#define UC_BT_BLE_FEAT_CHANNEL_SOUNDING CONFIG_BT_BLE_FEAT_CHANNEL_SOUNDING
|
||||
#else
|
||||
#define UC_BT_BLE_FEAT_CHANNEL_SOUNDING FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_VENDOR_HCI_EN
|
||||
#define UC_BT_BLE_VENDOR_HCI_EN CONFIG_BT_BLE_VENDOR_HCI_EN
|
||||
#else
|
||||
@@ -568,6 +586,12 @@
|
||||
#define UC_BT_GATTS_APPEARANCE_WRITABLE FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_GATTS_SECURITY_LEVELS_CHAR
|
||||
#define UC_BT_GATTS_SECURITY_LEVELS_CHAR CONFIG_BT_GATTS_SECURITY_LEVELS_CHAR
|
||||
#else
|
||||
#define UC_BT_GATTS_SECURITY_LEVELS_CHAR FALSE
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN
|
||||
#define UC_BT_BLE_ACT_SCAN_REP_ADV_SCAN CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN
|
||||
#else
|
||||
|
||||
@@ -415,6 +415,24 @@
|
||||
#define BLE_FEAT_CONN_SUBRATING FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#define BT_BLE_FEAT_PAWR_EN TRUE
|
||||
#else
|
||||
#define BT_BLE_FEAT_PAWR_EN FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
#define BT_BLE_FEAT_ADV_CODING_SELECTION TRUE
|
||||
#else
|
||||
#define BT_BLE_FEAT_ADV_CODING_SELECTION FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
#define BT_BLE_FEAT_CHANNEL_SOUNDING TRUE
|
||||
#else
|
||||
#define BT_BLE_FEAT_CHANNEL_SOUNDING FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_BLE_VENDOR_HCI_EN == TRUE)
|
||||
#define BLE_VENDOR_HCI_EN TRUE
|
||||
#else
|
||||
@@ -786,6 +804,12 @@
|
||||
#define GATTS_APPEARANCE_WRITABLE FALSE
|
||||
#endif
|
||||
|
||||
#if (UC_BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
#define BT_GATTS_SECURITY_LEVELS_CHAR TRUE
|
||||
#else
|
||||
#define BT_GATTS_SECURITY_LEVELS_CHAR FALSE
|
||||
#endif
|
||||
|
||||
#ifdef UC_BT_BLE_ACT_SCAN_REP_ADV_SCAN
|
||||
#define BTM_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY UC_BT_BLE_ACT_SCAN_REP_ADV_SCAN
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "osi/future.h"
|
||||
#include "config/stack_config.h"
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
const bt_event_mask_t BLE_EVENT_MASK = { "\x00\x00\x00\x07\xff\xff\xff\xff" };
|
||||
const bt_event_mask_t BLE_EVENT_MASK = { "\x00\x00\x00\xff\xff\xff\xff\xff" };
|
||||
#else
|
||||
const bt_event_mask_t BLE_EVENT_MASK = { "\x00\x00\x00\x00\x00\x00\x06\x7f" };
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
@@ -401,7 +401,18 @@ tBTM_STATUS BTM_BleSetExtendedAdvParams(UINT8 instance, tBTM_BLE_GAP_EXT_ADV_PAR
|
||||
#else
|
||||
btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type = params->own_addr_type;
|
||||
#endif
|
||||
|
||||
#if (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
if ((err = btsnd_hcic_ble_set_ext_adv_params_v2(instance, params->type, params->interval_min, params->interval_max,
|
||||
params->channel_map, params->own_addr_type, params->peer_addr_type,
|
||||
params->peer_addr, params->filter_policy, params->tx_power,
|
||||
params->primary_phy, params->max_skip,
|
||||
params->secondary_phy, params->sid, params->scan_req_notif,
|
||||
params->primary_adv_phy_options, params->secondary_adv_phy_options)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("LE EA SetParams: cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
goto end;
|
||||
}
|
||||
#else
|
||||
if ((err = btsnd_hcic_ble_set_ext_adv_params(instance, params->type, params->interval_min, params->interval_max,
|
||||
params->channel_map, params->own_addr_type, params->peer_addr_type,
|
||||
params->peer_addr, params->filter_policy, params->tx_power,
|
||||
@@ -411,6 +422,7 @@ tBTM_STATUS BTM_BleSetExtendedAdvParams(UINT8 instance, tBTM_BLE_GAP_EXT_ADV_PAR
|
||||
status = BTM_HCI_ERROR | err;
|
||||
goto end;
|
||||
}
|
||||
#endif // (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
|
||||
extend_adv_cb.inst[instance].configured = true;
|
||||
|
||||
@@ -692,7 +704,6 @@ tBTM_STATUS BTM_BlePeriodicAdvSetParams(UINT8 instance, tBTM_BLE_Periodic_Adv_Pa
|
||||
tBTM_STATUS status = BTM_SUCCESS;
|
||||
tHCI_STATUS err = HCI_SUCCESS;
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
//ext_adv_flag = true;
|
||||
|
||||
if (instance >= MAX_BLE_ADV_INSTANCE) {
|
||||
status = BTM_ILLEGAL_VALUE;
|
||||
@@ -710,11 +721,20 @@ tBTM_STATUS BTM_BlePeriodicAdvSetParams(UINT8 instance, tBTM_BLE_Periodic_Adv_Pa
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((err= btsnd_hcic_ble_set_periodic_adv_params(instance, params->interval_min,
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
if ((err = btsnd_hcic_ble_set_periodic_adv_params_v2(instance, params->interval_min, params->interval_max,
|
||||
params->properties, params->num_subevents, params->subevent_interval,
|
||||
params->rsp_slot_delay, params->rsp_slot_spacing, params->num_rsp_slots)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("LE PA SetParams_V2: cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
#else
|
||||
if ((err = btsnd_hcic_ble_set_periodic_adv_params(instance, params->interval_min,
|
||||
params->interval_max, params->properties)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("LE PA SetParams: cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
end:
|
||||
|
||||
@@ -1735,3 +1755,352 @@ tBTM_STATUS BTM_BleSetHostFeature(uint16_t bit_num, uint8_t bit_val)
|
||||
return status;
|
||||
}
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
void BTM_BleSetPaSubeventData(UINT8 adv_handle, UINT8 num_subevents_with_data, uint8_t *subevent_params)
|
||||
{
|
||||
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_periodic_adv_subevt_data(adv_handle, num_subevents_with_data, (ble_subevent_params *)subevent_params)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err = 0x%x", __func__, err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.pa_subevt_data_evt.status = status;
|
||||
cb_params.pa_subevt_data_evt.adv_handle = adv_handle;
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_SET_PERIODIC_ADV_SUBEVT_DATA_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void BTM_BleSetPaResponseData(UINT16 sync_handle, UINT16 req_evt, UINT8 req_subevt, UINT8 rsp_subevt, UINT8 rsp_slot, UINT8 rsp_data_len, UINT8 *rsp_data)
|
||||
{
|
||||
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_periodic_adv_rsp_data(sync_handle, req_evt, req_subevt, rsp_subevt, rsp_slot, rsp_data_len, rsp_data)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err = 0x%x", __func__, err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.pa_rsp_data_evt.status = status;
|
||||
cb_params.pa_rsp_data_evt.sync_handle = sync_handle;
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_SET_PERIODIC_ADV_RESPONSE_DATA_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void BTM_BleSetPaSyncSubevt(UINT16 sync_handle, UINT16 periodic_adv_properties, UINT8 num_subevents_to_sync, UINT8 *subevt)
|
||||
{
|
||||
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_periodic_sync_subevt(sync_handle, periodic_adv_properties, num_subevents_to_sync, subevt)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err = 0x%x", __func__, err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.pa_sync_subevt_evt.status = status;
|
||||
cb_params.pa_sync_subevt_evt.sync_handle = sync_handle;
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_SET_PERIODIC_SYNC_SUBEVT_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void btm_ble_pa_subevt_data_req_evt(tBTM_BLE_PA_SUBEVT_DATA_REQ_EVT *params)
|
||||
{
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_PERIODIC_ADV_SUBEVT_DATA_REQUEST_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)params);
|
||||
}
|
||||
|
||||
void btm_ble_pa_rsp_rpt_evt(tBTM_BLE_PA_RSP_REPORT_EVT *params)
|
||||
{
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_PERIODIC_ADV_RESPONSE_REPORT_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)params);
|
||||
}
|
||||
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
void BTM_BleCSReadLocalSuppCaps(void)
|
||||
{
|
||||
btsnd_hcic_ble_cs_read_local_supported_caps();
|
||||
}
|
||||
|
||||
void btm_ble_cs_read_local_supp_caps_cmpl_evt(uint8_t *p)
|
||||
{
|
||||
tBTM_BLE_5_GAP_CB_PARAMS cb_params = {0};
|
||||
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.status, p);
|
||||
if (cb_params.cs_read_local_supp_caps.status != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err = 0x%x", __func__, cb_params.cs_read_local_supp_caps.status);
|
||||
cb_params.cs_read_local_supp_caps.status |= BTM_HCI_ERROR;
|
||||
goto _error;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT16(cb_params.cs_read_local_supp_caps.conn_handle, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.num_config_supported, p);
|
||||
STREAM_TO_UINT16(cb_params.cs_read_local_supp_caps.max_consecutive_proc_supported, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.num_ant_supported, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.max_ant_paths_supported, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.roles_supported, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.modes_supported, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.rtt_capability, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.rtt_aa_only_n, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.rtt_sounding_n, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.rtt_random_payload_n, p);
|
||||
STREAM_TO_UINT16(cb_params.cs_read_local_supp_caps.NADM_sounding_capability, p);
|
||||
STREAM_TO_UINT16(cb_params.cs_read_local_supp_caps.NADM_random_capability, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.cs_sync_phys_supported, p);
|
||||
STREAM_TO_UINT16(cb_params.cs_read_local_supp_caps.subfeatures_supported, p);
|
||||
STREAM_TO_UINT16(cb_params.cs_read_local_supp_caps.T_IP1_times_supported, p);
|
||||
STREAM_TO_UINT16(cb_params.cs_read_local_supp_caps.T_IP2_times_supported, p);
|
||||
STREAM_TO_UINT16(cb_params.cs_read_local_supp_caps.T_FCS_times_supported, p);
|
||||
STREAM_TO_UINT16(cb_params.cs_read_local_supp_caps.T_PM_times_supported, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.T_SW_times_supported, p);
|
||||
STREAM_TO_UINT8(cb_params.cs_read_local_supp_caps.TX_SNR_capability, p);
|
||||
|
||||
_error:
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_READ_LOCAL_SUPP_CAPS_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void BTM_BleCSReadRemoteSuppCaps(UINT16 conn_handle)
|
||||
{
|
||||
btsnd_hcic_ble_cs_read_remote_supported_capabilities(conn_handle);
|
||||
}
|
||||
|
||||
void btm_ble_cs_read_remote_supp_caps_cmd_status(UINT8 status)
|
||||
{
|
||||
if (status != HCI_SUCCESS) {
|
||||
tBTM_BLE_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT cs_read_remote_supp_caps = {0};
|
||||
cs_read_remote_supp_caps.status = (status | BTM_HCI_ERROR);
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)&cs_read_remote_supp_caps);
|
||||
}
|
||||
}
|
||||
|
||||
void BTM_BleGapWriteCachedRemoteSupportedCaps(UINT16 conn_handle, UINT8 num_config_supported, UINT16 max_consecutive_proc_supported,
|
||||
UINT8 num_ant_supported, UINT8 max_ant_paths_supported, UINT8 roles_supported,
|
||||
UINT8 modes_supported, UINT8 rtt_capability, UINT8 rtt_aa_only_n,
|
||||
UINT8 rtt_sounding_n, UINT8 rtt_random_payload_n, UINT16 NADM_sounding_capability,
|
||||
UINT16 NADM_random_capability, UINT8 cs_sync_phys_supported, UINT16 subfeatures_supported,
|
||||
UINT16 T_IP1_times_supported, UINT16 T_IP2_times_supported, UINT16 T_FCS_times_supported,
|
||||
UINT16 T_PM_times_supported, UINT8 T_SW_times_supported, UINT8 TX_SNR_capability)
|
||||
{
|
||||
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_write_cached_remote_supported_capabilities(conn_handle, num_config_supported, max_consecutive_proc_supported,
|
||||
num_ant_supported, max_ant_paths_supported, roles_supported,
|
||||
modes_supported, rtt_capability, rtt_aa_only_n,
|
||||
rtt_sounding_n, rtt_random_payload_n, NADM_sounding_capability,
|
||||
NADM_random_capability, cs_sync_phys_supported, subfeatures_supported,
|
||||
T_IP1_times_supported, T_IP2_times_supported, T_FCS_times_supported,
|
||||
T_PM_times_supported, T_SW_times_supported, TX_SNR_capability)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("cs write cached remote support caps, cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.cs_write_cached_remote_supp_caps.status = status;
|
||||
cb_params.cs_write_cached_remote_supp_caps.conn_handle = conn_handle;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_WRITE_CACHED_REMOTE_SUPP_CAPS_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void BTM_BleGapCsSecurityEnable(UINT16 conn_handle)
|
||||
{
|
||||
btsnd_hcic_ble_cs_security_enable(conn_handle);
|
||||
}
|
||||
|
||||
void btm_ble_cs_security_enable_cmd_status(UINT8 status)
|
||||
{
|
||||
tBTM_BLE_CS_SEC_ENABLE_CMPL_EVT cs_security_enable = {0};
|
||||
if (status != HCI_SUCCESS) {
|
||||
cs_security_enable.status = (status | BTM_HCI_ERROR);
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_SECURITY_ENABLE_CMPL_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)&cs_security_enable);
|
||||
}
|
||||
}
|
||||
|
||||
void BTM_BleGapCsSetDefaultSetting(UINT16 conn_handle, UINT8 role_enable, UINT8 cs_sync_ant_selection, INT8 max_tx_power)
|
||||
{
|
||||
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_settings(conn_handle, role_enable, cs_sync_ant_selection, max_tx_power)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("cs set default setting, cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.cs_set_default_settings.status = status;
|
||||
cb_params.cs_set_default_settings.conn_handle = conn_handle;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_SET_DEFAULT_SETTINGS_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void BTM_BleGapCsReadRemoteFaeTable(UINT16 conn_handle)
|
||||
{
|
||||
btsnd_hcic_ble_cs_read_remote_fae_table(conn_handle);
|
||||
}
|
||||
|
||||
void btm_ble_cs_read_remote_fae_table_cmd_status(UINT8 status)
|
||||
{
|
||||
tBTM_BLE_CS_READ_REMOTE_FAE_TAB_CMPL_EVT cs_read_remote_fae_tab = {0};
|
||||
if (status != HCI_SUCCESS) {
|
||||
cs_read_remote_fae_tab.status = (status | BTM_HCI_ERROR);
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_READ_REMOTE_FAE_TABLE_CMPL_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)&cs_read_remote_fae_tab);
|
||||
}
|
||||
}
|
||||
|
||||
void BTM_BleGapWriteCachedRemoteFaeTable(UINT16 conn_handle, UINT8 *remote_fae_table)
|
||||
{
|
||||
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_write_cached_remote_fae_table(conn_handle, remote_fae_table)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("cs write cached remote fae tab, cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.cs_write_cached_remote_fae_tab.status = status;
|
||||
cb_params.cs_write_cached_remote_fae_tab.conn_handle = conn_handle;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_WRITE_CACHED_REMOTE_FAE_TAB_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void BTM_BleGapCsCreateConfig(UINT16 conn_handle, UINT8 config_id, UINT8 create_context,
|
||||
UINT8 main_mode_type, UINT8 sub_mode_type, UINT8 min_main_mode_steps,
|
||||
UINT8 max_main_mode_steps, UINT8 main_mode_repetition, UINT8 mode_0_steps,
|
||||
UINT8 role, UINT8 rtt_type, UINT8 cs_sync_phy, UINT8 *channel_map,
|
||||
UINT8 channel_map_repetition, UINT8 channel_selection_type, UINT8 ch3c_shape,
|
||||
UINT8 ch3c_jump,UINT8 reserved)
|
||||
{
|
||||
btsnd_hcic_ble_cs_create_config(conn_handle, config_id, create_context,
|
||||
main_mode_type, sub_mode_type, min_main_mode_steps,
|
||||
max_main_mode_steps, main_mode_repetition, mode_0_steps,
|
||||
role, rtt_type, cs_sync_phy, channel_map,
|
||||
channel_map_repetition, channel_selection_type, ch3c_shape,
|
||||
ch3c_jump, reserved);
|
||||
}
|
||||
|
||||
void BTM_BleGapCsRemoveConfig(UINT16 conn_handle, UINT8 config_id)
|
||||
{
|
||||
btsnd_hcic_ble_cs_remove_config(conn_handle, config_id);
|
||||
}
|
||||
|
||||
void btm_ble_cs_update_config_cmd_status(UINT8 status, BOOLEAN create)
|
||||
{
|
||||
tBTM_BLE_CS_CONFIG_CMPL_EVT config_cmpl = {0};
|
||||
if (status != HCI_SUCCESS) {
|
||||
config_cmpl.status = (status | BTM_HCI_ERROR);
|
||||
config_cmpl.action = (create? 0x01:0x00);
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_CONFIG_CMPL_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)&config_cmpl);
|
||||
}
|
||||
}
|
||||
|
||||
void BTM_BleGapCsSetChannelClass(UINT8 *channel_class)
|
||||
{
|
||||
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_channel_classification(channel_class)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("cs set channel class, cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.status = status;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_SET_CHANNEL_CLASS_CMPL_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void BTM_BleGapCsSetProcPatams(UINT16 conn_handle, UINT8 config_id, UINT16 max_procedure_len,
|
||||
UINT16 min_procedure_interval, UINT16 max_procedure_interval,
|
||||
UINT16 max_procedure_count, UINT32 min_subevent_len,
|
||||
UINT32 max_subevent_len, UINT8 tone_ant_config_selection,
|
||||
UINT8 phy, UINT8 tx_power_delta, UINT8 preferred_peer_antenna,
|
||||
UINT8 SNR_control_initiator, UINT8 SNR_control_reflector)
|
||||
{
|
||||
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_procedure_params(conn_handle, config_id, max_procedure_len,
|
||||
min_procedure_interval, max_procedure_interval,
|
||||
max_procedure_count, min_subevent_len,
|
||||
max_subevent_len, tone_ant_config_selection,
|
||||
phy, tx_power_delta, preferred_peer_antenna,
|
||||
SNR_control_initiator, SNR_control_reflector)) != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("cs set procedure params, cmd err=0x%x", err);
|
||||
status = BTM_HCI_ERROR | err;
|
||||
}
|
||||
|
||||
cb_params.cs_set_proc_params.status = status;
|
||||
cb_params.cs_set_proc_params.conn_handle = conn_handle;
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_PROC_PARAMS_CMPL_EVT, &cb_params);
|
||||
}
|
||||
|
||||
void BTM_BleGapCsProcEnable(UINT16 conn_handle, UINT8 config_id, UINT8 enable)
|
||||
{
|
||||
btsnd_hcic_ble_cs_procedure_enable(conn_handle, config_id, enable);
|
||||
}
|
||||
|
||||
void btm_ble_cs_read_remote_supp_caps_cmpl_evt(tBTM_BLE_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT *cs_read_remote_supp_caps)
|
||||
{
|
||||
if (cs_read_remote_supp_caps->status != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err = 0x%x", __func__, cs_read_remote_supp_caps->status);
|
||||
cs_read_remote_supp_caps->status |= BTM_HCI_ERROR;
|
||||
}
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)cs_read_remote_supp_caps);
|
||||
}
|
||||
|
||||
void btm_ble_cs_read_remote_fae_tab_cmpl_evt(tBTM_BLE_CS_READ_REMOTE_FAE_TAB_CMPL_EVT *cs_read_remote_fae_tab)
|
||||
{
|
||||
if (cs_read_remote_fae_tab->status != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err = 0x%x", __func__, cs_read_remote_fae_tab->status);
|
||||
cs_read_remote_fae_tab->status |= BTM_HCI_ERROR;
|
||||
}
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_READ_REMOTE_FAE_TABLE_CMPL_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)cs_read_remote_fae_tab);
|
||||
}
|
||||
|
||||
void btm_ble_cs_securuty_enable_cmpl_evt(tBTM_BLE_CS_SEC_ENABLE_CMPL_EVT *cs_security_enable)
|
||||
{
|
||||
if (cs_security_enable->status != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err = 0x%x", __func__, cs_security_enable->status);
|
||||
cs_security_enable->status |= BTM_HCI_ERROR;
|
||||
}
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_SECURITY_ENABLE_CMPL_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)cs_security_enable);
|
||||
}
|
||||
|
||||
void btm_ble_cs_config_cmpl_evt(tBTM_BLE_CS_CONFIG_CMPL_EVT *config_cmpl)
|
||||
{
|
||||
if (config_cmpl->status != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err = 0x%x", __func__, config_cmpl->status);
|
||||
config_cmpl->status |= BTM_HCI_ERROR;
|
||||
}
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_CONFIG_CMPL_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)config_cmpl);
|
||||
}
|
||||
|
||||
void btm_ble_cs_proc_enable_cmpl_evt(tBTM_BLE_CS_PROC_ENABLE_CMPL_EVT *proc_en)
|
||||
{
|
||||
if (proc_en->status != HCI_SUCCESS) {
|
||||
BTM_TRACE_ERROR("%s cmd err = 0x%x", __func__, proc_en->status);
|
||||
proc_en->status |= BTM_HCI_ERROR;
|
||||
}
|
||||
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_PROC_ENABLE_CMPL_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)proc_en);
|
||||
}
|
||||
|
||||
void btm_ble_cs_subevt_result_evt(tBTM_BLE_CS_SUBEVT_RESULT_CMPL_EVT *subevt_result)
|
||||
{
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_SUBEVENT_RESULT_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)subevt_result);
|
||||
}
|
||||
|
||||
void btm_ble_cs_subevt_continue_result_evt(tBTM_BLE_CS_SUBEVT_RESULT_CONTINUE_EVT *subevt_result_continue)
|
||||
{
|
||||
BTM_ExtBleCallbackTrigger(BTM_BLE_GAP_CS_SUBEVENT_RESULT_CONTINUE_EVT, (tBTM_BLE_5_GAP_CB_PARAMS *)subevt_result_continue);
|
||||
}
|
||||
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
@@ -671,7 +671,7 @@ void btm_ble_initiate_select_conn(BD_ADDR bda)
|
||||
BTM_TRACE_EVENT ("btm_ble_initiate_select_conn");
|
||||
|
||||
/* use direct connection procedure to initiate connection */
|
||||
if (!L2CA_ConnectFixedChnl(L2CAP_ATT_CID, bda, BLE_ADDR_UNKNOWN_TYPE, FALSE)) {
|
||||
if (!L2CA_ConnectFixedChnl(L2CAP_ATT_CID, bda, BLE_ADDR_UNKNOWN_TYPE, FALSE, FALSE, 0xFF, 0xFF)) {
|
||||
BTM_TRACE_ERROR("btm_ble_initiate_select_conn failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -606,6 +606,21 @@ 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 (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);
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
void btm_ble_cs_read_remote_supp_caps_cmpl_evt(tBTM_BLE_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT *cs_read_remote_supp_caps);
|
||||
void btm_ble_cs_read_remote_fae_tab_cmpl_evt(tBTM_BLE_CS_READ_REMOTE_FAE_TAB_CMPL_EVT *cs_read_remote_fae_tab);
|
||||
void btm_ble_cs_securuty_enable_cmpl_evt(tBTM_BLE_CS_SEC_ENABLE_CMPL_EVT *cs_security_enable);
|
||||
void btm_ble_cs_config_cmpl_evt(tBTM_BLE_CS_CONFIG_CMPL_EVT *config_cmpl);
|
||||
void btm_ble_cs_proc_enable_cmpl_evt(tBTM_BLE_CS_PROC_ENABLE_CMPL_EVT *proc_en);
|
||||
void btm_ble_cs_subevt_result_evt(tBTM_BLE_CS_SUBEVT_RESULT_CMPL_EVT *subevt_result);
|
||||
void btm_ble_cs_subevt_continue_result_evt(tBTM_BLE_CS_SUBEVT_RESULT_CONTINUE_EVT *subevt_continue_result);
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
|
||||
/*
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -702,6 +702,9 @@ struct tBTM_SEC_DEV_REC{
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
tBTM_EXT_CONN_PARAMS ext_conn_params;
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
BOOLEAN is_pawr_synced;
|
||||
UINT8 adv_handle;
|
||||
UINT8 subevent;
|
||||
#endif
|
||||
|
||||
// btla-specific ++
|
||||
@@ -1134,6 +1137,14 @@ 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 (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);
|
||||
void btm_ble_cs_security_enable_cmd_status(UINT8 status);
|
||||
void btm_ble_cs_read_remote_fae_table_cmd_status(UINT8 status);
|
||||
void btm_ble_cs_update_config_cmd_status(UINT8 status, BOOLEAN create);
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
/* Internal functions provided by btm_sco.c
|
||||
********************************************
|
||||
*/
|
||||
|
||||
@@ -161,8 +161,8 @@ static void btu_ble_phy_update_complete_evt(UINT8 *p);
|
||||
static void btu_ble_ext_adv_report_evt(UINT8 *p, UINT16 evt_len);
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
static void btu_ble_periodic_adv_sync_establish_evt(UINT8 *p);
|
||||
static void btu_ble_periodic_adv_report_evt(UINT8 *p, UINT8 evt_len);
|
||||
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);
|
||||
static void btu_ble_periodic_adv_sync_lost_evt(UINT8 *p);
|
||||
#endif // #if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
@@ -202,7 +202,7 @@ static void btu_ble_accept_cis_req_cmd_status(UINT8 status);
|
||||
static void btu_ble_cis_request_evt(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||
static void btu_ble_cis_established_evt(UINT8 *p);
|
||||
static void btu_ble_cis_established_evt(UINT8 *p, bool v2_evt);
|
||||
static void btu_ble_cis_disconnected(UINT16 handle, UINT8 reason);
|
||||
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||
|
||||
@@ -228,6 +228,21 @@ static void btu_ble_transmit_power_report_evt(UINT8 *p);
|
||||
static void btu_ble_subrate_change_evt(UINT8 *p);
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
static void btu_ble_pa_subevt_data_request_evt(UINT8 *p);
|
||||
static void btu_ble_pa_response_report_evt(UINT8 *p);
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
static void btu_ble_cs_read_remote_supp_caps_evt(UINT8 *p);
|
||||
static void btu_ble_cs_read_remote_fae_tab_evt(UINT8 *p);
|
||||
static void btu_ble_cs_security_enable_cmpl_evt(UINT8 *p);
|
||||
static void btu_ble_cs_config_cmpl_evt(UINT8 *p);
|
||||
static void btu_ble_cs_proc_enable_cmpl_evt(UINT8 *p);
|
||||
static void btu_ble_cs_subevt_result_evt(UINT8 *p);
|
||||
static void btu_ble_cs_subevt_result_continue_evt(UINT8 *p);
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
#if (BLE_42_ADV_EN == TRUE)
|
||||
extern osi_sem_t adv_enable_sem;
|
||||
extern osi_sem_t adv_data_sem;
|
||||
@@ -493,10 +508,16 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
case HCI_BLE_PERIOD_ADV_SYNC_ESTAB_EVT:
|
||||
btu_ble_periodic_adv_sync_establish_evt(p);
|
||||
btu_ble_periodic_adv_sync_establish_evt(p, false);
|
||||
break;
|
||||
case HCI_BLE_PERIOD_ADV_SYNC_ESTAB_EVT_V2:
|
||||
btu_ble_periodic_adv_sync_establish_evt(p, true);
|
||||
break;
|
||||
case HCI_BLE_PERIOD_ADV_REPORT_EVT:
|
||||
btu_ble_periodic_adv_report_evt(p, hci_evt_len);
|
||||
btu_ble_periodic_adv_report_evt(p, hci_evt_len, false);
|
||||
break;
|
||||
case HCI_BLE_PERIOD_ADV_REPORT_EVT_V2:
|
||||
btu_ble_periodic_adv_report_evt(p, hci_evt_len, true);
|
||||
break;
|
||||
case HCI_BLE_PERIOD_ADV_SYNC_LOST_EVT:
|
||||
btu_ble_periodic_adv_sync_lost_evt(p);
|
||||
@@ -527,8 +548,10 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
||||
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||
case HCI_BLE_CIS_ESTABLISHED_V1_EVT:
|
||||
btu_ble_cis_established_evt(p, false);
|
||||
break;
|
||||
case HCI_BLE_CIS_ESTABLISHED_V2_EVT:
|
||||
btu_ble_cis_established_evt(p);
|
||||
btu_ble_cis_established_evt(p, true);
|
||||
break;
|
||||
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||
@@ -586,6 +609,37 @@ 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 (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
case HCI_BLE_PA_SUBEVT_DATA_REQUEST_EVT:
|
||||
btu_ble_pa_subevt_data_request_evt(p);
|
||||
break;
|
||||
case HCI_BLE_PA_RESPONSE_REPORT_EVT:
|
||||
btu_ble_pa_response_report_evt(p);
|
||||
break;
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
case HCI_BLE_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT:
|
||||
btu_ble_cs_read_remote_supp_caps_evt(p);
|
||||
break;
|
||||
case HCI_BLE_CS_READ_REMOTE_FAE_TAB_CMPL_EVT:
|
||||
btu_ble_cs_read_remote_fae_tab_evt(p);
|
||||
break;
|
||||
case HCI_BLE_CS_SECURITY_ENABLE_CMPL_EVT:
|
||||
btu_ble_cs_security_enable_cmpl_evt(p);
|
||||
break;
|
||||
case HCI_BLE_CS_CONFIG_CMPL_EVT:
|
||||
btu_ble_cs_config_cmpl_evt(p);
|
||||
break;
|
||||
case HCI_BLE_CS_PROC_ENABLE_CMPL_EVT:
|
||||
btu_ble_cs_proc_enable_cmpl_evt(p);
|
||||
break;
|
||||
case HCI_BLE_CS_SUBEVENT_RESULT_EVT:
|
||||
btu_ble_cs_subevt_result_evt(p);
|
||||
break;
|
||||
case HCI_BLE_CS_SUBEVENT_RESULT_CONTINUE_EVT:
|
||||
btu_ble_cs_subevt_result_continue_evt(p);
|
||||
break;
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
}
|
||||
break;
|
||||
#endif /* BLE_INCLUDED */
|
||||
@@ -1390,7 +1444,11 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
btm_enh_read_trans_pwr_level_cmpl_evt(p);
|
||||
break;
|
||||
#endif //#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
case HCI_BLE_CS_READ_LOCAL_SUPP_CAPS:
|
||||
btm_ble_cs_read_local_supp_caps_cmpl_evt(p);
|
||||
break;
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
#endif /* (BLE_INCLUDED == TRUE) */
|
||||
|
||||
default: {
|
||||
@@ -1598,6 +1656,23 @@ 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 (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
case HCI_BLE_CS_READ_REMOTE_SUPP_CAPS:
|
||||
btm_ble_cs_read_remote_supp_caps_cmd_status(status);
|
||||
break;
|
||||
case HCI_BLE_CS_SECURITY_ENABLE:
|
||||
btm_ble_cs_security_enable_cmd_status(status);
|
||||
break;
|
||||
case HCI_BLE_CS_READ_REMOTE_FAE_TABLE:
|
||||
btm_ble_cs_read_remote_fae_table_cmd_status(status);
|
||||
break;
|
||||
case HCI_BLE_CS_CREATE_CONFIG:
|
||||
btm_ble_cs_update_config_cmd_status(status, true);
|
||||
break;
|
||||
case HCI_BLE_CS_REMOVE_CONFIG:
|
||||
btm_ble_cs_update_config_cmd_status(status, false);
|
||||
break;
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
default:
|
||||
/* If command failed to start, we may need to tell BTM */
|
||||
if (status != HCI_SUCCESS) {
|
||||
@@ -2541,7 +2616,7 @@ static void btu_ble_ext_adv_report_evt(UINT8 *p, UINT16 evt_len)
|
||||
#endif // #if (BLE_50_EXTEND_SCAN_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
static void btu_ble_periodic_adv_sync_establish_evt(UINT8 *p)
|
||||
static void btu_ble_periodic_adv_sync_establish_evt(UINT8 *p, bool v2_evt)
|
||||
{
|
||||
tBTM_BLE_PERIOD_ADV_SYNC_ESTAB sync_estab = {0};
|
||||
|
||||
@@ -2558,15 +2633,24 @@ static void btu_ble_periodic_adv_sync_establish_evt(UINT8 *p)
|
||||
STREAM_TO_UINT8(sync_estab.adv_phy, p);
|
||||
STREAM_TO_UINT16(sync_estab.period_adv_interval, p);
|
||||
STREAM_TO_UINT8(sync_estab.adv_clk_accuracy, p);
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
if (v2_evt) {
|
||||
STREAM_TO_UINT8(sync_estab.num_subevt, p);
|
||||
STREAM_TO_UINT8(sync_estab.subevt_interval, p);
|
||||
STREAM_TO_UINT8(sync_estab.rsp_slot_delay, p);
|
||||
STREAM_TO_UINT8(sync_estab.rsp_slot_spacing, p);
|
||||
}
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
btm_ble_periodic_adv_sync_establish_evt(&sync_estab);
|
||||
}
|
||||
|
||||
static void btu_ble_periodic_adv_report_evt(UINT8 *p, UINT8 evt_len)
|
||||
static void btu_ble_periodic_adv_report_evt(UINT8 *p, UINT8 evt_len, bool v2_evt)
|
||||
{
|
||||
tBTM_PERIOD_ADV_REPORT adv_report = {0};
|
||||
/* This parameter is intended to be used in a future feature. */
|
||||
UINT8 unused = 0;
|
||||
UINT8 min_len = MIN_BLE_PERIODIC_ADV_REPORT_LEN;
|
||||
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
@@ -2582,10 +2666,17 @@ static void btu_ble_periodic_adv_report_evt(UINT8 *p, UINT8 evt_len)
|
||||
STREAM_TO_UINT8(adv_report.tx_power, p);
|
||||
STREAM_TO_UINT8(adv_report.rssi, p);
|
||||
STREAM_TO_UINT8(adv_report.cte_type, p);
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
if (v2_evt) {
|
||||
STREAM_TO_UINT16(adv_report.periodic_evt_cnt, p);
|
||||
STREAM_TO_UINT8(adv_report.subevt, p);
|
||||
min_len += 3;
|
||||
}
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
STREAM_TO_UINT8(adv_report.data_status, p);
|
||||
STREAM_TO_UINT8(adv_report.data_length, p);
|
||||
|
||||
if ((evt_len - MIN_BLE_PERIODIC_ADV_REPORT_LEN) != adv_report.data_length) {
|
||||
if ((evt_len - min_len) != adv_report.data_length) {
|
||||
HCI_TRACE_ERROR("%s, Invalid ev_len = %d is less than adv len = %d", __func__, evt_len, adv_report.data_length);
|
||||
return;
|
||||
}
|
||||
@@ -2743,7 +2834,7 @@ static void btu_ble_cis_disconnected(UINT16 handle, UINT8 reason)
|
||||
btm_ble_cis_disconnected_evt(&cis_disconnected_evt);
|
||||
}
|
||||
|
||||
static void btu_ble_cis_established_evt(UINT8 *p)
|
||||
static void btu_ble_cis_established_evt(UINT8 *p, bool v2_evt)
|
||||
{
|
||||
HCI_TRACE_DEBUG("%s", __func__);
|
||||
tBTM_BLE_CIS_ESTABLISHED_CMPL cis_estab_evt = {0};
|
||||
@@ -2770,12 +2861,14 @@ static void btu_ble_cis_established_evt(UINT8 *p)
|
||||
STREAM_TO_UINT16(cis_estab_evt.max_pdu_p_to_c, p);
|
||||
STREAM_TO_UINT16(cis_estab_evt.iso_interval, p);
|
||||
#if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||
STREAM_TO_UINT24(cis_estab_evt.sub_interval, p);
|
||||
STREAM_TO_UINT16(cis_estab_evt.max_sdu_c_to_p, p);
|
||||
STREAM_TO_UINT16(cis_estab_evt.max_sdu_p_to_c, p);
|
||||
STREAM_TO_UINT24(cis_estab_evt.sdu_int_c_to_p, p);
|
||||
STREAM_TO_UINT24(cis_estab_evt.sdu_int_p_to_c, p);
|
||||
STREAM_TO_UINT8(cis_estab_evt.framing, p);
|
||||
if (v2_evt) {
|
||||
STREAM_TO_UINT24(cis_estab_evt.sub_interval, p);
|
||||
STREAM_TO_UINT16(cis_estab_evt.max_sdu_c_to_p, p);
|
||||
STREAM_TO_UINT16(cis_estab_evt.max_sdu_p_to_c, p);
|
||||
STREAM_TO_UINT24(cis_estab_evt.sdu_int_c_to_p, p);
|
||||
STREAM_TO_UINT24(cis_estab_evt.sdu_int_p_to_c, p);
|
||||
STREAM_TO_UINT8(cis_estab_evt.framing, p);
|
||||
}
|
||||
#endif // #if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||
|
||||
btm_ble_cis_established_evt(&cis_estab_evt);
|
||||
@@ -2808,6 +2901,7 @@ void btu_ble_create_big_cmd_status(UINT8 status)
|
||||
{
|
||||
if (status != HCI_SUCCESS) {
|
||||
tBTM_BLE_BIG_CREATE_CMPL big_cmpl = {0};
|
||||
big_cmpl.status = status;
|
||||
btm_ble_big_create_cmpl_evt(&big_cmpl);
|
||||
}
|
||||
}
|
||||
@@ -2974,6 +3068,10 @@ static void btu_ble_cte_connless_iq_report_evt(UINT8 *p)
|
||||
for (uint8_t i = 0; i < connless_iq_rpt.sample_count; i++)
|
||||
{
|
||||
STREAM_TO_UINT8(connless_iq_rpt.i_sample[i], p);
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < connless_iq_rpt.sample_count; i++)
|
||||
{
|
||||
STREAM_TO_UINT8(connless_iq_rpt.q_sample[i], p);
|
||||
}
|
||||
|
||||
@@ -3005,6 +3103,10 @@ static void btu_ble_cte_conn_iq_report_evt(UINT8 *p)
|
||||
for (uint8_t i = 0; i < conn_iq_rpt.sample_count; i++)
|
||||
{
|
||||
STREAM_TO_UINT8(conn_iq_rpt.i_sample[i], p);
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < conn_iq_rpt.sample_count; i++)
|
||||
{
|
||||
STREAM_TO_UINT8(conn_iq_rpt.q_sample[i], p);
|
||||
}
|
||||
|
||||
@@ -3085,6 +3187,298 @@ static void btu_ble_subrate_change_evt(UINT8 *p)
|
||||
}
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
static void btu_ble_pa_subevt_data_request_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_PA_SUBEVT_DATA_REQ_EVT pa_subevt_req_evt = {0};
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(pa_subevt_req_evt.adv_handle, p);
|
||||
STREAM_TO_UINT8(pa_subevt_req_evt.subevt_start, p);
|
||||
STREAM_TO_UINT8(pa_subevt_req_evt.subevt_data_count, p);
|
||||
|
||||
btm_ble_pa_subevt_data_req_evt(&pa_subevt_req_evt);
|
||||
}
|
||||
|
||||
static void btu_ble_pa_response_report_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_PA_RSP_REPORT_EVT pa_rsp_rpt_evt = {0};
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(pa_rsp_rpt_evt.adv_handle, p);
|
||||
STREAM_TO_UINT8(pa_rsp_rpt_evt.subevt, p);
|
||||
STREAM_TO_UINT8(pa_rsp_rpt_evt.tx_status, p);
|
||||
STREAM_TO_UINT8(pa_rsp_rpt_evt.num_rsp, p);
|
||||
|
||||
if (pa_rsp_rpt_evt.num_rsp) {
|
||||
pa_rsp_rpt_evt.rsp_data_info = osi_malloc(pa_rsp_rpt_evt.num_rsp * sizeof(tBTM_BLE_PA_RSP_DATA_INFO));
|
||||
if (pa_rsp_rpt_evt.rsp_data_info)
|
||||
{
|
||||
for (UINT8 i = 0; i < pa_rsp_rpt_evt.num_rsp; i++)
|
||||
{
|
||||
STREAM_TO_UINT8(pa_rsp_rpt_evt.rsp_data_info[i].tx_power, p);
|
||||
STREAM_TO_UINT8(pa_rsp_rpt_evt.rsp_data_info[i].rssi, p);
|
||||
STREAM_TO_UINT8(pa_rsp_rpt_evt.rsp_data_info[i].cte_type, p);
|
||||
STREAM_TO_UINT8(pa_rsp_rpt_evt.rsp_data_info[i].rsp_slot, p);
|
||||
STREAM_TO_UINT8(pa_rsp_rpt_evt.rsp_data_info[i].data_status, p);
|
||||
STREAM_TO_UINT8(pa_rsp_rpt_evt.rsp_data_info[i].data_len, p);
|
||||
if (pa_rsp_rpt_evt.rsp_data_info[i].data_len) {
|
||||
pa_rsp_rpt_evt.rsp_data_info[i].data = osi_malloc(pa_rsp_rpt_evt.rsp_data_info[i].data_len);
|
||||
if (pa_rsp_rpt_evt.rsp_data_info[i].data) {
|
||||
STREAM_TO_ARRAY(pa_rsp_rpt_evt.rsp_data_info[i].data, p, pa_rsp_rpt_evt.rsp_data_info[i].data_len);
|
||||
} else {
|
||||
HCI_TRACE_ERROR("%s, no enough memory.", __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
HCI_TRACE_ERROR("%s, no memory.", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
btm_ble_pa_rsp_rpt_evt(&pa_rsp_rpt_evt);
|
||||
|
||||
if (pa_rsp_rpt_evt.rsp_data_info)
|
||||
{
|
||||
for (UINT8 i = 0; i < pa_rsp_rpt_evt.num_rsp; i++)
|
||||
{
|
||||
if (pa_rsp_rpt_evt.rsp_data_info[i].data) {
|
||||
osi_free(pa_rsp_rpt_evt.rsp_data_info[i].data);
|
||||
}
|
||||
}
|
||||
osi_free(pa_rsp_rpt_evt.rsp_data_info);
|
||||
}
|
||||
}
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
static void btu_ble_cs_read_remote_supp_caps_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT cs_read_remote_supp_caps = {0};
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.status, p);
|
||||
STREAM_TO_UINT16(cs_read_remote_supp_caps.conn_handle, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.num_config_supported, p);
|
||||
STREAM_TO_UINT16(cs_read_remote_supp_caps.max_consecutive_proc_supported, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.num_ant_supported, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.max_ant_paths_supported, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.roles_supported, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.modes_supported, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.rtt_capability, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.rtt_aa_only_n, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.rtt_sounding_n, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.rtt_random_payload_n, p);
|
||||
STREAM_TO_UINT16(cs_read_remote_supp_caps.NADM_sounding_capability, p);
|
||||
STREAM_TO_UINT16(cs_read_remote_supp_caps.NADM_random_capability, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.cs_sync_phys_supported, p);
|
||||
STREAM_TO_UINT16(cs_read_remote_supp_caps.subfeatures_supported, p);
|
||||
STREAM_TO_UINT16(cs_read_remote_supp_caps.T_IP1_times_supported, p);
|
||||
STREAM_TO_UINT16(cs_read_remote_supp_caps.T_IP2_times_supported, p);
|
||||
STREAM_TO_UINT16(cs_read_remote_supp_caps.T_FCS_times_supported, p);
|
||||
STREAM_TO_UINT16(cs_read_remote_supp_caps.T_PM_times_supported, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.T_SW_times_supported, p);
|
||||
STREAM_TO_UINT8(cs_read_remote_supp_caps.TX_SNR_capability, p);
|
||||
|
||||
btm_ble_cs_read_remote_supp_caps_cmpl_evt(&cs_read_remote_supp_caps);
|
||||
}
|
||||
|
||||
static void btu_ble_cs_read_remote_fae_tab_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_CS_READ_REMOTE_FAE_TAB_CMPL_EVT cs_read_remote_fae_tab = {0};
|
||||
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(cs_read_remote_fae_tab.status, p);
|
||||
STREAM_TO_UINT16(cs_read_remote_fae_tab.conn_handle, p);
|
||||
STREAM_TO_ARRAY(cs_read_remote_fae_tab.remote_fae_table, p, 72);
|
||||
|
||||
btm_ble_cs_read_remote_fae_tab_cmpl_evt(&cs_read_remote_fae_tab);
|
||||
}
|
||||
|
||||
static void btu_ble_cs_security_enable_cmpl_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_CS_SEC_ENABLE_CMPL_EVT cs_security_enable = {0};
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
STREAM_TO_UINT8(cs_security_enable.status, p);
|
||||
STREAM_TO_UINT16(cs_security_enable.conn_handle, p);
|
||||
|
||||
btm_ble_cs_securuty_enable_cmpl_evt(&cs_security_enable);
|
||||
}
|
||||
|
||||
static void btu_ble_cs_config_cmpl_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_CS_CONFIG_CMPL_EVT config_cmpl = {0};
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
STREAM_TO_UINT8(config_cmpl.status, p);
|
||||
STREAM_TO_UINT16(config_cmpl.conn_handle, p);
|
||||
STREAM_TO_UINT8(config_cmpl.config_id, p);
|
||||
STREAM_TO_UINT8(config_cmpl.action, p);;
|
||||
STREAM_TO_UINT8(config_cmpl.main_mode_type, p);
|
||||
STREAM_TO_UINT8(config_cmpl.sub_mode_type, p);
|
||||
STREAM_TO_UINT8(config_cmpl.min_main_mode_steps, p);
|
||||
STREAM_TO_UINT8(config_cmpl.max_main_mode_steps, p);
|
||||
STREAM_TO_UINT8(config_cmpl.main_mode_repetition, p);
|
||||
STREAM_TO_UINT8(config_cmpl.mode_0_steps, p);
|
||||
STREAM_TO_UINT8(config_cmpl.role, p);
|
||||
STREAM_TO_UINT8(config_cmpl.rtt_type, p);
|
||||
STREAM_TO_UINT8(config_cmpl.cs_sync_phy, p);
|
||||
STREAM_TO_ARRAY(config_cmpl.channel_map, p, 10);
|
||||
STREAM_TO_UINT8(config_cmpl.channel_map_repetition, p);
|
||||
STREAM_TO_UINT8(config_cmpl.channel_selection_type, p);
|
||||
STREAM_TO_UINT8(config_cmpl.ch3c_shape, p);
|
||||
STREAM_TO_UINT8(config_cmpl.ch3c_jump, p);
|
||||
STREAM_TO_UINT8(config_cmpl.reserved, p);
|
||||
STREAM_TO_UINT8(config_cmpl.t_ip1_time, p);
|
||||
STREAM_TO_UINT8(config_cmpl.t_ip2_time, p);
|
||||
STREAM_TO_UINT8(config_cmpl.t_fcs_time, p);
|
||||
STREAM_TO_UINT8(config_cmpl.t_pm_time, p);
|
||||
|
||||
btm_ble_cs_config_cmpl_evt(&config_cmpl);
|
||||
}
|
||||
|
||||
static void btu_ble_cs_proc_enable_cmpl_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_CS_PROC_ENABLE_CMPL_EVT proc_en = {0};
|
||||
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT8(proc_en.status, p);
|
||||
STREAM_TO_UINT16(proc_en.conn_handle, p);
|
||||
STREAM_TO_UINT8(proc_en.config_id, p);
|
||||
STREAM_TO_UINT8(proc_en.state, p);
|
||||
STREAM_TO_UINT8(proc_en.tone_ant_config_select, p);
|
||||
STREAM_TO_UINT8(proc_en.select_tx_power, p);
|
||||
STREAM_TO_UINT24(proc_en.subevent_Len, p);
|
||||
STREAM_TO_UINT8(proc_en.subevents_per_event, p);
|
||||
STREAM_TO_UINT16(proc_en.subevent_interval, p);
|
||||
STREAM_TO_UINT16(proc_en.event_interval, p);
|
||||
STREAM_TO_UINT16(proc_en.procedure_interval, p);
|
||||
STREAM_TO_UINT16(proc_en.procedure_count, p);
|
||||
STREAM_TO_UINT16(proc_en.max_procedure_len, p);
|
||||
|
||||
btm_ble_cs_proc_enable_cmpl_evt(&proc_en);
|
||||
}
|
||||
|
||||
static void btu_ble_cs_subevt_result_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_CS_SUBEVT_RESULT_CMPL_EVT subevt_result = {0};
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
STREAM_TO_UINT16(subevt_result.conn_handle, p);
|
||||
STREAM_TO_UINT8(subevt_result.config_id, p);
|
||||
STREAM_TO_UINT16(subevt_result.start_acl_conn_event_counter, p);
|
||||
STREAM_TO_UINT16(subevt_result.procedure_counter, p);
|
||||
STREAM_TO_UINT16(subevt_result.frequency_compensation, p);
|
||||
STREAM_TO_UINT8(subevt_result.reference_power_level, p);
|
||||
STREAM_TO_UINT8(subevt_result.procedure_done_status, p);
|
||||
STREAM_TO_UINT8(subevt_result.subevent_done_status, p);
|
||||
STREAM_TO_UINT8(subevt_result.abort_reason, p);
|
||||
STREAM_TO_UINT8(subevt_result.num_ant_paths, p);
|
||||
STREAM_TO_UINT8(subevt_result.num_steps_reported, p);
|
||||
|
||||
subevt_result.step_info = osi_malloc(subevt_result.num_steps_reported * sizeof(tBTM_BLE_CS_STEP_INFO));
|
||||
if (subevt_result.step_info) {
|
||||
for (uint8_t i = 0; i < subevt_result.num_steps_reported; i++)
|
||||
{
|
||||
STREAM_TO_UINT8(subevt_result.step_info[i].step_mode, p);
|
||||
STREAM_TO_UINT8(subevt_result.step_info[i].step_channel, p);
|
||||
STREAM_TO_UINT8(subevt_result.step_info[i].step_data_len, p);
|
||||
subevt_result.step_info[i].data = osi_malloc(subevt_result.step_info[i].step_data_len);
|
||||
if (subevt_result.step_info[i].data) {
|
||||
STREAM_TO_ARRAY(subevt_result.step_info[i].data, p, subevt_result.step_info[i].step_data_len);
|
||||
} else if (subevt_result.step_info[i].step_data_len) {
|
||||
HCI_TRACE_ERROR("%s, no memory.", __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
btm_ble_cs_subevt_result_evt(&subevt_result);
|
||||
|
||||
if (subevt_result.step_info)
|
||||
{
|
||||
for (UINT8 i = 0; i < subevt_result.num_steps_reported; i++)
|
||||
{
|
||||
if (subevt_result.step_info[i].data) {
|
||||
osi_free(subevt_result.step_info[i].data);
|
||||
}
|
||||
}
|
||||
osi_free(subevt_result.step_info);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void btu_ble_cs_subevt_result_continue_evt(UINT8 *p)
|
||||
{
|
||||
tBTM_BLE_CS_SUBEVT_RESULT_CONTINUE_EVT subevt_continue_result = {0};
|
||||
|
||||
if (!p) {
|
||||
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
STREAM_TO_UINT16(subevt_continue_result.conn_handle, p);
|
||||
STREAM_TO_UINT8(subevt_continue_result.config_id, p);
|
||||
STREAM_TO_UINT8(subevt_continue_result.proc_done_status, p);
|
||||
STREAM_TO_UINT8(subevt_continue_result.subevt_done_status, p);
|
||||
STREAM_TO_UINT8(subevt_continue_result.abort_reason, p);
|
||||
STREAM_TO_UINT8(subevt_continue_result.num_ant_paths, p);
|
||||
STREAM_TO_UINT8(subevt_continue_result.num_steps_reported, p);
|
||||
|
||||
subevt_continue_result.step_info = osi_malloc(subevt_continue_result.num_steps_reported * sizeof(tBTM_BLE_CS_STEP_INFO));
|
||||
if (subevt_continue_result.step_info) {
|
||||
for (uint8_t i = 0; i < subevt_continue_result.num_steps_reported; i++) {
|
||||
STREAM_TO_UINT8(subevt_continue_result.step_info[i].step_mode, p);
|
||||
STREAM_TO_UINT8(subevt_continue_result.step_info[i].step_channel, p);
|
||||
STREAM_TO_UINT8(subevt_continue_result.step_info[i].step_data_len, p);
|
||||
subevt_continue_result.step_info[i].data = osi_malloc(subevt_continue_result.step_info[i].step_data_len);
|
||||
if (subevt_continue_result.step_info[i].data) {
|
||||
STREAM_TO_ARRAY(subevt_continue_result.step_info[i].data, p, subevt_continue_result.step_info[i].step_data_len);
|
||||
} else if (subevt_continue_result.step_info[i].step_data_len) {
|
||||
HCI_TRACE_ERROR("%s, no memory.", __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
btm_ble_cs_subevt_continue_result_evt(&subevt_continue_result);
|
||||
|
||||
if (subevt_continue_result.step_info)
|
||||
{
|
||||
for (UINT8 i = 0; i < subevt_continue_result.num_steps_reported; i++)
|
||||
{
|
||||
if (subevt_continue_result.step_info[i].data) {
|
||||
osi_free(subevt_continue_result.step_info[i].data);
|
||||
}
|
||||
}
|
||||
osi_free(subevt_continue_result.step_info);
|
||||
}
|
||||
|
||||
}
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
/**********************************************
|
||||
** End of BLE Events Handler
|
||||
***********************************************/
|
||||
|
||||
@@ -256,6 +256,12 @@ tGATT_STATUS gap_read_attr_value (UINT16 handle, tGATT_VALUE *p_value, BOOLEAN i
|
||||
UINT8_TO_STREAM(p, p_db_attr->attr_value.addr_resolution);
|
||||
p_value->len = 1;
|
||||
break;
|
||||
#if (BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
case GATT_UUID_GAP_GATT_SECURITY_LEVELS:
|
||||
UINT16_TO_STREAM(p, p_db_attr->attr_value.security_level);
|
||||
p_value->len = 2;
|
||||
break;
|
||||
#endif // (BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
}
|
||||
return GATT_SUCCESS;
|
||||
}
|
||||
@@ -464,6 +470,17 @@ void gap_attr_db_init(void)
|
||||
p_db_attr->attr_value.addr_resolution = 0;
|
||||
p_db_attr++;
|
||||
|
||||
#if (BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
/* Add LE Security Levels Characteristic */
|
||||
uuid.len = LEN_UUID_16;
|
||||
uuid.uu.uuid16 = p_db_attr->uuid = GATT_UUID_GAP_GATT_SECURITY_LEVELS;
|
||||
p_db_attr->handle = GATTS_AddCharacteristic(service_handle, &uuid,
|
||||
GATT_PERM_READ, GATT_CHAR_PROP_BIT_READ,
|
||||
NULL, NULL);
|
||||
p_db_attr->attr_value.security_level = 0x0101;
|
||||
p_db_attr++;
|
||||
#endif // (BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
|
||||
/* start service now */
|
||||
memset (&app_uuid.uu.uuid128, 0x81, LEN_UUID_128);
|
||||
|
||||
@@ -517,6 +534,12 @@ void GAP_BleAttrDBUpdate(UINT16 attr_uuid, tGAP_BLE_ATTR_VALUE *p_value)
|
||||
p_db_attr->attr_value.addr_resolution = p_value->addr_resolution;
|
||||
break;
|
||||
|
||||
#if (BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
case GATT_UUID_GAP_GATT_SECURITY_LEVELS:
|
||||
p_db_attr->attr_value.security_level = p_value->security_level;
|
||||
break;
|
||||
#endif // (BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -728,7 +751,7 @@ BOOLEAN gap_ble_accept_cl_operation(BD_ADDR peer_bda, UINT16 uuid, tGAP_BLE_CMPL
|
||||
}
|
||||
|
||||
/* hold the link here */
|
||||
if (!GATT_Connect(gap_cb.gatt_if, p_clcb->bda, BLE_ADDR_UNKNOWN_TYPE, TRUE, BT_TRANSPORT_LE, FALSE)) {
|
||||
if (!GATT_Connect(gap_cb.gatt_if, p_clcb->bda, BLE_ADDR_UNKNOWN_TYPE, TRUE, BT_TRANSPORT_LE, FALSE, FALSE, 0xFF, 0xFF)) {
|
||||
return started;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ typedef struct {
|
||||
|
||||
|
||||
#if BLE_INCLUDED == TRUE
|
||||
#define GAP_MAX_CHAR_NUM 4
|
||||
#define GAP_MAX_CHAR_NUM 5
|
||||
|
||||
typedef struct {
|
||||
UINT16 handle;
|
||||
|
||||
@@ -1453,7 +1453,8 @@ void GATT_StartIf (tGATT_IF gatt_if)
|
||||
**
|
||||
*******************************************************************************/
|
||||
BOOLEAN GATT_Connect (tGATT_IF gatt_if, BD_ADDR bd_addr, tBLE_ADDR_TYPE bd_addr_type,
|
||||
BOOLEAN is_direct, tBT_TRANSPORT transport, BOOLEAN is_aux)
|
||||
BOOLEAN is_direct, tBT_TRANSPORT transport, BOOLEAN is_aux,
|
||||
BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent)
|
||||
{
|
||||
tGATT_REG *p_reg;
|
||||
BOOLEAN status = FALSE;
|
||||
@@ -1467,7 +1468,7 @@ BOOLEAN GATT_Connect (tGATT_IF gatt_if, BD_ADDR bd_addr, tBLE_ADDR_TYPE bd_addr_
|
||||
}
|
||||
|
||||
if (is_direct) {
|
||||
status = gatt_act_connect (p_reg, bd_addr, bd_addr_type, transport, is_aux);
|
||||
status = gatt_act_connect (p_reg, bd_addr, bd_addr_type, transport, is_aux, is_pawr_synced, adv_handle, subevent);
|
||||
} else {
|
||||
#if (tGATT_BG_CONN_DEV == TRUE)
|
||||
if (transport == BT_TRANSPORT_LE) {
|
||||
|
||||
@@ -98,7 +98,7 @@ UINT16 gatt_profile_find_conn_id_by_bd_addr(BD_ADDR remote_bda)
|
||||
**
|
||||
** Description find clcb by Connection ID
|
||||
**
|
||||
** Returns Pointer to the found link conenction control block.
|
||||
** Returns Pointer to the found link connection control block.
|
||||
**
|
||||
*******************************************************************************/
|
||||
static tGATT_PROFILE_CLCB *gatt_profile_find_clcb_by_conn_id(UINT16 conn_id)
|
||||
@@ -119,9 +119,9 @@ static tGATT_PROFILE_CLCB *gatt_profile_find_clcb_by_conn_id(UINT16 conn_id)
|
||||
**
|
||||
** Function gatt_profile_find_clcb_by_bd_addr
|
||||
**
|
||||
** Description The function searches all LCBs with macthing bd address.
|
||||
** Description The function searches all LCBs with matching bd address.
|
||||
**
|
||||
** Returns Pointer to the found link conenction control block.
|
||||
** Returns Pointer to the found link connection control block.
|
||||
**
|
||||
*******************************************************************************/
|
||||
static tGATT_PROFILE_CLCB *gatt_profile_find_clcb_by_bd_addr(BD_ADDR bda, tBT_TRANSPORT transport)
|
||||
@@ -148,7 +148,7 @@ static tGATT_PROFILE_CLCB *gatt_profile_find_clcb_by_bd_addr(BD_ADDR bda, tBT_TR
|
||||
** Returns NULL if not found. Otherwise pointer to the connection link block.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tGATT_PROFILE_CLCB *gatt_profile_clcb_alloc (UINT16 conn_id, BD_ADDR bda, tBT_TRANSPORT tranport)
|
||||
tGATT_PROFILE_CLCB *gatt_profile_clcb_alloc (UINT16 conn_id, BD_ADDR bda, tBT_TRANSPORT transport)
|
||||
{
|
||||
UINT8 i_clcb = 0;
|
||||
tGATT_PROFILE_CLCB *p_clcb = NULL;
|
||||
@@ -158,7 +158,7 @@ tGATT_PROFILE_CLCB *gatt_profile_clcb_alloc (UINT16 conn_id, BD_ADDR bda, tBT_TR
|
||||
p_clcb->in_use = TRUE;
|
||||
p_clcb->conn_id = conn_id;
|
||||
p_clcb->connected = TRUE;
|
||||
p_clcb->transport = tranport;
|
||||
p_clcb->transport = transport;
|
||||
memcpy (p_clcb->bda, bda, BD_ADDR_LEN);
|
||||
break;
|
||||
}
|
||||
@@ -435,7 +435,7 @@ static void gatt_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
|
||||
**
|
||||
** Function gatt_profile_db_init
|
||||
**
|
||||
** Description Initializa the GATT profile attribute database.
|
||||
** Description Initialize the GATT profile attribute database.
|
||||
**
|
||||
*******************************************************************************/
|
||||
void gatt_profile_db_init (void)
|
||||
@@ -684,7 +684,7 @@ void GATT_ConfigServiceChangeCCC (BD_ADDR remote_bda, BOOLEAN enable, tBT_TRANSP
|
||||
p_clcb->connected = TRUE;
|
||||
}
|
||||
/* hold the link here */
|
||||
GATT_Connect(gatt_cb.gatt_if, remote_bda, BLE_ADDR_UNKNOWN_TYPE, TRUE, transport, FALSE);
|
||||
GATT_Connect(gatt_cb.gatt_if, remote_bda, BLE_ADDR_UNKNOWN_TYPE, TRUE, transport, FALSE, FALSE, 0xFF, 0xFF);
|
||||
p_clcb->ccc_stage = GATT_SVC_CHANGED_CONNECTING;
|
||||
|
||||
if (!p_clcb->connected) {
|
||||
|
||||
@@ -220,7 +220,8 @@ void gatt_free(void)
|
||||
** Returns TRUE if connection is started, otherwise return FALSE.
|
||||
**
|
||||
*******************************************************************************/
|
||||
BOOLEAN gatt_connect (BD_ADDR rem_bda, tBLE_ADDR_TYPE bd_addr_type, tGATT_TCB *p_tcb, tBT_TRANSPORT transport, BOOLEAN is_aux)
|
||||
BOOLEAN gatt_connect (BD_ADDR rem_bda, tBLE_ADDR_TYPE bd_addr_type, tGATT_TCB *p_tcb, tBT_TRANSPORT transport, BOOLEAN is_aux,
|
||||
BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent)
|
||||
{
|
||||
BOOLEAN gatt_ret = FALSE;
|
||||
|
||||
@@ -230,7 +231,7 @@ BOOLEAN gatt_connect (BD_ADDR rem_bda, tBLE_ADDR_TYPE bd_addr_type, tGATT_TCB *p
|
||||
|
||||
if (transport == BT_TRANSPORT_LE) {
|
||||
p_tcb->att_lcid = L2CAP_ATT_CID;
|
||||
gatt_ret = L2CA_ConnectFixedChnl (L2CAP_ATT_CID, rem_bda, bd_addr_type, is_aux);
|
||||
gatt_ret = L2CA_ConnectFixedChnl (L2CAP_ATT_CID, rem_bda, bd_addr_type, is_aux, is_pawr_synced, adv_handle, subevent);
|
||||
#if (CLASSIC_BT_GATT_INCLUDED == TRUE)
|
||||
} else {
|
||||
if ((p_tcb->att_lcid = L2CA_ConnectReq(BT_PSM_ATT, rem_bda)) != 0) {
|
||||
@@ -376,7 +377,8 @@ void gatt_update_app_use_link_flag (tGATT_IF gatt_if, tGATT_TCB *p_tcb, BOOLEAN
|
||||
**
|
||||
*******************************************************************************/
|
||||
BOOLEAN gatt_act_connect (tGATT_REG *p_reg, BD_ADDR bd_addr,
|
||||
tBLE_ADDR_TYPE bd_addr_type, tBT_TRANSPORT transport, BOOLEAN is_aux)
|
||||
tBLE_ADDR_TYPE bd_addr_type, tBT_TRANSPORT transport, BOOLEAN is_aux,
|
||||
BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent)
|
||||
{
|
||||
BOOLEAN ret = FALSE;
|
||||
tGATT_TCB *p_tcb;
|
||||
@@ -389,7 +391,7 @@ BOOLEAN gatt_act_connect (tGATT_REG *p_reg, BD_ADDR bd_addr,
|
||||
/* before link down, another app try to open a GATT connection */
|
||||
if (st == GATT_CH_OPEN && gatt_num_apps_hold_link(p_tcb) == 0 &&
|
||||
transport == BT_TRANSPORT_LE ) {
|
||||
if (!gatt_connect(bd_addr, bd_addr_type, p_tcb, transport, is_aux)) {
|
||||
if (!gatt_connect(bd_addr, bd_addr_type, p_tcb, transport, is_aux, is_pawr_synced, adv_handle, subevent)) {
|
||||
ret = FALSE;
|
||||
}
|
||||
} else if (st == GATT_CH_CLOSING) {
|
||||
@@ -400,7 +402,7 @@ BOOLEAN gatt_act_connect (tGATT_REG *p_reg, BD_ADDR bd_addr,
|
||||
}
|
||||
} else {
|
||||
if ((p_tcb = gatt_allocate_tcb_by_bdaddr(bd_addr, transport)) != NULL) {
|
||||
if (!gatt_connect(bd_addr, bd_addr_type, p_tcb, transport, is_aux)) {
|
||||
if (!gatt_connect(bd_addr, bd_addr_type, p_tcb, transport, is_aux, is_pawr_synced, adv_handle, subevent)) {
|
||||
GATT_TRACE_ERROR("gatt_connect failed");
|
||||
|
||||
// code enter here if create connection failed. if disconnect after connection, code will not enter here
|
||||
|
||||
@@ -597,8 +597,8 @@ extern void gatt_free(void);
|
||||
|
||||
/* from gatt_main.c */
|
||||
extern BOOLEAN gatt_disconnect (tGATT_TCB *p_tcb);
|
||||
extern BOOLEAN gatt_act_connect (tGATT_REG *p_reg, BD_ADDR bd_addr, tBLE_ADDR_TYPE bd_addr_type, tBT_TRANSPORT transport, BOOLEAN is_aux);
|
||||
extern BOOLEAN gatt_connect (BD_ADDR rem_bda, tBLE_ADDR_TYPE bd_addr_type, tGATT_TCB *p_tcb, tBT_TRANSPORT transport, BOOLEAN is_aux);
|
||||
extern BOOLEAN gatt_act_connect (tGATT_REG *p_reg, BD_ADDR bd_addr, tBLE_ADDR_TYPE bd_addr_type, tBT_TRANSPORT transport, BOOLEAN is_aux, BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent);
|
||||
extern BOOLEAN gatt_connect (BD_ADDR rem_bda, tBLE_ADDR_TYPE bd_addr_type, tGATT_TCB *p_tcb, tBT_TRANSPORT transport, BOOLEAN is_aux, BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent);
|
||||
extern void gatt_data_process (tGATT_TCB *p_tcb, BT_HDR *p_buf);
|
||||
extern void gatt_update_app_use_link_flag ( tGATT_IF gatt_if, tGATT_TCB *p_tcb, BOOLEAN is_add, BOOLEAN check_acl_link);
|
||||
|
||||
|
||||
@@ -1227,7 +1227,55 @@ UINT8 btsnd_hcic_ble_set_extend_rand_address(UINT8 adv_handle, BD_ADDR rand_addr
|
||||
return btu_hcif_send_cmd_sync (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
|
||||
}
|
||||
#if (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
UINT8 btsnd_hcic_ble_set_ext_adv_params_v2(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,
|
||||
UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type,
|
||||
UINT8 peer_addr_type, BD_ADDR peer_addr,
|
||||
UINT8 adv_filter_policy, INT8 adv_tx_power,
|
||||
UINT8 primary_adv_phy, UINT8 secondary_adv_max_skip,
|
||||
UINT8 secondary_adv_phy,
|
||||
UINT8 adv_sid, UINT8 scan_req_ntf_enable,
|
||||
UINT8 primary_adv_phy_options, UINT8 secondary_adv_phy_options)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
|
||||
HCI_TRACE_EVENT("%s, adv_handle = %d, properties = %d, interval_min = %d, interval_max = %d, channel_map = %d,\n\
|
||||
own_addr_type = %d, peer_addr_type = %d, adv_filter_policy = %d,\n\
|
||||
adv_tx_power = %d, primary_adv_phy = %d, secondary_adv_max_skip = %d, secondary_adv_phy = %d,\n\
|
||||
adv_sid = %d, scan_req_ntf_enable = %d, primary_phy_options %d secondary_phy_options %d", __func__, adv_handle, properties, interval_min, interval_max,
|
||||
channel_map, own_addr_type, peer_addr_type, adv_filter_policy, adv_tx_power,
|
||||
primary_adv_phy, secondary_adv_max_skip, secondary_adv_phy, adv_sid, scan_req_ntf_enable,
|
||||
primary_adv_phy_options, secondary_adv_phy_options);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_EXT_ADV_SET_PARAMS + 2);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_EXT_ADV_PARAM_V2);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_EXT_ADV_SET_PARAMS + 2);
|
||||
|
||||
UINT8_TO_STREAM(pp, adv_handle);
|
||||
UINT16_TO_STREAM(pp, properties);
|
||||
UINT24_TO_STREAM(pp, interval_min);
|
||||
UINT24_TO_STREAM(pp, interval_max);
|
||||
UINT8_TO_STREAM(pp, channel_map);
|
||||
UINT8_TO_STREAM(pp, own_addr_type);
|
||||
UINT8_TO_STREAM(pp, peer_addr_type);
|
||||
BDADDR_TO_STREAM (pp, peer_addr);
|
||||
UINT8_TO_STREAM(pp, adv_filter_policy);
|
||||
INT8_TO_STREAM(pp, adv_tx_power);
|
||||
UINT8_TO_STREAM(pp, primary_adv_phy);
|
||||
UINT8_TO_STREAM(pp, secondary_adv_max_skip);
|
||||
UINT8_TO_STREAM(pp, secondary_adv_phy);
|
||||
UINT8_TO_STREAM(pp, adv_sid);
|
||||
UINT8_TO_STREAM(pp, scan_req_ntf_enable);
|
||||
UINT8_TO_STREAM(pp, primary_adv_phy_options);
|
||||
UINT8_TO_STREAM(pp, secondary_adv_phy_options);
|
||||
|
||||
return btu_hcif_send_cmd_sync (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
#else
|
||||
UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,
|
||||
UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type,
|
||||
UINT8 peer_addr_type, BD_ADDR peer_addr,
|
||||
@@ -1270,8 +1318,7 @@ UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UIN
|
||||
|
||||
return btu_hcif_send_cmd_sync (LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
bool ext_adv_flag = false;
|
||||
#endif // #if (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
|
||||
UINT8 btsnd_hcic_ble_set_ext_adv_data(UINT8 adv_handle,
|
||||
UINT8 operation, UINT8 fragment_prefrence,
|
||||
@@ -1281,7 +1328,6 @@ UINT8 btsnd_hcic_ble_set_ext_adv_data(UINT8 adv_handle,
|
||||
UINT8 *pp;
|
||||
HCI_TRACE_EVENT("%s, adv_handle = %d, operation = %d, fragment_prefrence = %d,\
|
||||
data_len = %d", __func__, adv_handle, operation, fragment_prefrence, data_len);
|
||||
ext_adv_flag = true;
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, data_len + 4);
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_EXT_ADV_DATA);
|
||||
@@ -1427,10 +1473,40 @@ UINT8 btsnd_hcic_ble_clear_adv_set(void)
|
||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||
|
||||
#if (BLE_50_PERIODIC_ADV_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_params_v2(UINT8 adv_handle, UINT16 interval_min, UINT16 interval_max,
|
||||
UINT16 propertics, UINT8 num_subevents, UINT8 subevent_interval,
|
||||
UINT8 rsp_slot_delay, UINT8 rsp_slot_spacing, UINT8 num_rsp_slots)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
HCI_TRACE_EVENT("%s, adv_handle = %d, interval_min = %d, interval_max = %d, propertics = %d num_subevents = %d subevent_interval = %d rsp_slot_delay %d rsp_slot_spacing %d num_rsp_slots %d",
|
||||
__func__, adv_handle, interval_min, interval_max, propertics, num_subevents, subevent_interval, rsp_slot_delay, rsp_slot_spacing, num_rsp_slots);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SET_PERIODIC_ADV_PARAMS_V2);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_PERIOD_ADV_PARAMS_V2);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_PERIODIC_ADV_PARAMS_V2);
|
||||
|
||||
UINT8_TO_STREAM(pp, adv_handle);
|
||||
UINT16_TO_STREAM(pp, interval_min);
|
||||
UINT16_TO_STREAM(pp, interval_max);
|
||||
UINT16_TO_STREAM(pp, propertics);
|
||||
UINT8_TO_STREAM(pp, num_subevents);
|
||||
UINT8_TO_STREAM(pp, subevent_interval);
|
||||
UINT8_TO_STREAM(pp, rsp_slot_delay);
|
||||
UINT8_TO_STREAM(pp, rsp_slot_spacing);
|
||||
UINT8_TO_STREAM(pp, num_rsp_slots);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_params(UINT8 adv_handle,
|
||||
UINT16 interval_min,
|
||||
UINT16 interval_max,
|
||||
UINT8 propertics)
|
||||
UINT16 propertics)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
@@ -1451,6 +1527,9 @@ UINT8 btsnd_hcic_ble_set_periodic_adv_params(UINT8 adv_handle,
|
||||
|
||||
}
|
||||
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_data(UINT8 adv_handle,
|
||||
UINT8 operation,
|
||||
UINT8 len,
|
||||
@@ -1624,6 +1703,82 @@ BOOLEAN btsnd_hcic_ble_create_ext_conn(tHCI_CreatExtConn *p_conn)
|
||||
|
||||
}
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
BOOLEAN btsnd_hcic_ble_create_ext_conn_v2(tHCI_CreatExtConn *p_conn)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
tHCI_ExtConnParams *params;
|
||||
HCI_TRACE_EVENT("%s", __func__);
|
||||
uint8_t size = HCIC_PARAM_SIZE_EXT_CONN_CREATE_BASE + 2;
|
||||
|
||||
if (p_conn->init_phy_mask & 0x01) {
|
||||
size += sizeof(tHCI_ExtConnParams);
|
||||
}
|
||||
|
||||
if (p_conn->init_phy_mask & 0x02) {
|
||||
size += sizeof(tHCI_ExtConnParams);
|
||||
}
|
||||
|
||||
if (p_conn->init_phy_mask & 0x04) {
|
||||
size += sizeof(tHCI_ExtConnParams);
|
||||
}
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, size);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_EXT_CREATE_CONN_V2);
|
||||
UINT8_TO_STREAM(pp, size);
|
||||
UINT8_TO_STREAM(pp, p_conn->adv_handle);
|
||||
UINT8_TO_STREAM(pp, p_conn->subevent);
|
||||
UINT8_TO_STREAM(pp, p_conn->filter_policy);
|
||||
UINT8_TO_STREAM(pp, p_conn->filter_policy);
|
||||
UINT8_TO_STREAM(pp, p_conn->own_addr_type);
|
||||
UINT8_TO_STREAM(pp, p_conn->peer_addr_type);
|
||||
BDADDR_TO_STREAM(pp, p_conn->peer_addr);
|
||||
UINT8_TO_STREAM(pp, p_conn->init_phy_mask);
|
||||
|
||||
if (p_conn->init_phy_mask & 0x01) {
|
||||
params = &p_conn->params[0];
|
||||
UINT16_TO_STREAM(pp, params->scan_interval);
|
||||
UINT16_TO_STREAM(pp, params->scan_window);
|
||||
UINT16_TO_STREAM(pp, params->conn_interval_min);
|
||||
UINT16_TO_STREAM(pp, params->conn_interval_max);
|
||||
UINT16_TO_STREAM(pp, params->conn_latency);
|
||||
UINT16_TO_STREAM(pp, params->sup_timeout);
|
||||
UINT16_TO_STREAM(pp, params->min_ce_len ? params->min_ce_len : BLE_CE_LEN_MIN);
|
||||
UINT16_TO_STREAM(pp, params->max_ce_len ? params->max_ce_len : BLE_CE_LEN_MIN);
|
||||
}
|
||||
|
||||
if (p_conn->init_phy_mask & 0x02) {
|
||||
params = &p_conn->params[1];
|
||||
UINT16_TO_STREAM(pp, params->scan_interval);
|
||||
UINT16_TO_STREAM(pp, params->scan_window);
|
||||
UINT16_TO_STREAM(pp, params->conn_interval_min);
|
||||
UINT16_TO_STREAM(pp, params->conn_interval_max);
|
||||
UINT16_TO_STREAM(pp, params->conn_latency);
|
||||
UINT16_TO_STREAM(pp, params->sup_timeout);
|
||||
UINT16_TO_STREAM(pp, params->min_ce_len ? params->min_ce_len : BLE_CE_LEN_MIN);
|
||||
UINT16_TO_STREAM(pp, params->max_ce_len ? params->max_ce_len : BLE_CE_LEN_MIN);
|
||||
}
|
||||
|
||||
if (p_conn->init_phy_mask & 0x04) {
|
||||
params = &p_conn->params[2];
|
||||
UINT16_TO_STREAM(pp, params->scan_interval);
|
||||
UINT16_TO_STREAM(pp, params->scan_window);
|
||||
UINT16_TO_STREAM(pp, params->conn_interval_min);
|
||||
UINT16_TO_STREAM(pp, params->conn_interval_max);
|
||||
UINT16_TO_STREAM(pp, params->conn_latency);
|
||||
UINT16_TO_STREAM(pp, params->sup_timeout);
|
||||
UINT16_TO_STREAM(pp, params->min_ce_len ? params->min_ce_len : BLE_CE_LEN_MIN);
|
||||
UINT16_TO_STREAM(pp, params->max_ce_len ? params->max_ce_len : BLE_CE_LEN_MIN);
|
||||
}
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 option, UINT8 adv_sid,
|
||||
UINT8 adv_addr_type, BD_ADDR adv_addr,
|
||||
@@ -2814,3 +2969,435 @@ UINT8 btsnd_hcic_ble_set_host_feature(uint16_t bit_num, uint8_t bit_val)
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == 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)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
uint8_t param_len = 0;
|
||||
|
||||
HCI_TRACE_DEBUG("hci set PA subevent data, adv_handle %d num_subevents_with_data %d", adv_handle, num_subevents_with_data);
|
||||
|
||||
if (!subevent_params) {
|
||||
HCI_TRACE_ERROR("%s error\n", __func__);
|
||||
return HCI_ERR_ILLEGAL_PARAMETER_FMT;
|
||||
}
|
||||
param_len += HCIC_PARAM_SIZE_SET_PA_SUBEVT_DATA_PARAMS_LEN;
|
||||
|
||||
for (UINT8 i = 0; i < num_subevents_with_data; i++)
|
||||
{
|
||||
HCI_TRACE_DEBUG("subevent_params: subevent %d response_slot_start %d response_slot_count %d subevent_data_len %d",
|
||||
subevent_params[i].subevent, subevent_params[i].response_slot_start, subevent_params[i].response_slot_count,
|
||||
subevent_params[i].subevent_data_len);
|
||||
|
||||
if (subevent_params[i].subevent_data_len) {
|
||||
esp_log_buffer_hex_internal("data", subevent_params[i].data, subevent_params[i].subevent_data_len, ESP_LOG_DEBUG);
|
||||
}
|
||||
|
||||
param_len += (4 + subevent_params->subevent_data_len);
|
||||
}
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, param_len);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_PERIOD_ADV_SUBEVT_DATA);
|
||||
UINT8_TO_STREAM(pp, param_len);
|
||||
|
||||
UINT8_TO_STREAM(pp, adv_handle);
|
||||
UINT8_TO_STREAM(pp, num_subevents_with_data);
|
||||
for (UINT8 i = 0; i < num_subevents_with_data; i++)
|
||||
{
|
||||
UINT8_TO_STREAM(pp, subevent_params[i].subevent);
|
||||
UINT8_TO_STREAM(pp, subevent_params[i].response_slot_start);
|
||||
UINT8_TO_STREAM(pp, subevent_params[i].response_slot_count);
|
||||
UINT8_TO_STREAM(pp, subevent_params[i].subevent_data_len);
|
||||
if (subevent_params[i].subevent_data_len) {
|
||||
ARRAY_TO_STREAM(pp, subevent_params[i].data, subevent_params[i].subevent_data_len);
|
||||
}
|
||||
}
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_rsp_data(UINT16 sync_handle, UINT16 req_evt, UINT8 req_subevt, UINT8 rsp_subevt, UINT8 rsp_slot, UINT8 rsp_data_len, UINT8 *rsp_data)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("hci set PA rsp data, sync_handle %d req_evt %d req_subevt %d rsp_subevt %d rsp_slot %d rsp_data_len %d",
|
||||
sync_handle, req_evt, req_subevt, rsp_subevt, rsp_slot, rsp_data_len);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SET_PA_RESPONSE_DATA_PARAMS_LEN + rsp_data_len);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_PERIOD_ADV_RSP_DATA);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_PA_RESPONSE_DATA_PARAMS_LEN + rsp_data_len);
|
||||
|
||||
UINT16_TO_STREAM(pp, sync_handle);
|
||||
UINT16_TO_STREAM(pp, req_evt);
|
||||
UINT8_TO_STREAM(pp, req_subevt);
|
||||
UINT8_TO_STREAM(pp, rsp_subevt);
|
||||
UINT8_TO_STREAM(pp, rsp_slot);
|
||||
UINT8_TO_STREAM(pp, rsp_data_len);
|
||||
|
||||
if (rsp_data) {
|
||||
ARRAY_TO_STREAM(pp, rsp_data, rsp_data_len);
|
||||
}
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_set_periodic_sync_subevt(UINT16 sync_handle, UINT16 periodic_adv_properties, UINT8 num_subevents_to_sync, UINT8 *subevt)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("hci set PA sync subevent, sync_handle %d periodic_adv_properties %d num_subevents_to_sync %d",
|
||||
sync_handle, periodic_adv_properties, num_subevents_to_sync);
|
||||
for (UINT8 i = 0; i < num_subevents_to_sync; i++)
|
||||
{
|
||||
HCI_TRACE_DEBUG("subevt[%d] = %d", i, subevt[i]);
|
||||
}
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SET_PA_SYNC_SUBEVT_PARAMS_LEN + num_subevents_to_sync);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_SET_PERIOD_SYNC_SUBEVT);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_PA_SYNC_SUBEVT_PARAMS_LEN + num_subevents_to_sync);
|
||||
|
||||
UINT16_TO_STREAM(pp, sync_handle);
|
||||
UINT16_TO_STREAM(pp, periodic_adv_properties);
|
||||
UINT8_TO_STREAM(pp, num_subevents_to_sync);
|
||||
for (UINT8 i = 0; i < num_subevents_to_sync; i++)
|
||||
{
|
||||
UINT8_TO_STREAM(pp, subevt[i]);
|
||||
}
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
UINT8 btsnd_hcic_ble_cs_read_local_supported_caps(void)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs read local supported caps");
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_READ_LOCAL_SUPP_CAPS_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_READ_LOCAL_SUPP_CAPS);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_READ_LOCAL_SUPP_CAPS_PARAMS_LEN);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_read_remote_supported_capabilities(UINT16 conn_handle)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs read remote supported caps, conn_handle %d", conn_handle);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_READ_REMOTE_SUPP_CAPS_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_READ_REMOTE_SUPP_CAPS);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_READ_REMOTE_SUPP_CAPS_PARAMS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_write_cached_remote_supported_capabilities(UINT16 conn_handle, UINT8 num_config_supported, UINT16 max_consecutive_proc_supported,
|
||||
UINT8 num_ant_supported, UINT8 max_ant_paths_supported, UINT8 roles_supported,
|
||||
UINT8 modes_supported, UINT8 rtt_capability, UINT8 rtt_aa_only_n,
|
||||
UINT8 rtt_sounding_n, UINT8 rtt_random_payload_n, UINT16 NADM_sounding_capability,
|
||||
UINT16 NADM_random_capability, UINT8 cs_sync_phys_supported, UINT16 subfeatures_supported,
|
||||
UINT16 T_IP1_times_supported, UINT16 T_IP2_times_supported, UINT16 T_FCS_times_supported,
|
||||
UINT16 T_PM_times_supported, UINT8 T_SW_times_supported, UINT8 TX_SNR_capability)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs write cached remote supported caps");
|
||||
HCI_TRACE_DEBUG("conn_handle %d num_config_supported %d max_consecutive_proc_supported %d, num_ant_supported %d max_ant_paths_supported %d roles_supported %d,\
|
||||
modes_supported %d, rtt_capability %d, rtt_aa_only_n %d, rtt_sounding_n %d, rtt_random_payload_n %d, NADM_sounding_capability %d, NADM_random_capability %d\
|
||||
,cs_sync_phys_supported %d, subfeatures_supported %d, T_IP1_times_supported %d, T_IP2_times_supported %d, T_FCS_times_supported %d, T_PM_times_supported %d\
|
||||
,T_SW_times_supported %d, TX_SNR_capability %d",
|
||||
conn_handle, num_config_supported, max_consecutive_proc_supported, num_ant_supported, max_ant_paths_supported, roles_supported,
|
||||
modes_supported, rtt_capability, rtt_aa_only_n, rtt_sounding_n, rtt_random_payload_n, NADM_sounding_capability,
|
||||
NADM_random_capability, cs_sync_phys_supported, subfeatures_supported, T_IP1_times_supported, T_IP2_times_supported, T_FCS_times_supported,
|
||||
T_PM_times_supported, T_SW_times_supported, TX_SNR_capability);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_WRITE_CACHE_REMOTE_SUPP_CAPS_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_WRITE_CACHED_REMOTE_SUPP_CAPS);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_WRITE_CACHE_REMOTE_SUPP_CAPS_PARAMS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, num_config_supported);
|
||||
UINT16_TO_STREAM(pp, max_consecutive_proc_supported);
|
||||
UINT8_TO_STREAM(pp, num_ant_supported);
|
||||
UINT8_TO_STREAM(pp, max_ant_paths_supported);
|
||||
UINT8_TO_STREAM(pp, roles_supported);
|
||||
UINT8_TO_STREAM(pp, modes_supported);
|
||||
UINT8_TO_STREAM(pp, rtt_capability);
|
||||
UINT8_TO_STREAM(pp, rtt_aa_only_n);
|
||||
UINT8_TO_STREAM(pp, rtt_sounding_n);
|
||||
UINT8_TO_STREAM(pp, rtt_random_payload_n);
|
||||
UINT16_TO_STREAM(pp, NADM_sounding_capability);
|
||||
UINT16_TO_STREAM(pp, NADM_random_capability);
|
||||
UINT8_TO_STREAM(pp, cs_sync_phys_supported);
|
||||
UINT16_TO_STREAM(pp, subfeatures_supported);
|
||||
UINT16_TO_STREAM(pp, T_IP1_times_supported);
|
||||
UINT16_TO_STREAM(pp, T_IP2_times_supported);
|
||||
UINT16_TO_STREAM(pp, T_FCS_times_supported);
|
||||
UINT16_TO_STREAM(pp, T_PM_times_supported);
|
||||
UINT8_TO_STREAM(pp, T_SW_times_supported);
|
||||
UINT8_TO_STREAM(pp, TX_SNR_capability);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_security_enable(UINT16 conn_handle)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs security enable conn_handle %d", conn_handle);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SECURITY_ENABLE_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_SECURITY_ENABLE);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SECURITY_ENABLE_PARAMS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_set_default_settings(UINT16 conn_handle, UINT8 role_enable, UINT8 cs_sync_ant_selection, INT8 max_tx_power)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs set default settings, conn_handle %d role_enable %d cs_sync_ant_selection %d max_tx_power %d", conn_handle, role_enable, cs_sync_ant_selection, max_tx_power);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SET_DEFAULT_SETTINGS_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_SET_DEFAULT_SETTINGS);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_DEFAULT_SETTINGS_PARAMS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, role_enable);
|
||||
UINT8_TO_STREAM(pp, cs_sync_ant_selection);
|
||||
INT8_TO_STREAM(pp, max_tx_power);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_read_remote_fae_table(UINT16 conn_handle)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs read remote fae table, conn_handle %d", conn_handle);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_READ_REMOTE_FAE_TAB_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_READ_REMOTE_FAE_TABLE);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_READ_REMOTE_FAE_TAB_PARAMS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_write_cached_remote_fae_table(UINT16 conn_handle, UINT8 *remote_fae_table)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs write cached remote fae table, conn_handle %d", conn_handle);
|
||||
esp_log_buffer_hex_internal("remote_fae_table", remote_fae_table, 72, ESP_LOG_DEBUG);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_WRITE_CACHED_REMOTE_FAE_TAB_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_WRITE_CACHED_REMOTE_FAE_TABLE);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_WRITE_CACHED_REMOTE_FAE_TAB_PARAMS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
ARRAY_TO_STREAM(pp, remote_fae_table, 72);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_create_config(UINT16 conn_handle, UINT8 config_id, UINT8 create_context,
|
||||
UINT8 main_mode_type, UINT8 sub_mode_type, UINT8 min_main_mode_steps,
|
||||
UINT8 max_main_mode_steps, UINT8 main_mode_repetition, UINT8 mode_0_steps,
|
||||
UINT8 role, UINT8 rtt_type, UINT8 cs_sync_phy, UINT8 *channel_map,
|
||||
UINT8 channel_map_repetition, UINT8 channel_selection_type, UINT8 ch3c_shape,
|
||||
UINT8 ch3c_jump,UINT8 reserved)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs create config");
|
||||
HCI_TRACE_DEBUG("conn_handle %d config_id %d create_context %d main_mode_type %d sub_mode_type %d min_main_mode_steps %d max_main_mode_steps\
|
||||
%d main_mode_repetition %d mode_0_steps %d role %d rtt_type %d cs_sync_phy %d, channel_map_repetition %d, channel_selection_type %d\
|
||||
ch3c_shape %d ch3c_jump %d,reserved %d", conn_handle, config_id, create_context, main_mode_type, sub_mode_type, min_main_mode_steps, max_main_mode_steps,\
|
||||
main_mode_repetition, mode_0_steps, role, rtt_type, cs_sync_phy, channel_map_repetition, channel_selection_type\
|
||||
,ch3c_shape, ch3c_jump, reserved);
|
||||
esp_log_buffer_hex_internal("channel_map", channel_map, 10, ESP_LOG_DEBUG);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_CREATE_CONFIG_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_CREATE_CONFIG);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_CREATE_CONFIG_PARAMS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, config_id);
|
||||
UINT8_TO_STREAM(pp, create_context);
|
||||
UINT8_TO_STREAM(pp, main_mode_type);
|
||||
UINT8_TO_STREAM(pp, sub_mode_type);
|
||||
UINT8_TO_STREAM(pp, min_main_mode_steps);
|
||||
UINT8_TO_STREAM(pp, max_main_mode_steps);
|
||||
UINT8_TO_STREAM(pp, main_mode_repetition);
|
||||
UINT8_TO_STREAM(pp, mode_0_steps);
|
||||
UINT8_TO_STREAM(pp, role);
|
||||
UINT8_TO_STREAM(pp, rtt_type);
|
||||
UINT8_TO_STREAM(pp, cs_sync_phy);
|
||||
ARRAY_TO_STREAM(pp, channel_map, 10);
|
||||
UINT8_TO_STREAM(pp, channel_map_repetition);
|
||||
UINT8_TO_STREAM(pp, channel_selection_type);
|
||||
UINT8_TO_STREAM(pp, ch3c_shape);
|
||||
UINT8_TO_STREAM(pp, ch3c_jump);
|
||||
UINT8_TO_STREAM(pp, reserved);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_remove_config(UINT16 conn_handle, UINT8 config_id)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs remove config, conn_handle %d config_id %d", conn_handle, config_id);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_REMOVE_CONFIG_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_REMOVE_CONFIG);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_REMOVE_CONFIG_PARAMS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, config_id);
|
||||
|
||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_set_channel_classification(UINT8 *channel_class)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs set channel class");
|
||||
esp_log_buffer_hex_internal("channel", channel_class, 10, ESP_LOG_DEBUG);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SET_CHANNEL_CLASS_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_SET_CAHNNEL_CLASS);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_CHANNEL_CLASS_PARAMS_LEN);
|
||||
ARRAY_TO_STREAM(pp, channel_class, 10);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_set_procedure_params(UINT16 conn_handle, UINT8 config_id, UINT16 max_procedure_len,
|
||||
UINT16 min_procedure_interval, UINT16 max_procedure_interval,
|
||||
UINT16 max_procedure_count, UINT32 min_subevent_len,
|
||||
UINT32 max_subevent_len, UINT8 tone_ant_config_selection,
|
||||
UINT8 phy, UINT8 tx_power_delta, UINT8 preferred_peer_antenna,
|
||||
UINT8 SNR_control_initiator, UINT8 SNR_control_reflector)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs set procedure params");
|
||||
HCI_TRACE_DEBUG("conn_handle %d config_id %d max_procedure_len %d min_procedure_interval %d max_procedure_interval %d\
|
||||
max_procedure_count %d min_subevent_len %d max_subevent_len %d tone_ant_config_selection %d phy %d tx_power_delta %d,\
|
||||
preferred_peer_antenna %d SNR_control_initiator %d SNR_control_reflector %d\n",
|
||||
conn_handle, config_id, max_procedure_len, min_procedure_interval, max_procedure_interval, max_procedure_count, min_subevent_len, max_subevent_len,
|
||||
tone_ant_config_selection, phy, tx_power_delta, preferred_peer_antenna, SNR_control_initiator, SNR_control_reflector);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SET_PROCEDURE_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_SET_PROCEDURE_PARAMS);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_PROCEDURE_PARAMS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, config_id);
|
||||
UINT16_TO_STREAM(pp, max_procedure_len);
|
||||
UINT16_TO_STREAM(pp, min_procedure_interval);
|
||||
UINT16_TO_STREAM(pp, max_procedure_interval);
|
||||
UINT16_TO_STREAM(pp, max_procedure_count);
|
||||
UINT24_TO_STREAM(pp, min_subevent_len);
|
||||
UINT24_TO_STREAM(pp, max_subevent_len);
|
||||
UINT8_TO_STREAM(pp, tone_ant_config_selection);
|
||||
UINT8_TO_STREAM(pp, phy);
|
||||
UINT8_TO_STREAM(pp, tx_power_delta);
|
||||
UINT8_TO_STREAM(pp, preferred_peer_antenna);
|
||||
UINT8_TO_STREAM(pp, SNR_control_initiator);
|
||||
UINT8_TO_STREAM(pp, SNR_control_reflector);
|
||||
|
||||
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
}
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_procedure_enable(UINT16 conn_handle, UINT8 config_id, UINT8 enable)
|
||||
{
|
||||
BT_HDR *p;
|
||||
UINT8 *pp;
|
||||
|
||||
HCI_TRACE_DEBUG("cs set procedure enable, conn_handle %d config_id %d enable %d", conn_handle, config_id, enable);
|
||||
|
||||
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_SET_PROCEDURE_ENABLE_PARAMS_LEN);
|
||||
|
||||
pp = (UINT8 *)(p + 1);
|
||||
|
||||
UINT16_TO_STREAM(pp, HCI_BLE_CS_SET_PROCEDURE_ENABLE);
|
||||
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_SET_PROCEDURE_ENABLE_PARAMS_LEN);
|
||||
UINT16_TO_STREAM(pp, conn_handle);
|
||||
UINT8_TO_STREAM(pp, config_id);
|
||||
UINT8_TO_STREAM(pp, enable);
|
||||
|
||||
btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
@@ -781,6 +781,10 @@ typedef struct {
|
||||
tBTM_BLE_GAP_PHY secondary_phy;
|
||||
UINT8 sid;
|
||||
BOOLEAN scan_req_notif;
|
||||
#if (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
UINT8 primary_adv_phy_options;
|
||||
UINT8 secondary_adv_phy_options;
|
||||
#endif // (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
} tBTM_BLE_GAP_EXT_ADV_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
@@ -808,7 +812,14 @@ typedef struct {
|
||||
typedef struct {
|
||||
UINT16 interval_min;
|
||||
UINT16 interval_max;
|
||||
UINT8 properties;
|
||||
UINT16 properties;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
UINT8 num_subevents;
|
||||
UINT8 subevent_interval;
|
||||
UINT8 rsp_slot_delay;
|
||||
UINT8 rsp_slot_spacing;
|
||||
UINT8 num_rsp_slots;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
} tBTM_BLE_Periodic_Adv_Params;
|
||||
|
||||
typedef struct {
|
||||
@@ -1090,7 +1101,29 @@ typedef void (tBTM_SET_VENDOR_EVT_MASK_CBACK) (tBTM_STATUS status);
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#define BTM_BLE_GAP_SET_HOST_FEATURE_EVT 51
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
#define BTM_BLE_5_GAP_UNKNOWN_EVT 52
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#define BTM_BLE_GAP_SET_PERIODIC_ADV_SUBEVT_DATA_EVT 52
|
||||
#define BTM_BLE_GAP_SET_PERIODIC_ADV_RESPONSE_DATA_EVT 53
|
||||
#define BTM_BLE_GAP_SET_PERIODIC_SYNC_SUBEVT_EVT 54
|
||||
#define BTM_BLE_GAP_PERIODIC_ADV_SUBEVT_DATA_REQUEST_EVT 55
|
||||
#define BTM_BLE_GAP_PERIODIC_ADV_RESPONSE_REPORT_EVT 56
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
#define BTM_BLE_GAP_CS_READ_LOCAL_SUPP_CAPS_EVT 57
|
||||
#define BTM_BLE_GAP_CS_WRITE_CACHED_REMOTE_SUPP_CAPS_EVT 58
|
||||
#define BTM_BLE_GAP_CS_SET_DEFAULT_SETTINGS_EVT 59
|
||||
#define BTM_BLE_GAP_CS_WRITE_CACHED_REMOTE_FAE_TAB_EVT 60
|
||||
#define BTM_BLE_GAP_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT 61
|
||||
#define BTM_BLE_GAP_CS_SET_CHANNEL_CLASS_CMPL_EVT 62
|
||||
#define BTM_BLE_GAP_CS_PROC_PARAMS_CMPL_EVT 63
|
||||
#define BTM_BLE_GAP_CS_PROC_ENABLE_CMPL_EVT 64
|
||||
#define BTM_BLE_GAP_CS_READ_REMOTE_FAE_TABLE_CMPL_EVT 65
|
||||
#define BTM_BLE_GAP_CS_SECURITY_ENABLE_CMPL_EVT 66
|
||||
#define BTM_BLE_GAP_CS_CONFIG_CMPL_EVT 67
|
||||
#define BTM_BLE_GAP_CS_SUBEVENT_RESULT_EVT 68
|
||||
#define BTM_BLE_GAP_CS_SUBEVENT_RESULT_CONTINUE_EVT 69
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
#define BTM_BLE_5_GAP_UNKNOWN_EVT 70
|
||||
typedef UINT8 tBTM_BLE_5_GAP_EVENT;
|
||||
|
||||
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||
@@ -1332,6 +1365,10 @@ typedef struct {
|
||||
UINT8 tx_power;
|
||||
INT8 rssi;
|
||||
UINT8 cte_type;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
UINT16 periodic_evt_cnt;
|
||||
UINT8 subevt;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
tBTM_BLE_EXT_ADV_DATA_STATUS data_status;
|
||||
UINT8 data_length;
|
||||
UINT8 *data;
|
||||
@@ -1350,6 +1387,12 @@ typedef struct {
|
||||
UINT8 adv_phy;
|
||||
UINT16 period_adv_interval;
|
||||
UINT8 adv_clk_accuracy;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
UINT8 num_subevt;
|
||||
UINT8 subevt_interval;
|
||||
UINT8 rsp_slot_delay;
|
||||
UINT8 rsp_slot_spacing;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
} tBTM_BLE_PERIOD_ADV_SYNC_ESTAB;
|
||||
|
||||
typedef struct {
|
||||
@@ -1453,6 +1496,199 @@ typedef struct {
|
||||
} __attribute__((packed)) tBTM_BLE_SUBRATE_CHANGE_EVT;
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT8 adv_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_PA_SUBEVT_DATA_EVT;
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 sync_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_PA_RSP_DATA_EVT;
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 sync_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_PA_SYNC_SUBEVT_DATA_EVT;
|
||||
typedef struct {
|
||||
UINT8 adv_handle;
|
||||
UINT8 subevt_start;
|
||||
UINT8 subevt_data_count;
|
||||
} __attribute__((packed)) tBTM_BLE_PA_SUBEVT_DATA_REQ_EVT;
|
||||
|
||||
typedef struct {
|
||||
INT8 tx_power;
|
||||
INT8 rssi;
|
||||
UINT8 cte_type;
|
||||
UINT8 rsp_slot;
|
||||
UINT8 data_status;
|
||||
UINT8 data_len;
|
||||
UINT8 *data;
|
||||
} __attribute__((packed)) tBTM_BLE_PA_RSP_DATA_INFO;
|
||||
|
||||
typedef struct {
|
||||
UINT8 adv_handle;
|
||||
UINT8 subevt;
|
||||
UINT8 tx_status;
|
||||
UINT8 num_rsp;
|
||||
tBTM_BLE_PA_RSP_DATA_INFO *rsp_data_info;
|
||||
} __attribute__((packed)) tBTM_BLE_PA_RSP_REPORT_EVT;
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_CS_WRITE_CACHED_SUPPORT_CAPS_EVT;
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_CS_SET_DEFAULT_SETTINGS_EVT;
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_CS_WRITE_CACHED_REMOTE_FAE_TAB_EVT;
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_CS_SET_PAROC_PARAMS_EVT;
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
UINT8 num_config_supported;
|
||||
UINT16 max_consecutive_proc_supported;
|
||||
UINT8 num_ant_supported;
|
||||
UINT8 max_ant_paths_supported;
|
||||
UINT8 roles_supported;
|
||||
UINT8 modes_supported;
|
||||
UINT8 rtt_capability;
|
||||
UINT8 rtt_aa_only_n;
|
||||
UINT8 rtt_sounding_n;
|
||||
UINT8 rtt_random_payload_n;
|
||||
UINT16 NADM_sounding_capability;
|
||||
UINT16 NADM_random_capability;
|
||||
UINT8 cs_sync_phys_supported;
|
||||
UINT16 subfeatures_supported;
|
||||
UINT16 T_IP1_times_supported;
|
||||
UINT16 T_IP2_times_supported;
|
||||
UINT16 T_FCS_times_supported;
|
||||
UINT16 T_PM_times_supported;
|
||||
UINT8 T_SW_times_supported;
|
||||
UINT8 TX_SNR_capability;
|
||||
} __attribute__((packed)) tBTM_BLE_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT;
|
||||
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
UINT8 remote_fae_table[72];
|
||||
} __attribute__((packed)) tBTM_BLE_CS_READ_REMOTE_FAE_TAB_CMPL_EVT;
|
||||
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
} __attribute__((packed)) tBTM_BLE_CS_SEC_ENABLE_CMPL_EVT;
|
||||
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
UINT8 config_id;
|
||||
UINT8 action;
|
||||
UINT8 main_mode_type;
|
||||
UINT8 sub_mode_type;
|
||||
UINT8 min_main_mode_steps;
|
||||
UINT8 max_main_mode_steps;
|
||||
UINT8 main_mode_repetition;
|
||||
UINT8 mode_0_steps;
|
||||
UINT8 role;
|
||||
UINT8 rtt_type;
|
||||
UINT8 cs_sync_phy;
|
||||
UINT8 channel_map[10];
|
||||
UINT8 channel_map_repetition;
|
||||
UINT8 channel_selection_type;
|
||||
UINT8 ch3c_shape;
|
||||
UINT8 ch3c_jump;
|
||||
UINT8 reserved;
|
||||
UINT8 t_ip1_time;
|
||||
UINT8 t_ip2_time;
|
||||
UINT8 t_fcs_time;
|
||||
UINT8 t_pm_time;
|
||||
}__attribute__((packed)) tBTM_BLE_CS_CONFIG_CMPL_EVT;
|
||||
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
UINT8 config_id;
|
||||
UINT8 state;
|
||||
UINT8 tone_ant_config_select;
|
||||
INT8 select_tx_power;
|
||||
UINT32 subevent_Len;
|
||||
UINT8 subevents_per_event;
|
||||
UINT16 subevent_interval;
|
||||
UINT16 event_interval;
|
||||
UINT16 procedure_interval;
|
||||
UINT16 procedure_count;
|
||||
UINT16 max_procedure_len;
|
||||
}__attribute__((packed)) tBTM_BLE_CS_PROC_ENABLE_CMPL_EVT;
|
||||
|
||||
typedef struct {
|
||||
UINT8 step_mode;
|
||||
UINT8 step_channel;
|
||||
UINT8 step_data_len;
|
||||
UINT8 *data;
|
||||
} __attribute__((packed)) tBTM_BLE_CS_STEP_INFO;
|
||||
|
||||
typedef struct {
|
||||
UINT16 conn_handle;
|
||||
UINT8 config_id;
|
||||
UINT16 start_acl_conn_event_counter;
|
||||
UINT16 procedure_counter;
|
||||
INT16 frequency_compensation;
|
||||
INT8 reference_power_level;
|
||||
UINT8 procedure_done_status;
|
||||
UINT8 subevent_done_status;
|
||||
UINT8 abort_reason;
|
||||
UINT8 num_ant_paths;
|
||||
UINT8 num_steps_reported;
|
||||
tBTM_BLE_CS_STEP_INFO *step_info;
|
||||
}__attribute__((packed)) tBTM_BLE_CS_SUBEVT_RESULT_CMPL_EVT;
|
||||
|
||||
typedef struct {
|
||||
UINT16 conn_handle;
|
||||
UINT8 config_id;
|
||||
UINT8 proc_done_status;
|
||||
UINT8 subevt_done_status;
|
||||
UINT8 abort_reason;
|
||||
UINT8 num_ant_paths;
|
||||
UINT8 num_steps_reported;
|
||||
tBTM_BLE_CS_STEP_INFO *step_info;
|
||||
}__attribute__((packed)) tBTM_BLE_CS_SUBEVT_RESULT_CONTINUE_EVT;
|
||||
|
||||
typedef struct {
|
||||
UINT8 status;
|
||||
UINT16 conn_handle;
|
||||
UINT8 num_config_supported;
|
||||
UINT16 max_consecutive_proc_supported;
|
||||
UINT8 num_ant_supported;
|
||||
UINT8 max_ant_paths_supported;
|
||||
UINT8 roles_supported;
|
||||
UINT8 modes_supported;
|
||||
UINT8 rtt_capability;
|
||||
UINT8 rtt_aa_only_n;
|
||||
UINT8 rtt_sounding_n;
|
||||
UINT8 rtt_random_payload_n;
|
||||
UINT16 NADM_sounding_capability;
|
||||
UINT16 NADM_random_capability;
|
||||
UINT8 cs_sync_phys_supported;
|
||||
UINT16 subfeatures_supported;
|
||||
UINT16 T_IP1_times_supported;
|
||||
UINT16 T_IP2_times_supported;
|
||||
UINT16 T_FCS_times_supported;
|
||||
UINT16 T_PM_times_supported;
|
||||
UINT8 T_SW_times_supported;
|
||||
UINT8 TX_SNR_capability;
|
||||
} __attribute__((packed)) tBTM_BLE_CS_READ_LOCAL_SUPP_CAPS_CMPL_EVT;
|
||||
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||
typedef struct {
|
||||
@@ -1819,6 +2055,27 @@ typedef union {
|
||||
#if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
tBTM_BLE_SUBRATE_CHANGE_EVT subrate_change_evt;
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
tBTM_BLE_PA_SUBEVT_DATA_EVT pa_subevt_data_evt;
|
||||
tBTM_BLE_PA_RSP_DATA_EVT pa_rsp_data_evt;
|
||||
tBTM_BLE_PA_SYNC_SUBEVT_DATA_EVT pa_sync_subevt_evt;
|
||||
tBTM_BLE_PA_SUBEVT_DATA_REQ_EVT pa_subevent_data_req_evt;
|
||||
tBTM_BLE_PA_RSP_REPORT_EVT pa_rsp_rpt_evt;
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
tBTM_BLE_CS_WRITE_CACHED_SUPPORT_CAPS_EVT cs_write_cached_remote_supp_caps;
|
||||
tBTM_BLE_CS_SET_DEFAULT_SETTINGS_EVT cs_set_default_settings;
|
||||
tBTM_BLE_CS_WRITE_CACHED_REMOTE_FAE_TAB_EVT cs_write_cached_remote_fae_tab;
|
||||
tBTM_BLE_CS_SET_PAROC_PARAMS_EVT cs_set_proc_params;
|
||||
tBTM_BLE_CS_READ_LOCAL_SUPP_CAPS_CMPL_EVT cs_read_local_supp_caps;
|
||||
tBTM_BLE_CS_READ_REMOTE_SUPP_CAPS_CMPL_EVT cs_read_remote_supp_caps;
|
||||
tBTM_BLE_CS_READ_REMOTE_FAE_TAB_CMPL_EVT cs_read_remote_fae_tab;
|
||||
tBTM_BLE_CS_SEC_ENABLE_CMPL_EVT cs_security_enable;
|
||||
tBTM_BLE_CS_PROC_ENABLE_CMPL_EVT cs_proc_en;
|
||||
tBTM_BLE_CS_CONFIG_CMPL_EVT cs_config_update;
|
||||
tBTM_BLE_CS_SUBEVT_RESULT_CMPL_EVT cs_subevt_result;
|
||||
tBTM_BLE_CS_SUBEVT_RESULT_CONTINUE_EVT cs_subevt_result_continue;
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
} tBTM_BLE_5_GAP_CB_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
@@ -3371,7 +3628,46 @@ void BTM_BleSetDefaultSubrate(UINT16 subrate_min, UINT16 subrate_max, UINT16 max
|
||||
void BTM_BleSubrateRequest(UINT16 conn_handle, UINT16 subrate_min, UINT16 subrate_max,
|
||||
UINT16 max_latency, UINT16 continuation_number, UINT16 supervision_timeout);
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
tBTM_STATUS BTM_BleSetHostFeature(uint16_t bit_num, uint8_t bit_val);
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
void BTM_BleSetPaSubeventData(UINT8 adv_handle, UINT8 num_subevents_with_data, uint8_t *subevent_params);
|
||||
void BTM_BleSetPaResponseData(UINT16 sync_handle, UINT16 req_evt, UINT8 req_subevt, UINT8 rsp_subevt, UINT8 rsp_slot, UINT8 rsp_data_len, UINT8 *rsp_data);
|
||||
void BTM_BleSetPaSyncSubevt(UINT16 sync_handle, UINT16 periodic_adv_properties, UINT8 num_subevents_to_sync, UINT8 *subevt);
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
void BTM_BleCSReadLocalSuppCaps(void);
|
||||
void BTM_BleCSReadRemoteSuppCaps(UINT16 conn_handle);
|
||||
void BTM_BleGapWriteCachedRemoteSupportedCaps(UINT16 conn_handle, UINT8 num_config_supported, UINT16 max_consecutive_proc_supported,
|
||||
UINT8 num_ant_supported, UINT8 max_ant_paths_supported, UINT8 roles_supported,
|
||||
UINT8 modes_supported, UINT8 rtt_capability, UINT8 rtt_aa_only_n,
|
||||
UINT8 rtt_sounding_n, UINT8 rtt_random_payload_n, UINT16 NADM_sounding_capability,
|
||||
UINT16 NADM_random_capability, UINT8 cs_sync_phys_supported, UINT16 subfeatures_supported,
|
||||
UINT16 T_IP1_times_supported, UINT16 T_IP2_times_supported, UINT16 T_FCS_times_supported,
|
||||
UINT16 T_PM_times_supported, UINT8 T_SW_times_supported, UINT8 TX_SNR_capability);
|
||||
void BTM_BleGapCsSecurityEnable(UINT16 conn_handle);
|
||||
void BTM_BleGapCsSetDefaultSetting(UINT16 conn_handle, UINT8 role_enable, UINT8 cs_sync_ant_selection, INT8 max_tx_power);
|
||||
void BTM_BleGapCsReadRemoteFaeTable(UINT16 conn_handle);
|
||||
void BTM_BleGapWriteCachedRemoteFaeTable(UINT16 conn_handle, UINT8 *remote_fae_table);
|
||||
void BTM_BleGapCsCreateConfig(UINT16 conn_handle, UINT8 config_id, UINT8 create_context,
|
||||
UINT8 main_mode_type, UINT8 sub_mode_type, UINT8 min_main_mode_steps,
|
||||
UINT8 max_main_mode_steps, UINT8 main_mode_repetition, UINT8 mode_0_steps,
|
||||
UINT8 role, UINT8 rtt_type, UINT8 cs_sync_phy, UINT8 *channel_map,
|
||||
UINT8 channel_map_repetition, UINT8 channel_selection_type, UINT8 ch3c_shape,
|
||||
UINT8 ch3c_jump,UINT8 reserved);
|
||||
void BTM_BleGapCsRemoveConfig(UINT16 conn_handle, UINT8 config_id);
|
||||
void BTM_BleGapCsSetChannelClass(UINT8 *channel_class);
|
||||
void BTM_BleGapCsSetProcPatams(UINT16 conn_handle, UINT8 config_id, UINT16 max_procedure_len,
|
||||
UINT16 min_procedure_interval, UINT16 max_procedure_interval,
|
||||
UINT16 max_procedure_count, UINT32 min_subevent_len,
|
||||
UINT32 max_subevent_len, UINT8 tone_ant_config_selection,
|
||||
UINT8 phy, UINT8 tx_power_delta, UINT8 preferred_peer_antenna,
|
||||
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)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -119,6 +119,9 @@ typedef union {
|
||||
UINT16 icon;
|
||||
UINT8 *p_dev_name;
|
||||
UINT8 addr_resolution;
|
||||
#if (BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
UINT16 security_level;
|
||||
#endif // (BT_GATTS_SECURITY_LEVELS_CHAR == TRUE)
|
||||
|
||||
} tGAP_BLE_ATTR_VALUE;
|
||||
|
||||
|
||||
@@ -1140,7 +1140,8 @@ extern void GATT_StartIf (tGATT_IF gatt_if);
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern BOOLEAN GATT_Connect (tGATT_IF gatt_if, BD_ADDR bd_addr, tBLE_ADDR_TYPE bd_addr_type,
|
||||
BOOLEAN is_direct, tBT_TRANSPORT transport, BOOLEAN is_aux);
|
||||
BOOLEAN is_direct, tBT_TRANSPORT transport, BOOLEAN is_aux,
|
||||
BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
#define GATT_UUID_GAP_PREF_CONN_PARAM 0x2A04
|
||||
#define GATT_UUID_GAP_CENTRAL_ADDR_RESOL 0x2AA6
|
||||
|
||||
#define GATT_UUID_GAP_GATT_SECURITY_LEVELS 0x2BF5
|
||||
|
||||
/* Attribute Profile Attribute UUID */
|
||||
#define GATT_UUID_GATT_SRV_CHGD 0x2A05
|
||||
/* Attribute Protocol Test */
|
||||
@@ -81,7 +83,7 @@
|
||||
#define GATT_UUID_GM_CONTROL_POINT 0x2A52
|
||||
#define GATT_UUID_GM_FEATURE 0x2A51
|
||||
|
||||
/* device infor characteristic */
|
||||
/* device information characteristic */
|
||||
#define GATT_UUID_SYSTEM_ID 0x2A23
|
||||
#define GATT_UUID_MODEL_NUMBER_STR 0x2A24
|
||||
#define GATT_UUID_SERIAL_NUMBER_STR 0x2A25
|
||||
|
||||
@@ -443,6 +443,33 @@
|
||||
#define HCI_BLE_SUBRATE_REQUEST (0x007E | HCI_GRP_BLE_CMDS)
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
#define HCI_BLE_SET_EXT_ADV_PARAM_V2 (0x007F | HCI_GRP_BLE_CMDS)
|
||||
#endif // (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#define HCI_BLE_SET_PERIOD_ADV_SUBEVT_DATA (0x0082 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_SET_PERIOD_ADV_RSP_DATA (0x0083 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_SET_PERIOD_SYNC_SUBEVT (0x0084 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_EXT_CREATE_CONN_V2 (0x0085 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_SET_PERIOD_ADV_PARAMS_V2 (0x0086 | HCI_GRP_BLE_CMDS)
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == 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)
|
||||
#define HCI_BLE_CS_WRITE_CACHED_REMOTE_SUPP_CAPS (0x008B | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_CS_SECURITY_ENABLE (0x008C | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_CS_SET_DEFAULT_SETTINGS (0x008D | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_CS_READ_REMOTE_FAE_TABLE (0x008E | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_CS_WRITE_CACHED_REMOTE_FAE_TABLE (0x008F | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_CS_CREATE_CONFIG (0x0090 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_CS_REMOVE_CONFIG (0x0091 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_CS_SET_CAHNNEL_CLASS (0x0092 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_CS_SET_PROCEDURE_PARAMS (0x0093 | HCI_GRP_BLE_CMDS)
|
||||
#define HCI_BLE_CS_SET_PROCEDURE_ENABLE (0x0094 | HCI_GRP_BLE_CMDS)
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
// Vendor OGF define
|
||||
#define HCI_VENDOR_OGF 0x3F
|
||||
|
||||
@@ -918,6 +945,24 @@
|
||||
#define HCI_BLE_SUBRATE_CHANGE_EVT 0x23
|
||||
#endif // #if (BLE_FEAT_CONN_SUBRATING == TRUE)
|
||||
|
||||
#define HCI_BLE_PERIOD_ADV_SYNC_ESTAB_EVT_V2 0x24
|
||||
#define HCI_BLE_PERIOD_ADV_REPORT_EVT_V2 0x25
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#define HCI_BLE_PA_SUBEVT_DATA_REQUEST_EVT 0x27
|
||||
#define HCI_BLE_PA_RESPONSE_REPORT_EVT 0x28
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == 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
|
||||
#define HCI_BLE_CS_SECURITY_ENABLE_CMPL_EVT 0x2E
|
||||
#define HCI_BLE_CS_CONFIG_CMPL_EVT 0x2F
|
||||
#define HCI_BLE_CS_PROC_ENABLE_CMPL_EVT 0x30
|
||||
#define HCI_BLE_CS_SUBEVENT_RESULT_EVT 0x31
|
||||
#define HCI_BLE_CS_SUBEVENT_RESULT_CONTINUE_EVT 0x32
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
/* Definitions for LE Channel Map */
|
||||
#define HCI_BLE_CHNL_MAP_SIZE 5
|
||||
|
||||
|
||||
@@ -947,6 +947,10 @@ typedef struct {
|
||||
} tHCI_ExtConnParams;
|
||||
|
||||
typedef struct {
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
UINT8 adv_handle;
|
||||
UINT8 subevent;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
UINT8 filter_policy;
|
||||
UINT8 own_addr_type;
|
||||
UINT8 peer_addr_type;
|
||||
@@ -1013,7 +1017,7 @@ UINT8 btsnd_hcic_ble_clear_adv_set(void);
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_params(UINT8 adv_handle,
|
||||
UINT16 interval_min,
|
||||
UINT16 interval_max,
|
||||
UINT8 propertics);
|
||||
UINT16 propertics);
|
||||
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_data(UINT8 adv_handle,
|
||||
UINT8 operation,
|
||||
@@ -1032,6 +1036,10 @@ UINT8 btsnd_hcic_ble_ext_scan_enable(UINT8 enable, UINT8 filter_dups,
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_create_ext_conn(tHCI_CreatExtConn *p_conn);
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
BOOLEAN btsnd_hcic_ble_create_ext_conn_v2(tHCI_CreatExtConn *p_conn);
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 filter_policy, UINT8 adv_sid,
|
||||
UINT8 adv_addr_type, BD_ADDR adv_addr,
|
||||
UINT16 sync_timeout, UINT8 sync_cte_type);
|
||||
@@ -1243,4 +1251,82 @@ UINT8 btsnd_hcic_ble_subrate_request(UINT16 conn_handle, UINT16 subrate_min, UIN
|
||||
UINT8 btsnd_hcic_ble_set_host_feature(uint16_t bit_num, uint8_t bit_val);
|
||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
typedef struct {
|
||||
uint8_t subevent;
|
||||
uint8_t response_slot_start;
|
||||
uint8_t response_slot_count;
|
||||
uint8_t subevent_data_len;
|
||||
uint8_t data[251];
|
||||
} ble_subevent_params;
|
||||
|
||||
#define HCIC_PARAM_SIZE_SET_PA_SUBEVT_DATA_PARAMS_LEN 2
|
||||
#define HCIC_PARAM_SIZE_SET_PA_RESPONSE_DATA_PARAMS_LEN 8
|
||||
#define HCIC_PARAM_SIZE_SET_PA_SYNC_SUBEVT_PARAMS_LEN 5
|
||||
|
||||
#define HCIC_PARAM_SIZE_SET_PERIODIC_ADV_PARAMS_V2 12
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_params_v2(UINT8 adv_handle, UINT16 interval_min, UINT16 interval_max,
|
||||
UINT16 propertics, UINT8 num_subevents, UINT8 subevent_interval,
|
||||
UINT8 rsp_slot_delay, UINT8 rsp_slot_spacing, UINT8 num_rsp_slots);
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_subevt_data(UINT8 adv_handle, UINT8 num_subevents_with_data, ble_subevent_params *subevent_params);
|
||||
UINT8 btsnd_hcic_ble_set_periodic_adv_rsp_data(UINT16 sync_handle, UINT16 req_evt, UINT8 req_subevt, UINT8 rsp_subevt, UINT8 rsp_slot, UINT8 rsp_data_len, UINT8 *rsp_data);
|
||||
UINT8 btsnd_hcic_ble_set_periodic_sync_subevt(UINT16 sync_handle, UINT16 periodic_adv_properties, UINT8 num_subevents_to_sync, UINT8 *subevt);
|
||||
#endif // #if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
UINT8 btsnd_hcic_ble_set_ext_adv_params_v2(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,
|
||||
UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type,
|
||||
UINT8 peer_addr_type, BD_ADDR peer_addr,
|
||||
UINT8 adv_filter_policy, INT8 adv_tx_power,
|
||||
UINT8 primary_adv_phy, UINT8 secondary_adv_max_skip,
|
||||
UINT8 secondary_adv_phy,
|
||||
UINT8 adv_sid, UINT8 scan_req_ntf_enable,
|
||||
UINT8 primary_adv_phy_options, UINT8 secondary_adv_phy_options);
|
||||
#endif // (BT_BLE_FEAT_ADV_CODING_SELECTION == TRUE)
|
||||
|
||||
#if (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
#define HCIC_PARAM_SIZE_READ_LOCAL_SUPP_CAPS_PARAMS_LEN 0
|
||||
#define HCIC_PARAM_SIZE_READ_REMOTE_SUPP_CAPS_PARAMS_LEN 2
|
||||
#define HCIC_PARAM_SIZE_WRITE_CACHE_REMOTE_SUPP_CAPS_PARAMS_LEN 30
|
||||
#define HCIC_PARAM_SIZE_SECURITY_ENABLE_PARAMS_LEN 2
|
||||
#define HCIC_PARAM_SIZE_SET_DEFAULT_SETTINGS_PARAMS_LEN 5
|
||||
#define HCIC_PARAM_SIZE_READ_REMOTE_FAE_TAB_PARAMS_LEN 2
|
||||
#define HCIC_PARAM_SIZE_WRITE_CACHED_REMOTE_FAE_TAB_PARAMS_LEN 74
|
||||
#define HCIC_PARAM_SIZE_CREATE_CONFIG_PARAMS_LEN 28
|
||||
#define HCIC_PARAM_SIZE_REMOVE_CONFIG_PARAMS_LEN 3
|
||||
#define HCIC_PARAM_SIZE_SET_CHANNEL_CLASS_PARAMS_LEN 10
|
||||
#define HCIC_PARAM_SIZE_SET_PROCEDURE_PARAMS_LEN 21
|
||||
#define HCIC_PARAM_SIZE_SET_PROCEDURE_ENABLE_PARAMS_LEN 4
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_read_local_supported_caps(void);
|
||||
UINT8 btsnd_hcic_ble_cs_read_remote_supported_capabilities(UINT16 conn_handle);
|
||||
UINT8 btsnd_hcic_ble_cs_write_cached_remote_supported_capabilities(UINT16 conn_handle, UINT8 num_config_supported, UINT16 max_consecutive_proc_supported,
|
||||
UINT8 num_ant_supported, UINT8 max_ant_paths_supported, UINT8 roles_supported,
|
||||
UINT8 modes_supported, UINT8 rtt_capability, UINT8 rtt_aa_only_n,
|
||||
UINT8 rtt_sounding_n, UINT8 rtt_random_payload_n, UINT16 NADM_sounding_capability,
|
||||
UINT16 NADM_random_capability, UINT8 cs_sync_phys_supported, UINT16 subfeatures_supported,
|
||||
UINT16 T_IP1_times_supported, UINT16 T_IP2_times_supported, UINT16 T_FCS_times_supported,
|
||||
UINT16 T_PM_times_supported, UINT8 T_SW_times_supported, UINT8 TX_SNR_capability);
|
||||
|
||||
UINT8 btsnd_hcic_ble_cs_security_enable(UINT16 conn_handle);
|
||||
UINT8 btsnd_hcic_ble_cs_set_default_settings(UINT16 conn_handle, UINT8 role_enable, UINT8 cs_sync_ant_selection, INT8 max_tx_power);
|
||||
UINT8 btsnd_hcic_ble_cs_read_remote_fae_table(UINT16 conn_handle);
|
||||
UINT8 btsnd_hcic_ble_cs_write_cached_remote_fae_table(UINT16 conn_handle, UINT8 *remote_fae_table);
|
||||
UINT8 btsnd_hcic_ble_cs_create_config(UINT16 conn_handle, UINT8 config_id, UINT8 create_context,
|
||||
UINT8 main_mode_type, UINT8 sub_mode_type, UINT8 min_main_mode_steps,
|
||||
UINT8 max_main_mode_steps, UINT8 main_mode_repetition, UINT8 mode_0_steps,
|
||||
UINT8 role, UINT8 rtt_type, UINT8 cs_sync_phy, UINT8 *channel_map,
|
||||
UINT8 channel_map_repetition, UINT8 channel_selection_type, UINT8 ch3c_shape,
|
||||
UINT8 ch3c_jump,UINT8 reserved);
|
||||
UINT8 btsnd_hcic_ble_cs_remove_config(UINT16 conn_handle, UINT8 config_id);
|
||||
UINT8 btsnd_hcic_ble_cs_set_channel_classification(UINT8 *channel_class);
|
||||
UINT8 btsnd_hcic_ble_cs_set_procedure_params(UINT16 conn_handle, UINT8 config_id, UINT16 max_procedure_len,
|
||||
UINT16 min_procedure_interval, UINT16 max_procedure_interval,
|
||||
UINT16 max_procedure_count, UINT32 min_subevent_len,
|
||||
UINT32 max_subevent_len, UINT8 tone_ant_config_selection,
|
||||
UINT8 phy, UINT8 tx_power_delta, UINT8 preferred_peer_antenna,
|
||||
UINT8 SNR_control_initiator, UINT8 SNR_control_reflector);
|
||||
UINT8 btsnd_hcic_ble_cs_procedure_enable(UINT16 conn_handle, UINT8 config_id, UINT8 enable);
|
||||
#endif // (BT_BLE_FEAT_CHANNEL_SOUNDING == TRUE)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -121,7 +121,7 @@ typedef UINT8 tL2CAP_CHNL_DATA_RATE;
|
||||
#define L2CAP_FCR_CHAN_OPT_ALL_MASK (L2CAP_FCR_CHAN_OPT_BASIC | L2CAP_FCR_CHAN_OPT_ERTM | L2CAP_FCR_CHAN_OPT_STREAM)
|
||||
|
||||
/* Validity check for PSM. PSM values must be odd. Also, all PSM values must
|
||||
** be assigned such that the least significant bit of the most sigificant
|
||||
** be assigned such that the least significant bit of the most significant
|
||||
** octet equals zero.
|
||||
*/
|
||||
#define L2C_INVALID_PSM(psm) (((psm) & 0x0101) != 0x0001)
|
||||
@@ -938,7 +938,7 @@ typedef struct {
|
||||
**
|
||||
** Parameters: tL2CAP_UCD_CB_INFO
|
||||
**
|
||||
** Return value: TRUE if successs
|
||||
** Return value: TRUE if success
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern BOOLEAN L2CA_UcdRegister ( UINT16 psm, tL2CAP_UCD_CB_INFO *p_cb_info );
|
||||
@@ -951,7 +951,7 @@ extern BOOLEAN L2CA_UcdRegister ( UINT16 psm, tL2CAP_UCD_CB_INFO *p_cb_info );
|
||||
**
|
||||
** Parameters: PSM
|
||||
**
|
||||
** Return value: TRUE if successs
|
||||
** Return value: TRUE if success
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern BOOLEAN L2CA_UcdDeregister ( UINT16 psm );
|
||||
@@ -968,7 +968,7 @@ extern BOOLEAN L2CA_UcdDeregister ( UINT16 psm );
|
||||
** L2CAP_UCD_INFO_TYPE_MTU
|
||||
**
|
||||
**
|
||||
** Return value: TRUE if successs
|
||||
** Return value: TRUE if success
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern BOOLEAN L2CA_UcdDiscover ( UINT16 psm, BD_ADDR rem_bda, UINT8 info_type );
|
||||
@@ -1001,7 +1001,7 @@ extern UINT16 L2CA_UcdDataWrite (UINT16 psm, BD_ADDR rem_bda, BT_HDR *p_buf, UIN
|
||||
** Parameters: BD Addr
|
||||
** Timeout in second
|
||||
**
|
||||
** Return value: TRUE if successs
|
||||
** Return value: TRUE if success
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern BOOLEAN L2CA_UcdSetIdleTimeout ( BD_ADDR rem_bda, UINT16 timeout );
|
||||
@@ -1089,7 +1089,8 @@ extern BOOLEAN L2CA_RegisterFixedChannel (UINT16 fixed_cid, tL2CAP_FIXED_CHNL_R
|
||||
** Return value: TRUE if connection started
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern BOOLEAN L2CA_ConnectFixedChnl (UINT16 fixed_cid, BD_ADDR bd_addr, tBLE_ADDR_TYPE bd_addr_type, BOOLEAN is_aux);
|
||||
extern BOOLEAN L2CA_ConnectFixedChnl (UINT16 fixed_cid, BD_ADDR bd_addr, tBLE_ADDR_TYPE bd_addr_type, BOOLEAN is_aux,
|
||||
BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
||||
@@ -379,6 +379,11 @@ typedef struct t_l2c_linkcb {
|
||||
BOOLEAN in_use; /* TRUE when in use, FALSE when not */
|
||||
tL2C_LINK_STATE link_state;
|
||||
BOOLEAN is_aux; /* This variable used for BLE 5.0 or higher version when do auxiliary connection */
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
BOOLEAN is_pawr_synced;
|
||||
UINT8 adv_handle;
|
||||
UINT8 subevent;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
TIMER_LIST_ENT timer_entry; /* Timer list entry for timeout evt */
|
||||
UINT16 handle; /* The handle used with LM */
|
||||
|
||||
|
||||
@@ -1649,7 +1649,8 @@ BOOLEAN L2CA_RegisterFixedChannel (UINT16 fixed_cid, tL2CAP_FIXED_CHNL_REG *p_f
|
||||
** Return value: TRUE if connection started
|
||||
**
|
||||
*******************************************************************************/
|
||||
BOOLEAN L2CA_ConnectFixedChnl (UINT16 fixed_cid, BD_ADDR rem_bda, tBLE_ADDR_TYPE bd_addr_type, BOOLEAN is_aux)
|
||||
BOOLEAN L2CA_ConnectFixedChnl (UINT16 fixed_cid, BD_ADDR rem_bda, tBLE_ADDR_TYPE bd_addr_type, BOOLEAN is_aux,
|
||||
BOOLEAN is_pawr_synced, UINT8 adv_handle, UINT8 subevent)
|
||||
{
|
||||
tL2C_LCB *p_lcb;
|
||||
tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR;
|
||||
@@ -1738,6 +1739,11 @@ BOOLEAN L2CA_ConnectFixedChnl (UINT16 fixed_cid, BD_ADDR rem_bda, tBLE_ADDR_TYPE
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
p_lcb->is_aux = is_aux;
|
||||
p_lcb->open_addr_type = bd_addr_type;
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
p_lcb->is_pawr_synced = is_pawr_synced;
|
||||
p_lcb->adv_handle = adv_handle;
|
||||
p_lcb->subevent = subevent;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
#endif
|
||||
if (!l2cu_create_conn(p_lcb, transport)) {
|
||||
L2CAP_TRACE_WARNING ("%s() - create_conn failed", __func__);
|
||||
|
||||
@@ -1012,6 +1012,10 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb)
|
||||
}
|
||||
|
||||
tHCI_CreatExtConn aux_conn = {0};
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
aux_conn.adv_handle = p_lcb->adv_handle;
|
||||
aux_conn.subevent = p_lcb->subevent;
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
aux_conn.filter_policy = FALSE;
|
||||
aux_conn.own_addr_type = own_addr_type;
|
||||
aux_conn.peer_addr_type = peer_addr_type;
|
||||
@@ -1033,9 +1037,19 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb)
|
||||
memcpy (l2cb.ble_connecting_bda, p_lcb->remote_bd_addr, BD_ADDR_LEN);
|
||||
btu_start_timer (&p_lcb->timer_entry, BTU_TTYPE_L2CAP_LINK, link_timeout);
|
||||
btm_ble_set_conn_st (BLE_DIR_CONN);
|
||||
if(!btsnd_hcic_ble_create_ext_conn(&aux_conn)) {
|
||||
l2cu_release_lcb (p_lcb);
|
||||
L2CAP_TRACE_ERROR("initiate Aux connection failed, no resources");
|
||||
#if (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
if (p_lcb->is_pawr_synced) {
|
||||
if(!btsnd_hcic_ble_create_ext_conn_v2(&aux_conn)) {
|
||||
l2cu_release_lcb (p_lcb);
|
||||
L2CAP_TRACE_ERROR("initiate pawr sync connection failed, no resources");
|
||||
}
|
||||
} else
|
||||
#endif // (BT_BLE_FEAT_PAWR_EN == TRUE)
|
||||
{
|
||||
if(!btsnd_hcic_ble_create_ext_conn(&aux_conn)) {
|
||||
l2cu_release_lcb (p_lcb);
|
||||
L2CAP_TRACE_ERROR("initiate Aux connection failed, no resources");
|
||||
}
|
||||
}
|
||||
#else
|
||||
L2CAP_TRACE_ERROR("BLE 5.0 not support!\n");
|
||||
|
||||
@@ -161,7 +161,7 @@ tSMP_STATUS SMP_Pair (BD_ADDR bd_addr)
|
||||
|
||||
memcpy (p_cb->pairing_bda, bd_addr, BD_ADDR_LEN);
|
||||
|
||||
if (!L2CA_ConnectFixedChnl (L2CAP_SMP_CID, bd_addr, BLE_ADDR_UNKNOWN_TYPE, FALSE)) {
|
||||
if (!L2CA_ConnectFixedChnl (L2CAP_SMP_CID, bd_addr, BLE_ADDR_UNKNOWN_TYPE, FALSE, FALSE, 0xFF, 0xFF)) {
|
||||
SMP_TRACE_ERROR("%s: L2C connect fixed channel failed.\n", __FUNCTION__);
|
||||
smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &status);
|
||||
return status;
|
||||
@@ -205,7 +205,7 @@ tSMP_STATUS SMP_BR_PairWith (BD_ADDR bd_addr)
|
||||
|
||||
memcpy (p_cb->pairing_bda, bd_addr, BD_ADDR_LEN);
|
||||
|
||||
if (!L2CA_ConnectFixedChnl (L2CAP_SMP_BR_CID, bd_addr, BLE_ADDR_UNKNOWN_TYPE, FALSE)) {
|
||||
if (!L2CA_ConnectFixedChnl (L2CAP_SMP_BR_CID, bd_addr, BLE_ADDR_UNKNOWN_TYPE, FALSE, FALSE, 0xFF, 0xFF)) {
|
||||
SMP_TRACE_ERROR("%s: L2C connect fixed channel failed.", __FUNCTION__);
|
||||
smp_br_state_machine_event(p_cb, SMP_BR_AUTH_CMPL_EVT, &status);
|
||||
return status;
|
||||
|
||||
Reference in New Issue
Block a user