mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
feat(bt/bluedroid): Support BLE iso in bluedroid host
(cherry picked from commit 7128087646
)
Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
@ -468,6 +468,13 @@ if(CONFIG_BT_ENABLED)
|
|||||||
list(APPEND srcs "esp_ble_mesh/core/bluedroid_host/adapter.c")
|
list(APPEND srcs "esp_ble_mesh/core/bluedroid_host/adapter.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_BT_BLE_FEAT_ISO_EN)
|
||||||
|
list(APPEND srcs "host/bluedroid/stack/btm/btm_ble_iso.c"
|
||||||
|
"host/bluedroid/btc/profile/std/iso/btc_iso_ble.c"
|
||||||
|
"host/bluedroid/api/esp_ble_iso_api.c"
|
||||||
|
"host/bluedroid/hci/ble_hci_iso.c")
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_BLE_MESH)
|
if(CONFIG_BLE_MESH)
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "btc_gattc.h"
|
#include "btc_gattc.h"
|
||||||
#include "btc_gatt_common.h"
|
#include "btc_gatt_common.h"
|
||||||
#include "btc_gap_ble.h"
|
#include "btc_gap_ble.h"
|
||||||
|
#include "btc_iso_ble.h"
|
||||||
#include "btc/btc_dm.h"
|
#include "btc/btc_dm.h"
|
||||||
#include "bta/bta_gatt_api.h"
|
#include "bta/bta_gatt_api.h"
|
||||||
#if CLASSIC_BT_INCLUDED
|
#if CLASSIC_BT_INCLUDED
|
||||||
@ -258,6 +259,9 @@ static const btc_func_t profile_tab[BTC_PID_NUM] = {
|
|||||||
[BTC_PID_BLE_MESH_BLE_COEX] = {btc_ble_mesh_ble_call_handler, btc_ble_mesh_ble_cb_handler },
|
[BTC_PID_BLE_MESH_BLE_COEX] = {btc_ble_mesh_ble_call_handler, btc_ble_mesh_ble_cb_handler },
|
||||||
#endif /* CONFIG_BLE_MESH_BLE_COEX_SUPPORT */
|
#endif /* CONFIG_BLE_MESH_BLE_COEX_SUPPORT */
|
||||||
#endif /* #if CONFIG_BLE_MESH */
|
#endif /* #if CONFIG_BLE_MESH */
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
[BTC_PID_ISO_BLE] = {btc_iso_ble_call_handler, btc_iso_ble_cb_handler },
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
@ -525,6 +529,9 @@ bt_status_t btc_init(void)
|
|||||||
|
|
||||||
#if (BLE_INCLUDED == TRUE)
|
#if (BLE_INCLUDED == TRUE)
|
||||||
btc_gap_callback_init();
|
btc_gap_callback_init();
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
btc_iso_callback_init();
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
btc_gap_ble_init();
|
btc_gap_ble_init();
|
||||||
#endif ///BLE_INCLUDED == TRUE
|
#endif ///BLE_INCLUDED == TRUE
|
||||||
|
|
||||||
|
@ -105,6 +105,9 @@ typedef enum {
|
|||||||
BTC_PID_MBT_SERVER,
|
BTC_PID_MBT_SERVER,
|
||||||
BTC_PID_BLE_MESH_BLE_COEX,
|
BTC_PID_BLE_MESH_BLE_COEX,
|
||||||
#endif /* CONFIG_BLE_MESH */
|
#endif /* CONFIG_BLE_MESH */
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
BTC_PID_ISO_BLE,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
BTC_PID_NUM,
|
BTC_PID_NUM,
|
||||||
} btc_pid_t; //btc profile id
|
} btc_pid_t; //btc profile id
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -124,6 +124,11 @@ static char IRAM_ATTR *bt_data_type_to_str(uint8_t data_type)
|
|||||||
// self-defining data
|
// self-defining data
|
||||||
tag = "S";
|
tag = "S";
|
||||||
break;
|
break;
|
||||||
|
case HCI_LOG_DATA_TYPE_ISO_DATA:
|
||||||
|
// 5.2 iso data
|
||||||
|
tag = "I";
|
||||||
|
break;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// unknown data type
|
// unknown data type
|
||||||
tag = "U";
|
tag = "U";
|
||||||
|
@ -21,6 +21,7 @@ extern "C" {
|
|||||||
#define HCI_LOG_DATA_TYPE_ADV (5)
|
#define HCI_LOG_DATA_TYPE_ADV (5)
|
||||||
#define HCI_LOG_DATA_TYPE_SELF_DEFINE (6)
|
#define HCI_LOG_DATA_TYPE_SELF_DEFINE (6)
|
||||||
#define HCI_LOG_DATA_TYPE_C2H_ACL (7)
|
#define HCI_LOG_DATA_TYPE_C2H_ACL (7)
|
||||||
|
#define HCI_LOG_DATA_TYPE_ISO_DATA (8)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -1305,6 +1305,83 @@ config BT_BLE_42_SCAN_EN
|
|||||||
help
|
help
|
||||||
This enables BLE v4.2 scan
|
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
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Enable BLE 5.2 iso
|
||||||
|
|
||||||
|
config BT_BLE_FEAT_ISO_60_EN
|
||||||
|
bool "Enable ISO v6.0 feature"
|
||||||
|
depends on BT_BLE_FEAT_ISO_EN
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Enable iso 6.0 feature
|
||||||
|
|
||||||
|
config BT_BLE_FEAT_ISO_BIG_BROCASTER
|
||||||
|
bool "Enable BLE iso BIG brocaster"
|
||||||
|
depends on BT_BLE_FEAT_ISO_EN
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable BLE 5.2 BIG brocaster
|
||||||
|
|
||||||
|
config BT_BLE_FEAT_ISO_BIG_SYNCER
|
||||||
|
bool "Enable BLE iso BIG syncer"
|
||||||
|
depends on BT_BLE_FEAT_ISO_EN
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable BLE 5.2 BIG syncer
|
||||||
|
|
||||||
|
config BT_BLE_ISO_BIS_MAX_COUNT
|
||||||
|
int "Maximum bis count"
|
||||||
|
depends on BT_BLE_FEAT_ISO_EN && (BT_BLE_FEAT_ISO_BIG_BROCASTER || BT_BLE_FEAT_ISO_BIG_SYNCER)
|
||||||
|
default 2
|
||||||
|
range 1 31
|
||||||
|
help
|
||||||
|
Enable BLE 5.2 CIG peripheral
|
||||||
|
|
||||||
|
config BT_BLE_FEAT_ISO_CIG_CENTRAL
|
||||||
|
bool "Enable BLE iso CIG central"
|
||||||
|
depends on BT_BLE_FEAT_ISO_EN
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable BLE 5.2 CIG central
|
||||||
|
|
||||||
|
config BT_BLE_FEAT_ISO_CIG_PERIPHERAL
|
||||||
|
bool "Enable BLE iso CIG peripheral"
|
||||||
|
depends on BT_BLE_FEAT_ISO_EN
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable BLE 5.2 CIG peripheral
|
||||||
|
|
||||||
|
config BT_BLE_ISO_CIS_MAX_COUNT
|
||||||
|
int "Maximum cis count"
|
||||||
|
depends on BT_BLE_FEAT_ISO_EN && (BT_BLE_FEAT_ISO_CIG_CENTRAL || BT_BLE_FEAT_ISO_CIG_PERIPHERAL)
|
||||||
|
default 2
|
||||||
|
range 1 31
|
||||||
|
help
|
||||||
|
Enable BLE 5.2 CIG peripheral
|
||||||
|
|
||||||
|
choice BT_BLE_ISO_FLOW_CONTROL
|
||||||
|
prompt "Select ISO flow control type"
|
||||||
|
depends on BT_BLE_FEAT_ISO_EN
|
||||||
|
default BT_BLE_ISO_NON_STD_FLOW_CTRL
|
||||||
|
help
|
||||||
|
Select ISO flow control type
|
||||||
|
|
||||||
|
config BT_BLE_ISO_STD_FLOW_CTRL
|
||||||
|
bool "ISO standard flow control"
|
||||||
|
help
|
||||||
|
Enable ISO standard flow control
|
||||||
|
|
||||||
|
config BT_BLE_ISO_NON_STD_FLOW_CTRL
|
||||||
|
bool "ISO non-standard flow control"
|
||||||
|
help
|
||||||
|
Enable ISO non-standard flow control
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
config BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
config BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||||
bool "Enable BLE high duty advertising interval feature"
|
bool "Enable BLE high duty advertising interval feature"
|
||||||
depends on BT_BLE_ENABLED
|
depends on BT_BLE_ENABLED
|
||||||
|
454
components/bt/host/bluedroid/api/esp_ble_iso_api.c
Normal file
454
components/bt/host/bluedroid/api/esp_ble_iso_api.c
Normal file
@ -0,0 +1,454 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "esp_bt_device.h"
|
||||||
|
#include "esp_bt_main.h"
|
||||||
|
#include "esp_ble_iso_api.h"
|
||||||
|
#include "btc_iso_ble.h"
|
||||||
|
#include "btc/btc_manage.h"
|
||||||
|
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_register_callback(esp_ble_iso_cb_t callback)
|
||||||
|
{
|
||||||
|
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||||
|
|
||||||
|
return (btc_profile_cb_set(BTC_PID_ISO_BLE, callback) == 0 ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_ble_iso_cb_t esp_ble_iso_get_callback(void)
|
||||||
|
{
|
||||||
|
return (esp_ble_iso_cb_t) btc_profile_cb_get(BTC_PID_ISO_BLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
esp_err_t esp_ble_iso_create_big(esp_ble_iso_big_creat_params_t *big_creat_param)
|
||||||
|
{
|
||||||
|
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||||
|
|
||||||
|
if (big_creat_param == NULL) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_BIG_CREATE;
|
||||||
|
|
||||||
|
memcpy(&arg.iso_big_creat_params, big_creat_param, sizeof(esp_ble_iso_big_creat_params_t));
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL)
|
||||||
|
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_create_big_test(esp_ble_iso_big_creat_test_params_t *big_creat_test_param)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||||
|
|
||||||
|
if (big_creat_test_param == NULL) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_BIG_CREATE_TEST;
|
||||||
|
|
||||||
|
memcpy(&arg.iso_big_creat_test_params, big_creat_test_param, sizeof(esp_ble_iso_big_creat_test_params_t));
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL)
|
||||||
|
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_terminate_big(uint8_t big_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_BIG_TERMINATE;
|
||||||
|
|
||||||
|
arg.iso_big_terminate_params.big_handle = big_handle;
|
||||||
|
arg.iso_big_terminate_params.reason = reason;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL)
|
||||||
|
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
esp_err_t esp_ble_iso_big_create_sync(esp_ble_iso_big_sync_creat_params_t *big_sync_create_param)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||||
|
|
||||||
|
if (big_sync_create_param == NULL) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (big_sync_create_param->num_bis > BLE_ISO_BIS_MAX_COUNT) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_BIG_SYNC_CREATE;
|
||||||
|
|
||||||
|
arg.iso_big_sync_creat_params.big_handle = big_sync_create_param->big_handle;
|
||||||
|
arg.iso_big_sync_creat_params.sync_handle = big_sync_create_param->sync_handle;
|
||||||
|
arg.iso_big_sync_creat_params.encryption = big_sync_create_param->encryption;
|
||||||
|
memcpy(&arg.iso_big_sync_creat_params.bc_code[0], &big_sync_create_param->bc_code[0], 16);
|
||||||
|
arg.iso_big_sync_creat_params.mse = big_sync_create_param->mse;
|
||||||
|
arg.iso_big_sync_creat_params.big_sync_timeout = big_sync_create_param->big_sync_timeout;
|
||||||
|
arg.iso_big_sync_creat_params.num_bis = big_sync_create_param->num_bis;
|
||||||
|
for (uint8_t i = 0; i < big_sync_create_param->num_bis; i++)
|
||||||
|
{
|
||||||
|
arg.iso_big_sync_creat_params.bis[i] = big_sync_create_param->bis[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
// memcpy(&arg.iso_big_sync_creat_params, big_sync_create_param, sizeof(esp_ble_iso_big_sync_creat_params_t));
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL)
|
||||||
|
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_big_terminate_sync(uint8_t big_handle)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_BIG_SYNC_TERMINATE;
|
||||||
|
|
||||||
|
arg.iso_big_sync_terminate_params.big_handle = big_handle;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL)
|
||||||
|
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_set_iso_data_path(esp_ble_iso_set_data_path_params_t *data_path_params)
|
||||||
|
{
|
||||||
|
btc_msg_t msg = {0};
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||||
|
return ESP_ERR_INVALID_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data_path_params == NULL) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data_path_params->codec_cfg_len && (!data_path_params->codec_cfg)) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data_path_params->codec_cfg && (!data_path_params->codec_cfg_len)) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data_path_params->data_path_dir > ESP_BLE_ISO_DATA_PATH_DIR_OUTPUT) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_SET_DATA_PATH;
|
||||||
|
|
||||||
|
arg.iso_set_data_path_params.conn_handle = data_path_params->iso_handle;
|
||||||
|
arg.iso_set_data_path_params.data_path_dir = data_path_params->data_path_dir;
|
||||||
|
arg.iso_set_data_path_params.data_path_id = data_path_params->data_path_id;
|
||||||
|
arg.iso_set_data_path_params.coding_fmt = data_path_params->coding_fmt;
|
||||||
|
arg.iso_set_data_path_params.company_id = data_path_params->company_id;
|
||||||
|
arg.iso_set_data_path_params.vs_codec_id = data_path_params->vs_codec_id;
|
||||||
|
arg.iso_set_data_path_params.controller_delay = data_path_params->controller_delay;
|
||||||
|
arg.iso_set_data_path_params.codec_cfg_len = data_path_params->codec_cfg_len;
|
||||||
|
arg.iso_set_data_path_params.codec_cfg = data_path_params->codec_cfg;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), btc_iso_ble_arg_deep_copy, btc_iso_ble_arg_deep_free)
|
||||||
|
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_remove_iso_data_path(esp_ble_iso_remove_data_path_params_t *data_path_params)
|
||||||
|
{
|
||||||
|
btc_msg_t msg = {0};
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||||
|
return ESP_ERR_INVALID_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data_path_params == NULL) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data_path_params->data_path_dir == 0 || data_path_params->data_path_dir > ESP_BLE_ISO_DATA_PATH_DIR_ALL_BIT_MASK) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_REMOVE_DATA_PATH;
|
||||||
|
|
||||||
|
arg.iso_remove_data_path_params.conn_handle = data_path_params->iso_handle;
|
||||||
|
arg.iso_remove_data_path_params.data_path_dir = data_path_params->data_path_dir;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL)
|
||||||
|
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_set_host_feature(uint16_t bit_num, uint8_t bit_val)
|
||||||
|
{
|
||||||
|
btc_msg_t msg = {0};
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||||
|
return ESP_ERR_INVALID_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
if (bit_num > 0x07BF) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (bit_num > 0xFF) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_SET_HOST_FEATURE;
|
||||||
|
|
||||||
|
arg.iso_set_host_feature_params.bit_num = bit_num;
|
||||||
|
arg.iso_set_host_feature_params.bit_val = bit_val;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL)
|
||||||
|
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_read_iso_tx_sync(uint16_t iso_handle)
|
||||||
|
{
|
||||||
|
btc_msg_t msg = {0};
|
||||||
|
btc_ble_iso_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_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_READ_ISO_TX_SYNC;
|
||||||
|
|
||||||
|
arg.iso_read_tx_sync_params.iso_handle = iso_handle;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_read_link_quality(uint16_t iso_handle)
|
||||||
|
{
|
||||||
|
btc_msg_t msg = {0};
|
||||||
|
btc_ble_iso_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_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_READ_ISO_LINK_QUALITY;
|
||||||
|
|
||||||
|
arg.iso_read_link_quality_params.iso_handle = iso_handle;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
esp_err_t esp_ble_iso_set_cig_parameters(struct esp_ble_iso_set_cig_params *cig_params)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||||
|
return ESP_ERR_INVALID_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((cig_params == NULL) || (cig_params->cis_cnt > BLE_ISO_CIS_MAX_COUNT)) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_SET_CIG_PARAMS;
|
||||||
|
|
||||||
|
arg.set_cig_params.cig_id = cig_params->cig_id;
|
||||||
|
arg.set_cig_params.sdu_int_c_to_p = cig_params->sdu_int_c_to_p;
|
||||||
|
arg.set_cig_params.sdu_int_p_to_c = cig_params->sdu_int_p_to_c;
|
||||||
|
arg.set_cig_params.worse_case_SCA = cig_params->worse_case_SCA;
|
||||||
|
arg.set_cig_params.packing = cig_params->packing;
|
||||||
|
arg.set_cig_params.framing = cig_params->framing;
|
||||||
|
arg.set_cig_params.mtl_c_to_p = cig_params->mtl_c_to_p;
|
||||||
|
arg.set_cig_params.mtl_p_to_c = cig_params->mtl_p_to_c;
|
||||||
|
arg.set_cig_params.cis_cnt = cig_params->cis_cnt;
|
||||||
|
memcpy(&arg.set_cig_params.cis_params[0], &cig_params->cis_params[0], sizeof(struct ble_iso_cis_params) * cig_params->cis_cnt);
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_set_cig_parameters_test(struct esp_ble_iso_set_cig_params_test *cig_params_test)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||||
|
return ESP_ERR_INVALID_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((cig_params_test == NULL) || (cig_params_test->cis_cnt > BLE_ISO_CIS_MAX_COUNT)) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_SET_CIG_PARAMS_TEST;
|
||||||
|
|
||||||
|
arg.set_cig_params_test.cig_id = cig_params_test->cig_id;
|
||||||
|
arg.set_cig_params_test.sdu_int_c_to_p = cig_params_test->sdu_int_c_to_p;
|
||||||
|
arg.set_cig_params_test.sdu_int_p_to_c = cig_params_test->sdu_int_p_to_c;
|
||||||
|
arg.set_cig_params_test.ft_c_to_p = cig_params_test->ft_c_to_p;
|
||||||
|
arg.set_cig_params_test.ft_p_to_c = cig_params_test->ft_p_to_c;
|
||||||
|
arg.set_cig_params_test.iso_interval = cig_params_test->iso_interval;
|
||||||
|
arg.set_cig_params_test.worse_case_SCA = cig_params_test->worse_case_SCA;
|
||||||
|
arg.set_cig_params_test.packing = cig_params_test->packing;
|
||||||
|
arg.set_cig_params_test.framing = cig_params_test->framing;
|
||||||
|
arg.set_cig_params_test.cis_cnt = cig_params_test->cis_cnt;
|
||||||
|
memcpy(&arg.set_cig_params_test.cis_params_test[0], &cig_params_test->cis_params_test[0], sizeof(struct ble_iso_cis_params_test) * cig_params_test->cis_cnt);
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_create_cis(struct esp_ble_iso_create_cis_params *creat_cis_params)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_args_t arg;
|
||||||
|
|
||||||
|
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
|
||||||
|
return ESP_ERR_INVALID_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((creat_cis_params == NULL) || (creat_cis_params->cis_count > BLE_ISO_CIS_MAX_COUNT)) {
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_CREATE_CIS;
|
||||||
|
|
||||||
|
arg.creat_cis_params.cis_count = creat_cis_params->cis_count;
|
||||||
|
for (uint8_t i = 0; i < creat_cis_params->cis_count; i++)
|
||||||
|
{
|
||||||
|
arg.creat_cis_params.cis_hdls[i].cis_hdl = creat_cis_params->cis_hdl_info[i].cis_hdl;
|
||||||
|
arg.creat_cis_params.cis_hdls[i].acl_hdl = creat_cis_params->cis_hdl_info[i].acl_hdl;
|
||||||
|
}
|
||||||
|
|
||||||
|
//memcpy(&arg.creat_cis_params.cis_hdl_info[0], &creat_cis_params->cis_hdl_info[0], creat_cis_params->cis_count * 4);
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_remove_cig(uint8_t cig_id)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_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_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_REMOVE_CIG;
|
||||||
|
|
||||||
|
arg.remove_cig_params.cig_id = cig_id;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
esp_err_t esp_ble_iso_accept_cis_request(uint16_t cis_handle)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_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_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_ACCEPT_CIS_REQ;
|
||||||
|
|
||||||
|
arg.accept_cis_req_params.cis_handle = cis_handle;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
esp_err_t esp_ble_iso_reject_cis_request(uint16_t cis_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_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_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_REJECT_CIS_REQ;
|
||||||
|
|
||||||
|
arg.reject_cis_req_params.cis_handle = cis_handle;
|
||||||
|
arg.reject_cis_req_params.reason = reason;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
esp_err_t esp_ble_iso_disconnect_cis(uint16_t cis_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
btc_msg_t msg;
|
||||||
|
btc_ble_iso_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_ISO_BLE;
|
||||||
|
msg.act = BTC_ISO_ACT_DISCON_CIS;
|
||||||
|
|
||||||
|
arg.discon_cis_params.cis_handle = cis_handle;
|
||||||
|
arg.discon_cis_params.reason = reason;
|
||||||
|
|
||||||
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_iso_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
680
components/bt/host/bluedroid/api/include/api/esp_ble_iso_api.h
Normal file
680
components/bt/host/bluedroid/api/include/api/esp_ble_iso_api.h
Normal file
@ -0,0 +1,680 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ESP_BLE_ISO_API_H__
|
||||||
|
#define __ESP_BLE_ISO_API_H__
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#include "esp_err.h"
|
||||||
|
#include "esp_bt_defs.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/// ISO BLE callback event type
|
||||||
|
typedef enum {
|
||||||
|
ESP_BLE_ISO_BIG_CREATE_CMPL_EVT = 0, /*!< When BIG create complete, the event comes */
|
||||||
|
ESP_BLE_ISO_BIG_TERMINATE_CMPL_EVT, /*!< When BIG terminate complete, the event comes */
|
||||||
|
ESP_BLE_ISO_BIG_SYNC_ESTABLISHED_EVT, /*!< When BIG sync established, the event comes */
|
||||||
|
ESP_BLE_ISO_BIG_SYNC_LOST_EVT, /*!< When BIG sync lost, the event comes */
|
||||||
|
ESP_BLE_ISO_BIG_SYNC_TERMINATE_CMPL_EVT, /*!< When BIG sync terminate complete, the event comes */
|
||||||
|
ESP_BLE_ISO_BIGINFO_ADV_REPORT_EVT, /*!< When receiving an Advertising PDU that contained a BIGInfo field, the event comes */
|
||||||
|
ESP_BLE_ISO_ISO_DATA_PATH_UPDATE_EVT, /*!< When ISO data path update complete, the event comes */
|
||||||
|
ESP_BLE_ISO_SET_HOST_FEATURE_CMPL_EVT, /*!< When host feature set complete, the event comes */
|
||||||
|
ESP_BLE_ISO_READ_ISO_TX_SYNC_CMPL_EVT, /*!< When reading tx sync complete, the event comes */
|
||||||
|
ESP_BLE_ISO_READ_LINK_QUALITY_CMPL_EVT, /*!< When reading link quality complete, the event comes */
|
||||||
|
ESP_BLE_ISO_SET_CIG_PARAMS_CMPL_EVT, /*!< When CIG parameters set complete, the event comes */
|
||||||
|
ESP_BLE_ISO_CREATE_CIS_CMPL_EVT, /*!< When CIS create complete, the event comes */
|
||||||
|
ESP_BLE_ISO_REMOVE_CIG_CMPL_EVT, /*!< When CIG remove complete, the event comes */
|
||||||
|
ESP_BLE_ISO_CIS_REQUEST_EVT, /*!< When Receiving CIS request event, the event comes */
|
||||||
|
ESP_BLE_ISO_ACCEPT_CIS_REQ_CMPL_EVT, /*!< When CIS request event accept complete, the event comes */
|
||||||
|
ESP_BLE_ISO_REJECT_CIS_REQ_CMPL_EVT, /*!< When CIS request event reject complete, the event comes */
|
||||||
|
ESP_BLE_ISO_CIS_ESTABLISHED_EVT, /*!< When CIS is established, the event comes */
|
||||||
|
ESP_BLE_ISO_CIS_DISCONNECTED_EVT, /*!< When CIS is disconnected, the event comes */
|
||||||
|
ESP_BLE_ISO_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
|
||||||
|
} esp_ble_iso_cb_event_t;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ESP_BLE_ISO_DATA_PATH_UNKNOWN = 0,
|
||||||
|
ESP_BLE_ISO_DATA_PATH_SETUP = 1,
|
||||||
|
ESP_BLE_ISO_DATA_PATH_REMOVE = 2,
|
||||||
|
ESP_BLE_ISO_DATA_PATH_MAX,
|
||||||
|
} ESP_BLE_ISO_DATA_PATH_UPDATE_TYPE;
|
||||||
|
|
||||||
|
#define ESP_BLE_ISO_DATA_PATH_DIR_INPUT (0x00)
|
||||||
|
#define ESP_BLE_ISO_DATA_PATH_DIR_OUTPUT (0x01)
|
||||||
|
|
||||||
|
#define ESP_BLE_ISO_DATA_PATH_DIR_INPUT_BIT_MASK (1 << 0)
|
||||||
|
#define ESP_BLE_ISO_DATA_PATH_DIR_OUTPUT_BIT_MASK (1 << 1)
|
||||||
|
#define ESP_BLE_ISO_DATA_PATH_DIR_ALL_BIT_MASK (ESP_BLE_ISO_DATA_PATH_DIR_INPUT_BIT_MASK | ESP_BLE_ISO_DATA_PATH_DIR_OUTPUT_BIT_MASK)
|
||||||
|
|
||||||
|
#define ESP_BLE_MAX_BIS_NUM (31)
|
||||||
|
#define ESP_BLE_MAX_CIS_NUM (31)
|
||||||
|
|
||||||
|
#define BLE_ISO_SDU_INT_MIN (0x0000FF)
|
||||||
|
#define BLE_ISO_SDU_INT_MAX (0x0FFFFF)
|
||||||
|
|
||||||
|
#define BLE_ISO_WORST_CASE_SCA_LEVEL_500_PPM (0x00)
|
||||||
|
#define BLE_ISO_WORST_CASE_SCA_LEVEL_250_PPM (0x01)
|
||||||
|
#define BLE_ISO_WORST_CASE_SCA_LEVEL_150_PPM (0x02)
|
||||||
|
#define BLE_ISO_WORST_CASE_SCA_LEVEL_100_PPM (0x03)
|
||||||
|
#define BLE_ISO_WORST_CASE_SCA_LEVEL_75_PPM (0x04)
|
||||||
|
#define BLE_ISO_WORST_CASE_SCA_LEVEL_50_PPM (0x05)
|
||||||
|
#define BLE_ISO_WORST_CASE_SCA_LEVEL_30_PPM (0x06)
|
||||||
|
#define BLE_ISO_WORST_CASE_SCA_LEVEL_20_PPM (0x07)
|
||||||
|
|
||||||
|
#define BLE_ISO_PACKING_SEQUENTIAL (0x00)
|
||||||
|
#define BLE_ISO_PACKING_INTERLEAVED (0x00)
|
||||||
|
|
||||||
|
#define BLE_ISO_FRAMING_UNFRAMED_PDU (0x00)
|
||||||
|
#define BLE_ISO_FRAMING_FRAMED_PDU_SEGMENTABLE_MODE (0x01)
|
||||||
|
#define BLE_ISO_FRAMING_FRAMED_PDU_UNSEGMENTABLE_MODE (0x02)
|
||||||
|
|
||||||
|
#define BLE_ISO_MAX_TRANSPORT_LATENCY_MIN (0x0005)
|
||||||
|
#define BLE_ISO_MAX_TRANSPORT_LATENCY_MAX (0x0FA0)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
uint8_t big_handle; /*!< Used to identify the BIG, value 0x00 to 0xEF */
|
||||||
|
uint8_t adv_handle; /*!< Used to identify the periodic advertising train, value 0x00 to 0xEF */
|
||||||
|
uint8_t num_bis; /*!< Total number of BISes in the BIG, value 0x01 to 0x1F */
|
||||||
|
uint32_t sdu_interval; /*!< The interval, in microseconds, of periodic SDUs, value 0x0000FF to 0x0FFFFF*/
|
||||||
|
uint16_t max_sdu; /*!< Maximum size of an SDU, in octets, value 0x0001 to 0x0FFF */
|
||||||
|
uint16_t max_transport_latency; /*!< Maximum transport latency, in milliseconds, value 0x0005 to 0x0FA0 */
|
||||||
|
uint8_t rtn; /*!< The number of times that every BIS Data PDU should be retransmitted, value 0x00 to 0x1E */
|
||||||
|
uint8_t phy; /*!< The transmitter PHY of packets, value bit[0, 2] */
|
||||||
|
uint8_t packing; /*!< The preferred method of arranging subevents of multiple BISes, value 0x00 to 0x01 */
|
||||||
|
uint8_t framing; /*!< The format of the BIS Data PDUs and the mode of framed PDUs that the Controller shall use on the specified BIG, value 0x00 to 0x02 */
|
||||||
|
uint8_t encryption; /*!< The encryption mode of the BISes in the BIG, value 0x00 to 0x01 */
|
||||||
|
uint8_t broadcast_code[16]; /*!< The code used to derive the session key that is used to encrypt and decrypt BIS payloads */
|
||||||
|
} esp_ble_iso_big_creat_params_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint8_t big_handle; /*!< Used to identify the BIG, value 0x00 to 0xEF */
|
||||||
|
uint8_t adv_handle; /*!< Used to identify the periodic advertising train, value 0x00 to 0xEF */
|
||||||
|
uint8_t num_bis; /*!< Total number of BISes in the BIG, value 0x01 to 0x1F */
|
||||||
|
uint32_t sdu_interval; /*!< The interval, in microseconds, of periodic SDUs, value 0x0000FF to 0x0FFFFF*/
|
||||||
|
uint16_t iso_interval; /*!< the time between two consecutive BIG anchor points, Range: 0x0004 to 0x0C80, Time = N × 1.25 ms */
|
||||||
|
uint8_t nse; /*!< The total number of subevents in each interval of each BIS in the BIG, value 0x01 to 0x1F */
|
||||||
|
uint16_t max_sdu; /*!< Maximum size, in octets, of an SDU */
|
||||||
|
uint16_t max_pdu; /*!< Maximum size, in octets, of payload, value 0x0001 to 0x00FB */
|
||||||
|
uint8_t phy; /*!< The transmitter PHY of packets */
|
||||||
|
uint8_t packing; /*!< The preferred method of arranging subevents of multiple BISes, value 0x00 to 0x01 */
|
||||||
|
uint8_t framing; /*!< The format of the BIS Data PDUs and the mode of framed PDUs that the Controller shall use on the specified BIG, value 0x00 to 0x02 */
|
||||||
|
uint8_t bn; /*!< The number of new payloads in each interval for each BIS, value 0x01 to 0x07 */
|
||||||
|
uint8_t irc; /*!< The number of times the scheduled payloads are transmitted in a given event, value 0x01 to 0x0F */
|
||||||
|
uint8_t pto; /*!< Offset used for pre-transmissions, value 0x00 to 0x0F */
|
||||||
|
uint8_t encryption; /*!< The encryption mode of the BISes in the BIG, value 0x00 to 0x01 */
|
||||||
|
uint8_t broadcast_code[16]; /*!< The code used to derive the session key that is used to encrypt and decrypt BIS payloads */
|
||||||
|
} esp_ble_iso_big_creat_test_params_t;
|
||||||
|
|
||||||
|
#endif //#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
uint8_t big_handle; /*!< Used to identify the BIG, value 0x00 to 0xEF */
|
||||||
|
uint16_t sync_handle; /*!< Identifier of the periodic advertising train, value 0x0000 to 0x0EFF*/
|
||||||
|
uint8_t encryption; /*!< Broadcast_Code is valid or invalid, value 0x00 to 0x01 */
|
||||||
|
uint8_t bc_code[16]; /*!< 128-bit code used for deriving the session key for decrypting payloads of BISes in the BIG */
|
||||||
|
uint8_t mse; /*!< Maximum number of subevents that should be used to receive data payloads in each BIS event, value 0x00 to 0x1F */
|
||||||
|
uint16_t big_sync_timeout; /*!< Synchronization timeout for the BIG, Range: 0x000A to 0x4000, Time = N × 10 ms, Time Range: 100 ms to 163.84 s*/
|
||||||
|
uint8_t num_bis; /*!< Total number of BISes to synchronize, value 0x01 to 0x1F */
|
||||||
|
uint8_t bis[ESP_BLE_MAX_BIS_NUM]; /*!< Index of a BIS, value 0x01 to 0x1F */
|
||||||
|
} esp_ble_iso_big_sync_creat_params_t;
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16_t iso_handle; /*!< Connection handle of the CIS or BIS*/
|
||||||
|
uint8_t data_path_dir; /*!< The direction for which the data path is being configured, value 0x00 to 0x01 */
|
||||||
|
uint8_t data_path_id; /*!< The data transport path used, value 0x00 to 0xFE */
|
||||||
|
uint8_t coding_fmt; /*!< See Assigned Numbers for Coding Format */
|
||||||
|
uint16_t company_id; /*!< Company ID, see Assigned Numbers for Company Identifier. Shall be ignored if coding_fmt is not 0xFF*/
|
||||||
|
uint16_t vs_codec_id; /*!< Vendor-defined codec ID, Shall be ignored if coding_fmt is not 0xFF */
|
||||||
|
uint32_t controller_delay; /*!< Controller delay in microseconds, range: 0x000000 to 0x3D0900, time range: 0 s to 4 s*/
|
||||||
|
uint8_t codec_cfg_len; /*!< Length of codec configuration */
|
||||||
|
uint8_t *codec_cfg; /*!< Codec-specific configuration data */
|
||||||
|
} esp_ble_iso_set_data_path_params_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16_t iso_handle; /*!< Connection handle of the CIS or BIS. Range: 0x0000 to 0x0EFF */
|
||||||
|
uint8_t data_path_dir; /*!< which directions are to have the data path removed */
|
||||||
|
} __attribute__((packed)) esp_ble_iso_remove_data_path_params_t;
|
||||||
|
|
||||||
|
struct ble_iso_cis_params {
|
||||||
|
uint8_t cis_id; /*!< Used to identify a CIS */
|
||||||
|
uint16_t max_sdu_c_to_p; /*!< Maximum size, in octets, of the payload from the Central’s Host */
|
||||||
|
uint16_t max_sdu_p_to_c; /*!< Maximum size, in octets, of the payload from the Peripheral’s Host */
|
||||||
|
uint8_t phy_c_to_p; /*!< The transmitter PHY of packets from the Central */
|
||||||
|
uint8_t phy_p_to_c; /*!< The transmitter PHY of packets from the Peripheral */
|
||||||
|
uint8_t rtn_c_to_p; /*!< Number of times every CIS Data PDU should be retransmitted from the Central to the Peripheral */
|
||||||
|
uint8_t rtn_p_to_c; /*!< Number of times every CIS Data PDU should be retransmitted from the Peripheral to the Central */
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
struct ble_iso_cis_params_test {
|
||||||
|
uint8_t cis_id; /*!< Used to identify a CIS */
|
||||||
|
uint8_t nse; /*!< Maximum number of subevents in each CIS event */
|
||||||
|
uint16_t max_sdu_c_to_p; /*!< Maximum size, in octets, of the payload from the Central’s Host */
|
||||||
|
uint16_t max_sdu_p_to_c; /*!< Maximum size, in octets, of the payload from the Peripheral’s Host */
|
||||||
|
uint16_t max_pdu_c_to_p; /*!< Maximum size, in octets, of the payload from the Central’s Link Layer to the Peripheral’s Link Layer */
|
||||||
|
uint16_t max_pdu_p_to_c; /*!< Maximum size, in octets, of the payload from the Peripheral’s Link Layer to the Central’s Link Layer */
|
||||||
|
uint8_t phy_c_to_p; /*!< The transmitter PHY of packets from the Central */
|
||||||
|
uint8_t phy_p_to_c; /*!< The transmitter PHY of packets from the Peripheral */
|
||||||
|
uint8_t bn_c_to_p; /*!< The burst number for Central to Peripheral */
|
||||||
|
uint8_t bn_p_to_c; /*!< The burst number for Peripheral to Central */
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
struct esp_ble_iso_set_cig_params {
|
||||||
|
uint8_t cig_id; /*!< Used to identify the CIG */
|
||||||
|
uint32_t sdu_int_c_to_p; /*!< The interval, in microseconds, of periodic SDUs */
|
||||||
|
uint32_t sdu_int_p_to_c; /*!< The interval, in microseconds, of periodic SDUs */
|
||||||
|
uint8_t worse_case_SCA; /*!< The worst-case sleep clock accuracy of all the Peripherals that will participate in the CIG */
|
||||||
|
uint8_t packing; /*!< The preferred method of arranging subevents of multiple CISes */
|
||||||
|
uint8_t framing; /*!< The format of the CIS Data PDUs of the specified CISes' framing mode that the Host is requesting for the CIG */
|
||||||
|
uint16_t mtl_c_to_p; /*!< The maximum transport latency from the Central to the Peripheral, in milliseconds */
|
||||||
|
uint16_t mtl_p_to_c; /*!< The maximum transport latency from the Peripheral to the Central, in milliseconds */
|
||||||
|
uint8_t cis_cnt; /*!< Total number of CIS configurations in the CIG being added or modified */
|
||||||
|
struct ble_iso_cis_params cis_params[ESP_BLE_MAX_CIS_NUM]; /*!< */
|
||||||
|
}__attribute__((packed));
|
||||||
|
|
||||||
|
struct esp_ble_iso_set_cig_params_test {
|
||||||
|
uint8_t cig_id; /*!< Used to identify the CIG */
|
||||||
|
uint32_t sdu_int_c_to_p; /*!< The interval, in microseconds, of periodic SDUs */
|
||||||
|
uint32_t sdu_int_p_to_c; /*!< The interval, in microseconds, of periodic SDUs */
|
||||||
|
uint8_t ft_c_to_p; /*!< The flush timeout in multiples of ISO_Interval for each payload sent from the Central to Peripheral */
|
||||||
|
uint8_t ft_p_to_c; /*!< The flush timeout in multiples of ISO_Interval for each payload sent from the Peripheral to Central */
|
||||||
|
uint16_t iso_interval; /*!< Time between consecutive CIS anchor points. Range: 0x0004 to 0x0C80, Time = N × 1.25 ms, Time Range: 5 ms to 4 s */
|
||||||
|
uint8_t worse_case_SCA; /*!< The worst-case sleep clock accuracy of all the Peripherals that will participate in the CIG */
|
||||||
|
uint8_t packing; /*!< The preferred method of arranging subevents of multiple CISes */
|
||||||
|
uint8_t framing; /*!< The format of the CIS Data PDUs of the specified CISes' framing mode that the Host is requesting for the CIG */
|
||||||
|
uint8_t cis_cnt; /*!< Total number of CIS configurations in the CIG being added or modified */
|
||||||
|
struct ble_iso_cis_params_test cis_params_test[ESP_BLE_MAX_CIS_NUM];
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
struct esp_ble_gatt_cis_hdl {
|
||||||
|
uint16_t cis_hdl; /*!< Connection handle of a CIS */
|
||||||
|
uint16_t acl_hdl; /*!< Connection handle of an ACL connection */
|
||||||
|
}__attribute__((packed));
|
||||||
|
|
||||||
|
struct esp_ble_iso_create_cis_params {
|
||||||
|
uint8_t cis_count; /*!< Total number of CISes to be created */
|
||||||
|
struct esp_ble_gatt_cis_hdl cis_hdl_info[ESP_BLE_MAX_CIS_NUM];
|
||||||
|
}__attribute__((packed));
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief ISO callback parameters union
|
||||||
|
*/
|
||||||
|
typedef union {
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_BIG_CREATE_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_big_create_cmpl_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate the BIG was successfully created */
|
||||||
|
uint8_t big_handle; /*!< The identifier of the BIG */
|
||||||
|
uint32_t big_sync_delay; /*!< The maximum time, in microseconds, for transmission of PDUs of all BISes in a BIG event */
|
||||||
|
uint32_t transport_latency; /*!< The actual transport latency, in microseconds */
|
||||||
|
uint8_t phy; /*!< The PHY used to create the BIG */
|
||||||
|
uint8_t nse; /*!< The number of subevents in each BIS event in the BIG. The value shall be an integer multiple of BN */
|
||||||
|
uint8_t bn; /*!< The number of new payloads in each BIS event */
|
||||||
|
uint8_t pto; /*!< Offset used for pre-transmissions */
|
||||||
|
uint8_t irc; /*!< The number of times a payload is transmitted in a BIS event */
|
||||||
|
uint16_t max_pdu; /*!< Maximum size, in octets, of the payload */
|
||||||
|
uint16_t iso_interval; /*!< The time between two consecutive BIG anchor points, Time = N × 1.25 ms */
|
||||||
|
uint8_t num_bis; /*!< Total number of BISes in the BIG */
|
||||||
|
uint16_t bis_handle[ESP_BLE_MAX_BIS_NUM]; /*!< Connection handle of a BIS */
|
||||||
|
} create_big_cmpl; /*!< Event parameter of ESP_BLE_ISO_BIG_CREATE_CMPL_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_BIG_TERMINATE_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_big_term_cmpl_evt_param {
|
||||||
|
esp_bt_status_t status;/*!< Indicate BIG terminate complete */
|
||||||
|
uint8_t big_handle; /*!< The identifier of the BIG */
|
||||||
|
uint8_t reason; /*!< Reason for termination. See [Vol 1] Part F, Controller Error Codes for a list of error codes and descriptions */
|
||||||
|
} term_big_cmpl; /*!< Event parameter of ESP_BLE_ISO_BIG_TERMINATE_CMPL_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_BIG_SYNC_ESTABLISHED_EVT
|
||||||
|
*/
|
||||||
|
struct ble_big_sync_estab_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate synchronization to the BIG is completed */
|
||||||
|
uint8_t big_handle; /*!< The identifier of the BIG */
|
||||||
|
uint32_t transport_latency; /*!< The actual transport latency, in microseconds */
|
||||||
|
uint8_t nse; /*!< The number of subevents in each BIS event in the BIG */
|
||||||
|
uint8_t bn; /*!< The number of new payloads in each BIS event */
|
||||||
|
uint8_t pto; /*!< The offset in number of ISO_Intervals for pre transmissions of data packets */
|
||||||
|
uint8_t irc; /*!< The number of times a payload is transmitted in a BIS event */
|
||||||
|
uint16_t max_pdu; /*!< The maximum size of every BIS Data PDU for every BIS in the BIG */
|
||||||
|
uint16_t iso_interval; /*!< The time duration between two consecutive BIG anchor points */
|
||||||
|
uint8_t num_bis; /*!< The total number of BISes in the BIG */
|
||||||
|
uint16_t bis_handle[ESP_BLE_MAX_BIS_NUM]; /*!< Connection handle of a BIS in the BIG */
|
||||||
|
} big_sync_estab; /*!< Event parameter of ESP_BLE_ISO_BIG_SYNC_ESTABLISHED_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_BIG_SYNC_LOST_EVT
|
||||||
|
*/
|
||||||
|
struct ble_big_sync_lost_evt_param {
|
||||||
|
uint8_t big_handle; /*!< The identifier of a BIG */
|
||||||
|
uint8_t reason; /*!< The synchronization to BIG is terminated. See [Vol 1] Part F, Controller Error Codes for a list of error codes and descriptions */
|
||||||
|
} big_sync_lost; /*!< Event parameter of ESP_BLE_ISO_BIG_SYNC_LOST_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_BIG_SYNC_TERMINATE_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_big_sync_term_cmpl_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate BIG sync terminate success or not */
|
||||||
|
uint8_t big_handle; /*!< Identifier of the BIG */
|
||||||
|
} term_big_sync; /*!< Event parameter of ESP_BLE_ISO_BIG_SYNC_TERMINATE_CMPL_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_BIGINFO_ADV_REPORT_EVT
|
||||||
|
*/
|
||||||
|
struct ble_biginfo_report_evt_param {
|
||||||
|
uint16_t sync_handle; /*!< Identify the periodic advertising train containing the BIGInfo field */
|
||||||
|
uint8_t num_bis; /*!< The total number of BISes in the BIG */
|
||||||
|
uint8_t nse; /*!< The total number of subevents that are used to transmit BIS Data PDUs for each BIS in a BIG event */
|
||||||
|
uint16_t iso_interval; /*!< The time duration between two consecutive BIG anchor points */
|
||||||
|
uint8_t bn; /*!< The number of new payloads for each BIS */
|
||||||
|
uint8_t pto; /*!< The offset in number of ISO_Intervals for pre transmissions of data packets */
|
||||||
|
uint8_t irc; /*!< The number of times the scheduled data packet is transmitted */
|
||||||
|
uint16_t max_pdu; /*!< The maximum size of every BIS Data PDU for every BIS in the BIG */
|
||||||
|
uint32_t sdu_interval; /*!< The time interval of the periodic SDUs */
|
||||||
|
uint16_t max_sdu; /*!< The maximum size of an SDU */
|
||||||
|
uint8_t phy; /*!< The transmitter PHY of packets */
|
||||||
|
uint8_t framing; /*!< The format of the BIS Data PDUs and the mode of framed PDUs that the Controller used on the specified BIG */
|
||||||
|
uint8_t encryption; /*!< The encryption mode of the BISes in the BIG */
|
||||||
|
} biginfo_report; /*!< Event parameter of ESP_BLE_ISO_BIGINFO_ADV_REPORT_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_ISO_DATA_PATH_UPDATE_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_data_path_update_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate data path update success status */
|
||||||
|
ESP_BLE_ISO_DATA_PATH_UPDATE_TYPE op_type; /*!< data path update type, setup or remove */
|
||||||
|
uint16_t iso_hdl; /*!< Connection handle of the CIS or BIS */
|
||||||
|
} data_path; /*!< Event parameter of ESP_BLE_ISO_ISO_DATA_PATH_UPDATE_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_SET_HOST_FEATURE_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_set_host_feature_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate host feature update success status */
|
||||||
|
} host_feature; /*!< Event parameter of ESP_BLE_ISO_SET_HOST_FEATURE_CMPL_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_READ_ISO_TX_SYNC_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_read_tx_sync_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate tx sync read success status */
|
||||||
|
uint16_t iso_hdl; /*!< Connection handle of the CIS or BIS */
|
||||||
|
uint16_t pkt_seq_num; /*!< The packet sequence number of an SDU */
|
||||||
|
uint32_t tx_time_stamp; /*!< The CIG reference point or BIG anchor point of a transmitted SDU derived using the Controller's free running reference clock (in microseconds) */
|
||||||
|
uint32_t time_offset; /*!< The time offset, in microseconds, that is associated with a transmitted SDU */
|
||||||
|
} read_tx_sync; /*!< Event parameter of ESP_BLE_ISO_READ_ISO_TX_SYNC_CMPL_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_READ_LINK_QUALITY_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_read_link_quality_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate link quality read success status */
|
||||||
|
uint16_t iso_hdl; /*!< The identifier of the BIS or CIS */
|
||||||
|
uint32_t tx_unacked_pkts; /*!< for CIS, The Link Layer does not receive an acknowledgment for a CIS Data PDU that it transmitted at least once by its flush point*/
|
||||||
|
uint32_t tx_flushed_pkts; /*!< for CIS, The Link Layer does not transmit a specific payload by its flush point */
|
||||||
|
uint32_t tx_last_subevt_pkts; /*!< for CIS in Peripheral role, The Link Layer transmits a CIS Data PDU in the last subevent of a CIS event */
|
||||||
|
uint32_t retransmitted_pkts; /*!< for CIS, The Link Layer retransmits a CIS Data PDU */
|
||||||
|
uint32_t crc_error_pkts; /*!< for CIS and BIS, The Link Layer receives a packet with a CRC error */
|
||||||
|
uint32_t rx_unreceived_pkts; /*!< for CIS and BIS, The Link Layer does not receive a specific payload by its flush point (on a CIS) or the end of the event */
|
||||||
|
uint32_t duplicate_pkts; /*!< for CIS, The Link Layer receives a retransmission of a CIS Data PDU */
|
||||||
|
} read_link_quality; /*!< Event parameter of ESP_BLE_ISO_READ_LINK_QUALITY_CMPL_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_SET_CIG_PARAMS_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_set_cig_params_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate CIG parameters update success status */
|
||||||
|
uint8_t cig_id; /*!< Used to identify a CIG */
|
||||||
|
uint8_t cis_count; /*!< Total number of CIS configurations added or modified by this command */
|
||||||
|
uint16_t cis_hdl[ESP_BLE_MAX_CIS_NUM]; /*!< Connection handle of the CIS in the CIG */
|
||||||
|
} set_cig_params; /*!< Event parameter of ESP_BLE_ISO_SET_CIG_PARAMS_CMPL_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_CREATE_CIS_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_create_cis_params_evt_param {
|
||||||
|
esp_bt_status_t status; /*!< Indicate creating cis success status */
|
||||||
|
} create_cis; /*!< Event parameter of ESP_BLE_ISO_CREATE_CIS_CMPL_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_CIS_ESTABLISHED_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_cis_estab_evt_params{
|
||||||
|
esp_bt_status_t status; /*!< Indicate the CIS is successfully established or not */
|
||||||
|
uint16_t cis_handle; /*!< Connection handle of the CIS */
|
||||||
|
uint32_t cig_sync_delay; /*!< The maximum time, in microseconds, for transmission of PDUs of all CISes in a CIG event */
|
||||||
|
uint32_t cis_sync_delay; /*!< he maximum time, in microseconds, for transmission of PDUs of the speci-fied CIS in a CIG event */
|
||||||
|
uint32_t trans_lat_c_to_p; /*!< The actual transport latency, in microseconds, from Central to Peripheral */
|
||||||
|
uint32_t trans_lat_p_to_c; /*!< The actual transport latency, in microseconds, from Peripheral to Central */
|
||||||
|
uint8_t phy_c_to_p; /*!< The transmitter PHY of packets from the Central */
|
||||||
|
uint8_t phy_p_to_c; /*!< The transmitter PHY of packets from the Peripheral */
|
||||||
|
uint8_t nse; /*!< Maximum number of subevents in each CIS event */
|
||||||
|
uint8_t bn_c_to_p; /*!< The burst number for Central to Peripheral transmission */
|
||||||
|
uint8_t bn_p_to_c; /*!< The burst number for Peripheral to Central transmission */
|
||||||
|
uint8_t ft_c_to_p; /*!< The flush timeout, in multiples of the ISO_Interval for the CIS, for each payload sent from the Central to the Peripheral */
|
||||||
|
uint8_t ft_p_to_c; /*!< The flush timeout, in multiples of the ISO_Interval for the CIS, for each payload sent from the Peripheral to the Central */
|
||||||
|
uint16_t max_pdu_c_to_p; /*!< Maximum size, in octets, of the payload from Central to Peripheral */
|
||||||
|
uint16_t max_pdu_p_to_c; /*!< Maximum size, in octets, of the payload from Peripheral to Central */
|
||||||
|
uint16_t iso_interval; /*!< The time between two consecutive CIS anchor points, Time = N × 1.25 ms */
|
||||||
|
#if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
uint32_t sub_interval; /*!< Time, in microseconds, between the start of consecutive subevents in a CIS event */
|
||||||
|
uint16_t max_sdu_c_to_p; /*!< Maximum size, in octets, of the payload from the Central’s Host */
|
||||||
|
uint16_t max_sdu_p_to_c; /*!< Maximum size, in octets, of the payload from the Peripheral’s Host */
|
||||||
|
uint32_t sdu_int_c_to_p; /*!< Time, in microseconds, between the start of consecutive SDUs sent by the Central */
|
||||||
|
uint32_t sdu_int_p_to_c; /*!< Time, in microseconds, between the start of consecutive SDUs sent by the Peripheral */
|
||||||
|
uint8_t framing; /*!< The format of the CIS Data PDUs and the mode of framed PDUs that the Controller used on the specified CIG */
|
||||||
|
#endif // #if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
} cis_estab; /*!< Event parameter of ESP_BLE_ISO_CIS_ESTABLISHED_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_CIS_DISCONNECTED_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_cis_dis_evt_params{
|
||||||
|
uint16_t cis_handle; /*!< Connection handle of the CIS */
|
||||||
|
uint8_t reason; /*!< Reason for disconnection. See [Vol 1] Part F, Controller Error Codes for error codes and descriptions */
|
||||||
|
} cis_disconnected; /*!< Event parameter of ESP_BLE_ISO_CIS_DISCONNECTED_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_CIS_REQUEST_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_cis_request_evt_params{
|
||||||
|
uint16_t acl_handle; /*!< Connection handle of the ACL */
|
||||||
|
uint16_t cis_handle; /*!< Connection handle of the CIS */
|
||||||
|
uint8_t cig_id; /*!< Identifier of the CIG */
|
||||||
|
uint8_t cis_id; /*!< Identifier of the CIS */
|
||||||
|
} cis_request; /*!< Event parameter of ESP_BLE_ISO_CIS_REQUEST_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_REMOVE_CIG_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_remove_cig_params{
|
||||||
|
esp_bt_status_t status; /*!< Indicate CIG remove succeeded or not*/
|
||||||
|
uint8_t cig_id; /*!< Identifier of a CIG */
|
||||||
|
} remove_cig; /*!< Event parameter of ESP_BLE_ISO_REMOVE_CIG_CMPL_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_ACCEPT_CIS_REQ_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_accept_req_evt_params{
|
||||||
|
esp_bt_status_t status; /*!< Indicate the CIS request is accepted successfully */
|
||||||
|
} accept_req; /*!< Event parameter of ESP_BLE_ISO_ACCEPT_CIS_REQ_CMPL_EVT */
|
||||||
|
/**
|
||||||
|
* @brief ESP_BLE_ISO_REJECT_CIS_REQ_CMPL_EVT
|
||||||
|
*/
|
||||||
|
struct ble_iso_reject_req_evt_params{
|
||||||
|
esp_bt_status_t status; /*!< Indicate the CIS request is rejected successfully */
|
||||||
|
uint16_t cis_handle; /*!< The connection handle of the CIS to be rejected */
|
||||||
|
} reject_req; /*!< Event parameter of ESP_BLE_ISO_REJECT_CIS_REQ_CMPL_EVT */
|
||||||
|
|
||||||
|
} esp_ble_iso_cb_param_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief ISO callback function type
|
||||||
|
* @param event : Event type
|
||||||
|
* @param param : Point to callback parameter, currently is union type
|
||||||
|
*/
|
||||||
|
typedef void (* esp_ble_iso_cb_t)(esp_ble_iso_cb_event_t event, esp_ble_iso_cb_param_t *param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to occur iso event, such as scan result
|
||||||
|
*
|
||||||
|
* @param[in] callback: callback function
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_register_callback(esp_ble_iso_cb_t callback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to get the current iso callback
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - esp_ble_iso_cb_t : callback function
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_ble_iso_cb_t esp_ble_iso_get_callback(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to create BIG.
|
||||||
|
*
|
||||||
|
* @param[in] big_creat_param: pointer to User defined big_creat_param data structure.
|
||||||
|
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_create_big(esp_ble_iso_big_creat_params_t *big_creat_param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to create BIG test.
|
||||||
|
*
|
||||||
|
* @param[in] big_creat_test_param: pointer to User defined big_creat_test_param data structure.
|
||||||
|
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_create_big_test(esp_ble_iso_big_creat_test_params_t *big_creat_test_param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to terminate a BIG.
|
||||||
|
*
|
||||||
|
* @param[in] big_handle: Used to identify the BIG.
|
||||||
|
* @param[in] reason: indicate the reason why the BIG is to be terminated.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_terminate_big(uint8_t big_handle, uint8_t reason);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to create BIG sync.
|
||||||
|
*
|
||||||
|
* @param[in] big_sync_create_param: pointer to User defined big_sync_create_param data structure.
|
||||||
|
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_big_create_sync(esp_ble_iso_big_sync_creat_params_t *big_sync_create_param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to terminate BIG sync.
|
||||||
|
*
|
||||||
|
* @param[in] big_handle: Identifier of the BIG.
|
||||||
|
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_big_terminate_sync(uint8_t big_handle);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to set iso data path.
|
||||||
|
*
|
||||||
|
* @param[in] data_path_params: pointer to User defined data_path_params data structure.
|
||||||
|
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_set_iso_data_path(esp_ble_iso_set_data_path_params_t *data_path_params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to remove iso data path.
|
||||||
|
*
|
||||||
|
* @param[in] data_path_params: pointer to User defined data_path_params data structure.
|
||||||
|
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_remove_iso_data_path(esp_ble_iso_remove_data_path_params_t *data_path_params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to set host feature.
|
||||||
|
*
|
||||||
|
* @param[in] bit_num: the bit position in the FeatureSet.
|
||||||
|
* @param[in] bit_val: the feature is enabled or disabled
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_set_host_feature(uint16_t bit_num, uint8_t bit_val);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to read tx sync.
|
||||||
|
*
|
||||||
|
* @param[in] iso_handle: Connection handle of the CIS or BIS.
|
||||||
|
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_read_iso_tx_sync(uint16_t iso_handle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to read link quality.
|
||||||
|
*
|
||||||
|
* @param[in] iso_handle: Connection handle of the CIS or BIS.
|
||||||
|
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_read_link_quality(uint16_t iso_handle);
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
/**
|
||||||
|
* @brief This function is called to accept cis request.
|
||||||
|
*
|
||||||
|
* @param[in] cis_handle: Connection handle of the CIS
|
||||||
|
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_accept_cis_request(uint16_t cis_handle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to reject cis request.
|
||||||
|
*
|
||||||
|
* @param[in] cis_handle: Connection handle of the CIS
|
||||||
|
* @param[in] reason: The reason for rejecting the CIS request
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_reject_cis_request(uint16_t cis_handle, uint8_t reason);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to set cig parameters.
|
||||||
|
*
|
||||||
|
* @param[in] cig_params: pointer to User defined cig_params data structure.
|
||||||
|
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_set_cig_parameters(struct esp_ble_iso_set_cig_params *cig_params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to set cig test parameters.
|
||||||
|
*
|
||||||
|
* @param[in] cig_params_test: pointer to User defined cig_params_test data structure.
|
||||||
|
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_set_cig_parameters_test(struct esp_ble_iso_set_cig_params_test *cig_params_test);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to create cis.
|
||||||
|
*
|
||||||
|
* @param[in] creat_cis_params: pointer to User defined creat_cis_params data structure.
|
||||||
|
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_create_cis(struct esp_ble_iso_create_cis_params *creat_cis_params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to remove CIG.
|
||||||
|
*
|
||||||
|
* @param[in] cig_id: Identifier of a CIG.
|
||||||
|
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_remove_cig(uint8_t cig_id);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is called to disconnect cis.
|
||||||
|
*
|
||||||
|
* @param[in] cis_handle: Connection handle of the CIS
|
||||||
|
* @param[in] reason: The reason for disconnecting the CIS. ESP_HCI_ERR_REMOTE_USER_TERM_CONN is recommended.
|
||||||
|
*
|
||||||
|
* The value of the reason is one of the following values:
|
||||||
|
* - ESP_HCI_ERR_AUTH_FAIL
|
||||||
|
* - ESP_HCI_ERR_REMOTE_USER_TERM_CONN
|
||||||
|
* - ESP_HCI_ERR_REMOTE_LOW_RESOURCES
|
||||||
|
* - ESP_HCI_ERR_REMOTE_POWER_OFF
|
||||||
|
* - ESP_HCI_ERR_UNSUPP_REMOTE_FEATURE
|
||||||
|
* - ESP_HCI_ERR_PAIRING_NOT_SUPPORTED
|
||||||
|
* - ESP_HCI_ERR_UNACCEPT_CONN_PARAM
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - ESP_OK : success
|
||||||
|
* - other : failed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
esp_err_t esp_ble_iso_disconnect_cis(uint16_t cis_handle, uint8_t reason);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __ESP_BLE_ISO_API_H__ */
|
@ -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
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -19,7 +19,83 @@ extern "C" {
|
|||||||
return ESP_ERR_INVALID_STATE; \
|
return ESP_ERR_INVALID_STATE; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ESP_BT_STATUS_BASE_FOR_HCI_ERR 0X0100 /* base for converting HCI error code to ESP status */
|
#define ESP_BT_STATUS_BASE_FOR_HCI_ERR 0X0100 /* base for converting HCI error code to ESP status */
|
||||||
|
|
||||||
|
/* See [Vol 1] Part F, Controller Error Codes for a list of error codes and descriptions */
|
||||||
|
|
||||||
|
#define ESP_HCI_ERR_SUCCESS 0x00 /* Success */
|
||||||
|
#define ESP_HCI_ERR_UNKNOWN_CMD 0x01 /* Unknown HCI Command */
|
||||||
|
#define ESP_HCI_ERR_UNKNOWN_CONN_ID 0x02 /* Unknown Connection Identifier */
|
||||||
|
#define ESP_HCI_ERR_HW_FAILURE 0x03 /* Hardware Failure */
|
||||||
|
#define ESP_HCI_ERR_PAGE_TIMEOUT 0x04 /* Page Timeout */
|
||||||
|
#define ESP_HCI_ERR_AUTH_FAIL 0x05 /* Authentication Failure */
|
||||||
|
#define ESP_HCI_ERR_PIN_OR_KEY_MISSING 0x06 /* PIN or Key Missing */
|
||||||
|
#define ESP_HCI_ERR_MEM_CAPACITY_EXCEEDED 0x07 /* Memory Capacity Exceeded */
|
||||||
|
#define ESP_HCI_ERR_CONN_TIMEOUT 0x08 /* Connection Timeout */
|
||||||
|
#define ESP_HCI_ERR_CONN_LIMIT_EXCEEDED 0x09 /* Connection Limit Exceeded */
|
||||||
|
#define ESP_HCI_ERR_SYNC_CONN_LIMIT_EXCEEDED 0x0A /* ASynchronous Connection Limit To A Device Exceeded */
|
||||||
|
#define ESP_HCI_ERR_CONN_ALREADY_EXISTS 0x0B /* Connection Already Exists */
|
||||||
|
#define ESP_HCI_ERR_CMD_DISALLOWED 0x0C /* Command Disallowed */
|
||||||
|
#define ESP_HCI_ERR_INSUFFICIENT_RESOURCES 0x0D /* Connection Rejected due to Limited Resources */
|
||||||
|
#define ESP_HCI_ERR_INSUFFICIENT_SECURITY 0x0E /* Connection Rejected Due To Security Reasons */
|
||||||
|
#define ESP_HCI_ERR_BD_ADDR_UNACCEPTABLE 0x0F /* Connection Rejected due to Unacceptable BD_ADDR */
|
||||||
|
#define ESP_HCI_ERR_CONN_ACCEPT_TIMEOUT 0x10 /* Connection Accept Timeout Exceeded */
|
||||||
|
#define ESP_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL 0x11 /* Unsupported Feature or Parameter Value */
|
||||||
|
#define ESP_HCI_ERR_INVALID_PARAM 0x12 /* Invalid HCI Command Parameters */
|
||||||
|
#define ESP_HCI_ERR_REMOTE_USER_TERM_CONN 0x13 /* Remote User Terminated Connection */
|
||||||
|
#define ESP_HCI_ERR_REMOTE_LOW_RESOURCES 0x14 /* Remote Device Terminated Connection due to Low Resources */
|
||||||
|
#define ESP_HCI_ERR_REMOTE_POWER_OFF 0x15 /* Remote Device Terminated Connection due to Power Off */
|
||||||
|
#define ESP_HCI_ERR_LOCALHOST_TERM_CONN 0x16 /* Connection Terminated By Local Host */
|
||||||
|
#define ESP_HCI_ERR_REPEATED_ATTEMPTS 0x17 /* Repeated Attempts */
|
||||||
|
#define ESP_HCI_ERR_PAIRING_NOT_ALLOWED 0x18 /* Pairing Not Allowed */
|
||||||
|
#define ESP_HCI_ERR_UNKNOWN_LMP_PDU 0x19 /* Unknown LMP PDU */
|
||||||
|
#define ESP_HCI_ERR_UNSUPP_REMOTE_FEATURE 0x1A /* Unsupported Remote Feature */
|
||||||
|
#define ESP_HCI_ERR_SCO_OFFSET_REJECTED 0x1B /* SCO Offset Rejected */
|
||||||
|
#define ESP_HCI_ERR_SCO_INTERVAL_REJECTED 0x1C /* SCO Interval Rejected */
|
||||||
|
#define ESP_HCI_ERR_SCO_AIR_MODE_REJECTED 0x1D /* SCO Air Mode Rejected */
|
||||||
|
#define ESP_HCI_ERR_INVALID_LL_PARAM 0x1E /* Invalid LMP Parameters / Invalid LL Parameters */
|
||||||
|
#define ESP_HCI_ERR_UNSPECIFIED 0x1F /* Unspecified Error */
|
||||||
|
#define ESP_HCI_ERR_UNSUPP_LL_PARAM_VAL 0x20 /* Unsupported LMP Parameter Value / Unsupported LL Parameter Value */
|
||||||
|
#define ESP_HCI_ERR_ROLE_CHANGE_NOT_ALLOWED 0x21 /* Role Change Not Allowed */
|
||||||
|
#define ESP_HCI_ERR_LL_RESP_TIMEOUT 0x22 /* LMP Response Timeout / LL Response Timeout */
|
||||||
|
#define ESP_HCI_ERR_LL_PROC_COLLISION 0x23 /* LMP Error Transaction Collision / LL Procedure Collision */
|
||||||
|
#define ESP_HCI_ERR_LMP_PDU_NOT_ALLOWED 0x24 /* LMP PDU Not Allowed */
|
||||||
|
#define ESP_HCI_ERR_ENC_MODE_NOT_ACCEPTABLE 0x25 /* Encryption Mode Not Acceptable */
|
||||||
|
#define ESP_HCI_ERR_LINK_KEY_CANNOT_BE_CHANGED 0x26 /* Link Key cannot be Changed */
|
||||||
|
#define ESP_HCI_ERR_REQUESTED_QOS_NOT_SUPPORTED 0x27 /* Requested QoS Not Supported */
|
||||||
|
#define ESP_HCI_ERR_INSTANT_PASSED 0x28 /* Instant Passed */
|
||||||
|
#define ESP_HCI_ERR_PAIRING_NOT_SUPPORTED 0x29 /* Pairing With Unit Key Not Supported */
|
||||||
|
#define ESP_HCI_ERR_DIFF_TRANS_COLLISION 0x2A /* Different Transaction Collision */
|
||||||
|
#define ESP_HCI_ERR_UNDEFINED_0x2B 0x2B /* Reserved for future use */
|
||||||
|
#define ESP_HCI_ERR_QOS_UNACCEPTABLE_PARAM 0x2C /* QoS Unacceptable Parameter */
|
||||||
|
#define ESP_HCI_ERR_QOS_REJECTED 0x2D /* QoS Rejected */
|
||||||
|
#define ESP_HCI_ERR_CHAN_ASSESS_NOT_SUPPORTED 0x2E /* Channel Classification Not Supported */
|
||||||
|
#define ESP_HCI_ERR_INSUFF_SECURITY 0x2F /* Insufficient Security */
|
||||||
|
#define ESP_HCI_ERR_PARAM_OUT_OF_MANDATORY_RANGE 0x30 /* Parameter Out Of Mandatory Range */
|
||||||
|
#define ESP_HCI_ERR_UNDEFINED_0x31 0x31 /* Reserved for future use */
|
||||||
|
#define ESP_HCI_ERR_ROLE_SWITCH_PENDING 0x32 /* Role Switch Pending */
|
||||||
|
#define ESP_HCI_ERR_UNDEFINED_0x33 0x33 /* Reserved for future use */
|
||||||
|
#define ESP_HCI_ERR_RESERVED_SLOT_VIOLATION 0x34 /* Reserved Slot Violation */
|
||||||
|
#define ESP_HCI_ERR_ROLE_SWITCH_FAILED 0x35 /* Role Switch Failed */
|
||||||
|
#define ESP_HCI_ERR_EXT_INQ_RESP_TOO_LARGE 0x36 /* Extended Inquiry Response Too Large */
|
||||||
|
#define ESP_HCI_ERR_SIMPLE_PAIR_NOT_SUPP_BY_HOST 0x37 /* Secure Simple Pairing Not Supported By Host */
|
||||||
|
#define ESP_HCI_ERR_HOST_BUSY_PAIRING 0x38 /* Host Busy - Pairing*/
|
||||||
|
#define ESP_HCI_ERR_CONN_REJECTED_DUE_TO_NO_CHAN 0x39 /* Connection Rejected due to No Suitable Channel Found */
|
||||||
|
#define ESP_HCI_ERR_CONTROLLER_BUSY 0x3A /* Controller Busy */
|
||||||
|
#define ESP_HCI_ERR_UNACCEPT_CONN_PARAM 0x3B /* Unacceptable Connection Parameters */
|
||||||
|
#define ESP_HCI_ERR_ADV_TIMEOUT 0x3C /* Advertising Timeout */
|
||||||
|
#define ESP_HCI_ERR_TERM_DUE_TO_MIC_FAIL 0x3D /* Connection Terminated due to MIC Failure */
|
||||||
|
#define ESP_HCI_ERR_CONN_FAIL_TO_ESTAB 0x3E /* Connection Failed to be Established / Synchronization Timeout */
|
||||||
|
#define ESP_HCI_ERR_MAC_CONN_FAILED 0x3F /* Previously used */
|
||||||
|
#define ESP_HCI_ERR_CLOCK_ADJUST_REJECTED 0x40 /* Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging */
|
||||||
|
#define ESP_HCI_ERR_SUBMAP_NOT_DEFINED 0x41 /* Type0 Submap Not Defined */
|
||||||
|
#define ESP_HCI_ERR_UNKNOWN_ADV_IDENTIFIER 0x42 /* Unknown Advertising Identifier */
|
||||||
|
#define ESP_HCI_ERR_LIMIT_REACHED 0x43 /* Limit Reached */
|
||||||
|
#define ESP_HCI_ERR_OP_CANCELLED_BY_HOST 0x44 /* Operation Cancelled by Host */
|
||||||
|
#define ESP_HCI_ERR_PACKET_TOO_LONG 0x45 /* Packet Too Long */
|
||||||
|
#define ESP_HCI_ERR_TOO_LATE 0x46 /* Too Late */
|
||||||
|
#define ESP_HCI_ERR_TOO_EARLY 0x47 /* Too Early */
|
||||||
|
#define ESP_HCI_ERR_INSUFFICIENT_CHANNELS 0x48 /* Insufficient Channels */
|
||||||
|
|
||||||
/* relate to BT_STATUS_xxx in bt_def.h */
|
/* relate to BT_STATUS_xxx in bt_def.h */
|
||||||
/// Status Return Value
|
/// Status Return Value
|
||||||
|
@ -6086,6 +6086,145 @@ void bta_dm_ble_gap_set_periodic_adv_sync_trans_params(tBTA_DM_MSG *p_data)
|
|||||||
p_data->ble_set_past_params.params.cte_type);
|
p_data->ble_set_past_params.params.cte_type);
|
||||||
}
|
}
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
void bta_dm_ble_big_create(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
tBTA_DM_BLE_BIG_CREATE_PARAMS param = p_data->big_creat.big_creat_param;
|
||||||
|
BTM_BleBigCreate(param.big_handle, param.adv_handle, param.num_bis,
|
||||||
|
param.sdu_interval, param.max_sdu, param.max_transport_latency,
|
||||||
|
param.rtn, param.phy, param.packing, param.framing,
|
||||||
|
param.encryption, ¶m.broadcast_code[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_big_create_test(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
tBTA_DM_BLE_BIG_CREATE_TEST_PARAMS param = p_data->big_creat_test.big_creat_test_param;
|
||||||
|
BTM_BleBigCreateTest(param.big_handle, param.adv_handle, param.num_bis,
|
||||||
|
param.sdu_interval, param.iso_interval, param.nse,
|
||||||
|
param.max_sdu, param.max_pdu, param.phy,
|
||||||
|
param.packing, param.framing, param.bn, param.irc,
|
||||||
|
param.pto, param.encryption, ¶m.broadcast_code[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_big_terminate(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
tBTA_DM_BLE_BIG_TERMINATE_PARAMS param = p_data->big_terminate.big_terminate_param;
|
||||||
|
BTM_BleBigTerminate(param.big_handle, param.reason);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
void bta_dm_ble_big_sync_create(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
tBTA_DM_BLE_BIG_SYNC_CREATE_PARAMS param = p_data->big_sync.big_sync_param;
|
||||||
|
BTM_BleBigSyncCreate(param.big_handle, param.sync_handle,
|
||||||
|
param.encryption, ¶m.bc_code[0],
|
||||||
|
param.mse, param.big_sync_timeout,
|
||||||
|
param.num_bis, ¶m.bis[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_big_sync_terminate(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
tBTA_DM_BLE_BIG_SYNC_TERMINATE_PARAMS param = p_data->big_sync_terminate.big_sync_terminate_param;
|
||||||
|
BTM_BleBigSyncTerminate(param.big_handle);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
|
||||||
|
void bta_dm_ble_iso_set_data_path(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
tBTA_DM_BLE_ISO_SET_DATA_PATH_PARAMS param = p_data->iso_set_data_path.iso_data_path_param;
|
||||||
|
BTM_BleIsoSetDataPath(param.conn_handle, param.data_path_dir, param.data_path_id, param.coding_fmt,
|
||||||
|
param.company_id, param.vs_codec_id, param.controller_delay, param.codec_len,
|
||||||
|
param.codec_cfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_iso_remove_data_path(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
tBTA_DM_BLE_ISO_REMOVE_DATA_PATH_PARAMS param = p_data->iso_remove_data_path.iso_data_path_remove_param;
|
||||||
|
BTM_BleIsoRemoveDataPath(param.conn_handle, param.data_path_dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_iso_set_host_feature(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
BTM_BleIsoSetHostFeature(p_data->iso_set_host_feat.bit_num, p_data->iso_set_host_feat.bit_val);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_iso_read_tx_sync(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
BTM_BleIsoReadTxSync(p_data->iso_read_tx_sync.iso_hdl);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_iso_read_link_quality(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
BTM_BleIsoReadLinkQuality(p_data->iso_read_link_quality.iso_hdl);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
void bta_dm_ble_set_cig_params(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
BTM_BleSetCigParams(p_data->api_cig_params.cig_id, p_data->api_cig_params.sdu_int_c_to_p, p_data->api_cig_params.sdu_int_p_to_c, p_data->api_cig_params.worse_case_SCA, p_data->api_cig_params.packing,
|
||||||
|
p_data->api_cig_params.framing, p_data->api_cig_params.mtl_c_to_p, p_data->api_cig_params.mtl_p_to_c, p_data->api_cig_params.cis_cnt, (uint8_t *)p_data->api_cig_params.cis_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_set_cig_params_test(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
BTM_BleSetCigParamsTest(p_data->api_cig_params_test.cig_id, p_data->api_cig_params_test.sdu_int_c_to_p, p_data->api_cig_params_test.sdu_int_p_to_c,
|
||||||
|
p_data->api_cig_params_test.ft_c_to_p, p_data->api_cig_params_test.ft_p_to_c, p_data->api_cig_params_test.iso_interval,
|
||||||
|
p_data->api_cig_params_test.worse_case_SCA, p_data->api_cig_params_test.packing, p_data->api_cig_params_test.framing,
|
||||||
|
p_data->api_cig_params_test.cis_cnt, (uint8_t *)p_data->api_cig_params_test.cis_params_test);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_create_cis(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
BTM_BleCreateCis(p_data->create_cis.cis_count, (uint8_t *)&p_data->create_cis.cis_hdls[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_remove_cig(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
BTM_BleRemoveCig(p_data->remove_cig.cig_id);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
void bta_dm_ble_accept_cis_req(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
BTM_BleAcceptCisReq(p_data->accept_cis_req.cis_handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bta_dm_ble_reject_cis_req(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
BTM_BleRejectCisReq(p_data->reject_cis_req.cis_handle, p_data->reject_cis_req.reason);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
void bta_dm_ble_discon_cis(tBTA_DM_MSG *p_data)
|
||||||
|
{
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
BTM_BleDisconCis(p_data->discon_cis.cis_handle, p_data->discon_cis.reason);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
#if (BLE_HOST_SETUP_STORAGE_EN == TRUE)
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
|
@ -3593,4 +3593,337 @@ void BTA_DmBleGapSetPeriodicAdvSyncTransParams(BD_ADDR peer_addr, tBTA_DM_BLE_PA
|
|||||||
}
|
}
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
void BTA_DmBleGapIsoBigCreate(tBTA_DM_BLE_BIG_CREATE_PARAMS *p_big_creat_param)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_BIG_CREATE *p_msg;
|
||||||
|
APPL_TRACE_API("%s.", __func__);
|
||||||
|
if ((p_msg = (tBTA_DM_API_BIG_CREATE *) osi_malloc(sizeof(tBTA_DM_API_BIG_CREATE))) != NULL) {
|
||||||
|
memset(p_msg, 0, sizeof(tBTA_DM_API_BIG_CREATE));
|
||||||
|
p_msg->hdr.event = BTA_DM_API_ISO_BIG_CREATE_EVT;
|
||||||
|
p_msg->big_creat_param.big_handle = p_big_creat_param->big_handle;
|
||||||
|
p_msg->big_creat_param.adv_handle = p_big_creat_param->adv_handle;
|
||||||
|
p_msg->big_creat_param.num_bis = p_big_creat_param->num_bis;
|
||||||
|
p_msg->big_creat_param.sdu_interval = p_big_creat_param->sdu_interval;
|
||||||
|
p_msg->big_creat_param.max_sdu = p_big_creat_param->max_sdu;
|
||||||
|
p_msg->big_creat_param.max_transport_latency = p_big_creat_param->max_transport_latency;
|
||||||
|
p_msg->big_creat_param.rtn = p_big_creat_param->rtn;
|
||||||
|
p_msg->big_creat_param.phy = p_big_creat_param->phy;
|
||||||
|
p_msg->big_creat_param.packing = p_big_creat_param->packing;
|
||||||
|
p_msg->big_creat_param.framing = p_big_creat_param->framing;
|
||||||
|
p_msg->big_creat_param.encryption = p_big_creat_param->encryption;
|
||||||
|
memcpy(&p_msg->big_creat_param.broadcast_code[0], p_big_creat_param->broadcast_code, 16);
|
||||||
|
//start sent the msg to the bta system control module
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
} else {
|
||||||
|
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleGapIsoBigCreateTest(tBTA_DM_BLE_BIG_CREATE_TEST_PARAMS *p_big_creat_test_param)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_BIG_CREATE_TEST *p_msg;
|
||||||
|
APPL_TRACE_API("%s.", __func__);
|
||||||
|
if ((p_msg = (tBTA_DM_API_BIG_CREATE_TEST *) osi_malloc(sizeof(tBTA_DM_API_BIG_CREATE_TEST))) != NULL) {
|
||||||
|
memset(p_msg, 0, sizeof(tBTA_DM_API_BIG_CREATE_TEST));
|
||||||
|
p_msg->hdr.event = BTA_DM_API_ISO_BIG_CREATE_TEST_EVT;
|
||||||
|
p_msg->big_creat_test_param.big_handle = p_big_creat_test_param->big_handle;
|
||||||
|
p_msg->big_creat_test_param.adv_handle = p_big_creat_test_param->adv_handle;
|
||||||
|
p_msg->big_creat_test_param.num_bis = p_big_creat_test_param->num_bis;
|
||||||
|
p_msg->big_creat_test_param.sdu_interval = p_big_creat_test_param->sdu_interval;
|
||||||
|
p_msg->big_creat_test_param.iso_interval = p_big_creat_test_param->iso_interval;
|
||||||
|
p_msg->big_creat_test_param.nse = p_big_creat_test_param->nse;
|
||||||
|
p_msg->big_creat_test_param.max_sdu = p_big_creat_test_param->max_sdu;
|
||||||
|
p_msg->big_creat_test_param.max_pdu = p_big_creat_test_param->max_pdu;
|
||||||
|
p_msg->big_creat_test_param.phy = p_big_creat_test_param->phy;
|
||||||
|
p_msg->big_creat_test_param.packing = p_big_creat_test_param->packing;
|
||||||
|
p_msg->big_creat_test_param.framing = p_big_creat_test_param->framing;
|
||||||
|
p_msg->big_creat_test_param.bn = p_big_creat_test_param->bn;
|
||||||
|
p_msg->big_creat_test_param.irc = p_big_creat_test_param->irc;
|
||||||
|
p_msg->big_creat_test_param.pto = p_big_creat_test_param->pto;
|
||||||
|
p_msg->big_creat_test_param.encryption = p_big_creat_test_param->encryption;
|
||||||
|
memcpy(&p_msg->big_creat_test_param.broadcast_code[0], p_big_creat_test_param->broadcast_code, 16);
|
||||||
|
|
||||||
|
//start sent the msg to the bta system control module
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
} else {
|
||||||
|
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleGapIsoBigTerminate(tBTA_DM_BLE_BIG_TERMINATE_PARAMS *p_big_terminate_param)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_BIG_TERMINATE *p_msg;
|
||||||
|
APPL_TRACE_API("%s.", __func__);
|
||||||
|
if ((p_msg = (tBTA_DM_API_BIG_TERMINATE *) osi_malloc(sizeof(tBTA_DM_API_BIG_TERMINATE))) != NULL) {
|
||||||
|
memset(p_msg, 0, sizeof(tBTA_DM_API_BIG_TERMINATE));
|
||||||
|
p_msg->hdr.event = BTA_DM_API_ISO_BIG_TERMINATE_EVT;
|
||||||
|
p_msg->big_terminate_param.big_handle = p_big_terminate_param->big_handle;
|
||||||
|
p_msg->big_terminate_param.reason = p_big_terminate_param->reason;
|
||||||
|
|
||||||
|
//start sent the msg to the bta system control module
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
} else {
|
||||||
|
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
void BTA_DmBleGapIsoBigSyncCreate(tBTA_DM_BLE_BIG_SYNC_CREATE_PARAMS *p_big_sync_param)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_BIG_SYNC_CREATE *p_msg;
|
||||||
|
APPL_TRACE_API("%s.", __func__);
|
||||||
|
if ((p_msg = (tBTA_DM_API_BIG_SYNC_CREATE *) osi_malloc(sizeof(tBTA_DM_API_BIG_SYNC_CREATE))) != NULL) {
|
||||||
|
memset(p_msg, 0, sizeof(tBTA_DM_API_BIG_SYNC_CREATE));
|
||||||
|
p_msg->hdr.event = BTA_DM_API_ISO_BIG_SYNC_CREATE_EVT;
|
||||||
|
|
||||||
|
p_msg->big_sync_param.big_handle = p_big_sync_param->big_handle;
|
||||||
|
p_msg->big_sync_param.sync_handle = p_big_sync_param->sync_handle;
|
||||||
|
p_msg->big_sync_param.encryption = p_big_sync_param->encryption;
|
||||||
|
memcpy(&p_msg->big_sync_param.bc_code[0], &p_big_sync_param->bc_code[0], 16);
|
||||||
|
p_msg->big_sync_param.mse = p_big_sync_param->mse;
|
||||||
|
p_msg->big_sync_param.big_sync_timeout = p_big_sync_param->big_sync_timeout;
|
||||||
|
p_msg->big_sync_param.num_bis = p_big_sync_param->num_bis;
|
||||||
|
memcpy(&p_msg->big_sync_param.bis[0], &p_big_sync_param->bis[0], p_big_sync_param->num_bis);
|
||||||
|
|
||||||
|
//start sent the msg to the bta system control module
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
} else {
|
||||||
|
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleGapIsoBigSyncTerminate(tBTA_DM_BLE_BIG_SYNC_TERMINATE_PARAMS *p_big_sync_terminate_param)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_BIG_SYNC_TERMINATE *p_msg;
|
||||||
|
APPL_TRACE_API("%s.", __func__);
|
||||||
|
if ((p_msg = (tBTA_DM_API_BIG_SYNC_TERMINATE *) osi_malloc(sizeof(tBTA_DM_API_BIG_SYNC_TERMINATE))) != NULL) {
|
||||||
|
memset(p_msg, 0, sizeof(tBTA_DM_API_BIG_SYNC_TERMINATE));
|
||||||
|
p_msg->hdr.event = BTA_DM_API_ISO_BIG_SYNC_TERMINATE_EVT;
|
||||||
|
|
||||||
|
p_msg->big_sync_terminate_param.big_handle = p_big_sync_terminate_param->big_handle;
|
||||||
|
|
||||||
|
//start sent the msg to the bta system control module
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
} else {
|
||||||
|
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
void BTA_DmBleGapIsoDataPathSet(tBTA_DM_BLE_ISO_SET_DATA_PATH_PARAMS *p_iso_data_path_param)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_ISO_DATA_PATH *p_msg;
|
||||||
|
uint8_t codec_cfg_len = p_iso_data_path_param->codec_len;
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
if ((p_msg = (tBTA_DM_API_ISO_DATA_PATH *) osi_malloc(sizeof(tBTA_DM_API_ISO_DATA_PATH) + codec_cfg_len)) != NULL) {
|
||||||
|
memset(p_msg, 0, sizeof(tBTA_DM_API_ISO_DATA_PATH));
|
||||||
|
p_msg->hdr.event = BTA_DM_API_ISO_SET_DATA_PATH_EVT;
|
||||||
|
|
||||||
|
p_msg->iso_data_path_param.conn_handle = p_iso_data_path_param->conn_handle;
|
||||||
|
p_msg->iso_data_path_param.data_path_dir = p_iso_data_path_param->data_path_dir;
|
||||||
|
p_msg->iso_data_path_param.data_path_id = p_iso_data_path_param->data_path_id;
|
||||||
|
p_msg->iso_data_path_param.coding_fmt = p_iso_data_path_param->coding_fmt;
|
||||||
|
p_msg->iso_data_path_param.company_id = p_iso_data_path_param->company_id;
|
||||||
|
p_msg->iso_data_path_param.vs_codec_id = p_iso_data_path_param->vs_codec_id;
|
||||||
|
p_msg->iso_data_path_param.controller_delay = p_iso_data_path_param->controller_delay;
|
||||||
|
p_msg->iso_data_path_param.codec_len = p_iso_data_path_param->codec_len;
|
||||||
|
p_msg->iso_data_path_param.codec_cfg = (codec_cfg_len != 0) ? (UINT8 *)(p_msg + 1) : NULL;
|
||||||
|
if (codec_cfg_len) {
|
||||||
|
memcpy(p_msg->iso_data_path_param.codec_cfg, p_iso_data_path_param->codec_cfg, p_iso_data_path_param->codec_len);
|
||||||
|
}
|
||||||
|
//start sent the msg to the bta system control module
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
} else {
|
||||||
|
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleGapIsoDataPathRemove(tBTA_DM_BLE_ISO_REMOVE_DATA_PATH_PARAMS *p_iso_data_path_param)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_ISO_DATA_PATH_REMOVE *p_msg;
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
if ((p_msg = (tBTA_DM_API_ISO_DATA_PATH_REMOVE *) osi_malloc(sizeof(tBTA_DM_API_ISO_DATA_PATH_REMOVE))) != NULL) {
|
||||||
|
memset(p_msg, 0, sizeof(tBTA_DM_API_ISO_DATA_PATH_REMOVE));
|
||||||
|
p_msg->hdr.event = BTA_DM_API_ISO_REMOVE_DATA_PATH_EVT;
|
||||||
|
|
||||||
|
p_msg->iso_data_path_remove_param.conn_handle = p_iso_data_path_param->conn_handle;
|
||||||
|
p_msg->iso_data_path_remove_param.data_path_dir = p_iso_data_path_param->data_path_dir;
|
||||||
|
//start sent the msg to the bta system control module
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
} else {
|
||||||
|
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleGapIsoSetHostFeature(uint16_t bit_num, uint8_t bit_val)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_ISO_SET_HOST_FEATURE *p_msg;
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
if ((p_msg = (tBTA_DM_API_ISO_SET_HOST_FEATURE *) osi_malloc(sizeof(tBTA_DM_API_ISO_SET_HOST_FEATURE))) != NULL) {
|
||||||
|
memset(p_msg, 0, sizeof(tBTA_DM_API_ISO_SET_HOST_FEATURE));
|
||||||
|
p_msg->hdr.event = BTA_DM_API_ISO_SET_HOST_FEATURE_EVT;
|
||||||
|
|
||||||
|
p_msg->bit_num = bit_num;
|
||||||
|
p_msg->bit_val = bit_val;
|
||||||
|
//start sent the msg to the bta system control module
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
} else {
|
||||||
|
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleGapIsoReadTxSync(uint16_t iso_handle)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_ISO_READ_TX_SYNC *p_msg;
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
if ((p_msg = (tBTA_DM_API_ISO_READ_TX_SYNC *) osi_malloc(sizeof(tBTA_DM_API_ISO_READ_TX_SYNC))) != NULL) {
|
||||||
|
memset(p_msg, 0, sizeof(tBTA_DM_API_ISO_READ_TX_SYNC));
|
||||||
|
p_msg->hdr.event = BTA_DM_API_ISO_READ_TX_SYNC_EVT;
|
||||||
|
|
||||||
|
p_msg->iso_hdl= iso_handle;
|
||||||
|
//start sent the msg to the bta system control module
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
} else {
|
||||||
|
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleGapIsoReadLinkQuality(uint16_t iso_handle)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_ISO_READ_LINK_QUALITY *p_msg;
|
||||||
|
APPL_TRACE_API("%s", __func__);
|
||||||
|
if ((p_msg = (tBTA_DM_API_ISO_READ_LINK_QUALITY *) osi_malloc(sizeof(tBTA_DM_API_ISO_READ_LINK_QUALITY))) != NULL) {
|
||||||
|
memset(p_msg, 0, sizeof(tBTA_DM_API_ISO_READ_LINK_QUALITY));
|
||||||
|
p_msg->hdr.event = BTA_DM_API_ISO_READ_LINK_QUALITY_EVT;
|
||||||
|
|
||||||
|
p_msg->iso_hdl= iso_handle;
|
||||||
|
//start sent the msg to the bta system control module
|
||||||
|
bta_sys_sendmsg(p_msg);
|
||||||
|
} else {
|
||||||
|
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
void BTA_DmBleIsoSetCigParams(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t worse_case_SCA, uint8_t packing,
|
||||||
|
uint8_t framing, uint16_t mtl_c_to_p, uint16_t mtl_p_to_c, uint8_t cis_cnt, uint8_t *cis_params)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_SET_CIG_PARAM *p_buf;
|
||||||
|
if ((p_buf = (tBTA_DM_API_SET_CIG_PARAM *)osi_malloc(sizeof(tBTA_DM_API_SET_CIG_PARAM))) != NULL) {
|
||||||
|
p_buf->hdr.event = BTA_DM_API_SET_CIG_PARAMS_EVT;
|
||||||
|
p_buf->cig_id = cig_id;
|
||||||
|
p_buf->sdu_int_c_to_p = sdu_int_c_to_p;
|
||||||
|
p_buf->sdu_int_p_to_c = sdu_int_p_to_c;
|
||||||
|
p_buf->worse_case_SCA = worse_case_SCA;
|
||||||
|
p_buf->packing = packing;
|
||||||
|
p_buf->framing = framing;
|
||||||
|
p_buf->mtl_c_to_p = mtl_c_to_p;
|
||||||
|
p_buf->mtl_p_to_c = mtl_p_to_c;
|
||||||
|
p_buf->cis_cnt = cis_cnt;
|
||||||
|
memcpy(&p_buf->cis_params[0], cis_params, sizeof(struct bta_iso_cis_params) * cis_cnt);
|
||||||
|
|
||||||
|
bta_sys_sendmsg(p_buf);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleIsoSetCigParamsTest(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t ft_c_to_p, uint8_t ft_p_to_c,
|
||||||
|
uint16_t iso_interval, uint8_t worse_case_SCA, uint8_t packing, uint8_t framing, uint8_t cis_cnt, uint8_t *cis_params_test)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_SET_CIG_PARAM_TEST *p_buf;
|
||||||
|
if ((p_buf = (tBTA_DM_API_SET_CIG_PARAM_TEST *)osi_malloc(sizeof(tBTA_DM_API_SET_CIG_PARAM_TEST))) != NULL) {
|
||||||
|
p_buf->hdr.event = BTA_DM_API_SET_CIG_PARAMS_TEST_EVT;
|
||||||
|
p_buf->cig_id = cig_id;
|
||||||
|
p_buf->sdu_int_c_to_p = sdu_int_c_to_p;
|
||||||
|
p_buf->sdu_int_p_to_c = sdu_int_p_to_c;
|
||||||
|
p_buf->ft_c_to_p = ft_c_to_p;
|
||||||
|
p_buf->ft_p_to_c = ft_p_to_c;
|
||||||
|
p_buf->iso_interval = iso_interval;
|
||||||
|
p_buf->worse_case_SCA = worse_case_SCA;
|
||||||
|
p_buf->packing = packing;
|
||||||
|
p_buf->framing = framing;
|
||||||
|
p_buf->cis_cnt = cis_cnt;
|
||||||
|
memcpy(&p_buf->cis_params_test[0], cis_params_test, sizeof(struct bta_iso_cis_params_test) * cis_cnt);
|
||||||
|
|
||||||
|
bta_sys_sendmsg(p_buf);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleIsoCreateCis(uint8_t cig_count, uint8_t *cis_hdl_info)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_CREATE_CIS_PARAM *p_buf;
|
||||||
|
if ((p_buf = (tBTA_DM_API_CREATE_CIS_PARAM *)osi_malloc(sizeof(tBTA_DM_API_CREATE_CIS_PARAM))) != NULL) {
|
||||||
|
p_buf->hdr.event = BTA_DM_API_CREATE_CIS_EVT;
|
||||||
|
p_buf->cis_count = cig_count;
|
||||||
|
|
||||||
|
struct bta_iso_cis_hdls *hdls = (struct bta_iso_cis_hdls *)cis_hdl_info;
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < cig_count; i++)
|
||||||
|
{
|
||||||
|
p_buf->cis_hdls[i].cis_hdl = hdls[i].cis_hdl;
|
||||||
|
p_buf->cis_hdls[i].acl_hdl = hdls[i].acl_hdl;
|
||||||
|
}
|
||||||
|
|
||||||
|
bta_sys_sendmsg(p_buf);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleIsoRemoveCig(uint8_t cig_id)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_REMOVE_CIG_PARAM *p_buf;
|
||||||
|
if ((p_buf = (tBTA_DM_API_REMOVE_CIG_PARAM *)osi_malloc(sizeof(tBTA_DM_API_REMOVE_CIG_PARAM))) != NULL) {
|
||||||
|
p_buf->hdr.event = BTA_DM_API_REMOVE_CIG_PARAMS_EVT;
|
||||||
|
p_buf->cig_id = cig_id;
|
||||||
|
bta_sys_sendmsg(p_buf);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
void BTA_DmBleIsoAcceptCisReq(uint16_t cis_handle)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_ACCEPT_CIS_REQ_PARAM *p_buf;
|
||||||
|
if ((p_buf = (tBTA_DM_API_ACCEPT_CIS_REQ_PARAM *)osi_malloc(sizeof(tBTA_DM_API_ACCEPT_CIS_REQ_PARAM))) != NULL) {
|
||||||
|
p_buf->hdr.event = BTA_DM_API_ACCEPT_CIS_REQ_PARAMS_EVT;
|
||||||
|
p_buf->cis_handle = cis_handle;
|
||||||
|
bta_sys_sendmsg(p_buf);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTA_DmBleIsoRejectCisReq(uint16_t cis_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_REJECT_CIS_REQ_PARAM *p_buf;
|
||||||
|
if ((p_buf = (tBTA_DM_API_REJECT_CIS_REQ_PARAM *)osi_malloc(sizeof(tBTA_DM_API_REJECT_CIS_REQ_PARAM))) != NULL) {
|
||||||
|
p_buf->hdr.event = BTA_DM_API_REJECT_CIS_REQ_PARAMS_EVT;
|
||||||
|
p_buf->cis_handle = cis_handle;
|
||||||
|
p_buf->reason = reason;
|
||||||
|
bta_sys_sendmsg(p_buf);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
void BTA_DmBleIsoDisconCis(uint16_t cis_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
tBTA_DM_API_DISCON_CIS_PARAM *p_buf;
|
||||||
|
if ((p_buf = (tBTA_DM_API_DISCON_CIS_PARAM *)osi_malloc(sizeof(tBTA_DM_API_DISCON_CIS_PARAM))) != NULL) {
|
||||||
|
p_buf->hdr.event = BTA_DM_API_DISCON_CIS_EVT;
|
||||||
|
p_buf->cis_handle = cis_handle;
|
||||||
|
p_buf->reason = reason;
|
||||||
|
bta_sys_sendmsg(p_buf);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
#endif
|
#endif
|
||||||
|
@ -287,6 +287,35 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
|||||||
bta_dm_ble_gap_set_csa_support, /* BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT */
|
bta_dm_ble_gap_set_csa_support, /* BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT */
|
||||||
bta_dm_ble_gap_set_vendor_evt_mask, /* BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT */
|
bta_dm_ble_gap_set_vendor_evt_mask, /* BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT */
|
||||||
#endif
|
#endif
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
bta_dm_ble_big_create, /* BTA_DM_API_ISO_BIG_CREATE_EVT */
|
||||||
|
bta_dm_ble_big_create_test, /* BTA_DM_API_ISO_BIG_CREATE_TEST_EVT */
|
||||||
|
bta_dm_ble_big_terminate, /* BTA_DM_API_ISO_BIG_TERMINATE_EVT */
|
||||||
|
#endif// #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
bta_dm_ble_big_sync_create, /* BTA_DM_API_ISO_BIG_SYNC_CREATE_EVT */
|
||||||
|
bta_dm_ble_big_sync_terminate, /* BTA_DM_API_ISO_BIG_SYNC_TERMINATE_EVT */
|
||||||
|
#endif// #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
bta_dm_ble_iso_set_data_path, /* BTA_DM_API_ISO_SET_DATA_PATH_EVT */
|
||||||
|
bta_dm_ble_iso_remove_data_path, /* BTA_DM_API_ISO_REMOVE_DATA_PATH_EVT */
|
||||||
|
bta_dm_ble_iso_set_host_feature, /* BTA_DM_API_ISO_SET_HOST_FEATURE_EVT */
|
||||||
|
bta_dm_ble_iso_read_tx_sync, /* BTA_DM_API_ISO_READ_TX_SYNC_EVT */
|
||||||
|
bta_dm_ble_iso_read_link_quality, /* BTA_DM_API_ISO_READ_LINK_QUALITY_EVT */
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
bta_dm_ble_set_cig_params, /* BTA_DM_API_SET_CIG_PARAMS_EVT */
|
||||||
|
bta_dm_ble_set_cig_params_test, /* BTA_DM_API_SET_CIG_PARAMS_TEST_EVT */
|
||||||
|
bta_dm_ble_create_cis, /* BTA_DM_API_CREATE_CIS_EVT */
|
||||||
|
bta_dm_ble_remove_cig, /* BTA_DM_API_REMOVE_CIG_PARAMS_EVT*/
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
bta_dm_ble_accept_cis_req, /* BTA_DM_API_ACCEPT_CIS_REQ_PARAMS_EVT */
|
||||||
|
bta_dm_ble_reject_cis_req, /* BTA_DM_API_REJECT_CIS_REQ_PARAMS_EVT */
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
bta_dm_ble_discon_cis, /* BTA_DM_API_DISCON_CIS_EVT */
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -278,6 +278,35 @@ enum {
|
|||||||
BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT,
|
BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT,
|
||||||
BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT,
|
BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT,
|
||||||
#endif
|
#endif
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
BTA_DM_API_ISO_BIG_CREATE_EVT,
|
||||||
|
BTA_DM_API_ISO_BIG_CREATE_TEST_EVT,
|
||||||
|
BTA_DM_API_ISO_BIG_TERMINATE_EVT,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
BTA_DM_API_ISO_BIG_SYNC_CREATE_EVT,
|
||||||
|
BTA_DM_API_ISO_BIG_SYNC_TERMINATE_EVT,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
BTA_DM_API_ISO_SET_DATA_PATH_EVT,
|
||||||
|
BTA_DM_API_ISO_REMOVE_DATA_PATH_EVT,
|
||||||
|
BTA_DM_API_ISO_SET_HOST_FEATURE_EVT,
|
||||||
|
BTA_DM_API_ISO_READ_TX_SYNC_EVT,
|
||||||
|
BTA_DM_API_ISO_READ_LINK_QUALITY_EVT,
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
BTA_DM_API_SET_CIG_PARAMS_EVT,
|
||||||
|
BTA_DM_API_SET_CIG_PARAMS_TEST_EVT,
|
||||||
|
BTA_DM_API_CREATE_CIS_EVT,
|
||||||
|
BTA_DM_API_REMOVE_CIG_PARAMS_EVT,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
BTA_DM_API_ACCEPT_CIS_REQ_PARAMS_EVT,
|
||||||
|
BTA_DM_API_REJECT_CIS_REQ_PARAMS_EVT,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
BTA_DM_API_DISCON_CIS_EVT,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
BTA_DM_MAX_EVT
|
BTA_DM_MAX_EVT
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1274,6 +1303,152 @@ typedef struct {
|
|||||||
} tBTA_DM_API_SET_PAST_PARAMS;
|
} tBTA_DM_API_SET_PAST_PARAMS;
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
tBTA_DM_BLE_BIG_CREATE_PARAMS big_creat_param;
|
||||||
|
} tBTA_DM_API_BIG_CREATE;
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
tBTA_DM_BLE_BIG_CREATE_TEST_PARAMS big_creat_test_param;
|
||||||
|
} tBTA_DM_API_BIG_CREATE_TEST;
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
tBTA_DM_BLE_BIG_TERMINATE_PARAMS big_terminate_param;
|
||||||
|
} tBTA_DM_API_BIG_TERMINATE;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
tBTA_DM_BLE_BIG_SYNC_CREATE_PARAMS big_sync_param;
|
||||||
|
} tBTA_DM_API_BIG_SYNC_CREATE;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
tBTA_DM_BLE_BIG_SYNC_TERMINATE_PARAMS big_sync_terminate_param;
|
||||||
|
} tBTA_DM_API_BIG_SYNC_TERMINATE;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
tBTA_DM_BLE_ISO_SET_DATA_PATH_PARAMS iso_data_path_param;
|
||||||
|
} tBTA_DM_API_ISO_DATA_PATH;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
tBTA_DM_BLE_ISO_REMOVE_DATA_PATH_PARAMS iso_data_path_remove_param;
|
||||||
|
} tBTA_DM_API_ISO_DATA_PATH_REMOVE;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
uint16_t bit_num;
|
||||||
|
uint8_t bit_val;
|
||||||
|
} tBTA_DM_API_ISO_SET_HOST_FEATURE;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
uint16_t iso_hdl;
|
||||||
|
} tBTA_DM_API_ISO_READ_TX_SYNC;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
uint16_t iso_hdl;
|
||||||
|
} tBTA_DM_API_ISO_READ_LINK_QUALITY;
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
struct bta_iso_cis_params {
|
||||||
|
UINT8 cis_id;
|
||||||
|
UINT16 max_sdu_c_to_p;
|
||||||
|
UINT16 max_sdu_p_to_c;
|
||||||
|
UINT8 phy_c_to_p;
|
||||||
|
UINT8 phy_p_to_c;
|
||||||
|
UINT8 rtn_c_to_p;
|
||||||
|
UINT8 rtn_p_to_c;
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
struct bta_iso_cis_params_test {
|
||||||
|
UINT8 cis_id;
|
||||||
|
UINT8 nse;
|
||||||
|
UINT16 max_sdu_c_to_p;
|
||||||
|
UINT16 max_sdu_p_to_c;
|
||||||
|
UINT16 max_pdu_c_to_p;
|
||||||
|
UINT16 max_pdu_p_to_c;
|
||||||
|
UINT8 phy_c_to_p;
|
||||||
|
UINT8 phy_p_to_c;
|
||||||
|
UINT8 bn_c_to_p;
|
||||||
|
UINT8 bn_p_to_c;
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
UINT8 cig_id;
|
||||||
|
UINT32 sdu_int_c_to_p;
|
||||||
|
UINT32 sdu_int_p_to_c;
|
||||||
|
UINT8 worse_case_SCA;
|
||||||
|
UINT8 packing;
|
||||||
|
UINT8 framing;
|
||||||
|
UINT16 mtl_c_to_p; // max_transport_latency_c_to_p
|
||||||
|
UINT16 mtl_p_to_c; // max_transport_latency_p_to_c
|
||||||
|
UINT8 cis_cnt;
|
||||||
|
struct bta_iso_cis_params cis_params[BLE_ISO_CIS_MAX_COUNT];
|
||||||
|
} tBTA_DM_API_SET_CIG_PARAM;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
UINT8 cig_id;
|
||||||
|
UINT32 sdu_int_c_to_p;
|
||||||
|
UINT32 sdu_int_p_to_c;
|
||||||
|
UINT8 ft_c_to_p;
|
||||||
|
UINT8 ft_p_to_c;
|
||||||
|
UINT16 iso_interval;
|
||||||
|
UINT8 worse_case_SCA;
|
||||||
|
UINT8 packing;
|
||||||
|
UINT8 framing;
|
||||||
|
UINT8 cis_cnt;
|
||||||
|
struct bta_iso_cis_params_test cis_params_test[BLE_ISO_CIS_MAX_COUNT];
|
||||||
|
} tBTA_DM_API_SET_CIG_PARAM_TEST;
|
||||||
|
|
||||||
|
struct bta_iso_cis_hdls {
|
||||||
|
uint16_t cis_hdl;
|
||||||
|
uint16_t acl_hdl;
|
||||||
|
}__attribute__((packed));
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
uint8_t cis_count;
|
||||||
|
struct bta_iso_cis_hdls cis_hdls[BLE_ISO_CIS_MAX_COUNT];
|
||||||
|
} tBTA_DM_API_CREATE_CIS_PARAM;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
UINT8 cig_id;
|
||||||
|
} tBTA_DM_API_REMOVE_CIG_PARAM;
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
UINT16 cis_handle;
|
||||||
|
} tBTA_DM_API_ACCEPT_CIS_REQ_PARAM;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
UINT16 cis_handle;
|
||||||
|
UINT8 reason;
|
||||||
|
} tBTA_DM_API_REJECT_CIS_REQ_PARAM;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
BT_HDR hdr;
|
||||||
|
UINT16 cis_handle;
|
||||||
|
UINT8 reason;
|
||||||
|
} tBTA_DM_API_DISCON_CIS_PARAM;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
/* union of all data types */
|
/* union of all data types */
|
||||||
typedef union {
|
typedef union {
|
||||||
/* event buffer header */
|
/* event buffer header */
|
||||||
@ -1479,6 +1654,35 @@ typedef union {
|
|||||||
tBTA_DM_API_REMOVE_ALL_ACL remove_all_acl;
|
tBTA_DM_API_REMOVE_ALL_ACL remove_all_acl;
|
||||||
#endif // #if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
|
#endif // #if (BLE_HOST_REMOVE_ALL_ACL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
tBTA_DM_API_BIG_CREATE big_creat;
|
||||||
|
tBTA_DM_API_BIG_CREATE_TEST big_creat_test;
|
||||||
|
tBTA_DM_API_BIG_TERMINATE big_terminate;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
tBTA_DM_API_BIG_SYNC_CREATE big_sync;
|
||||||
|
tBTA_DM_API_BIG_SYNC_TERMINATE big_sync_terminate;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
tBTA_DM_API_ISO_DATA_PATH iso_set_data_path;
|
||||||
|
tBTA_DM_API_ISO_DATA_PATH_REMOVE iso_remove_data_path;
|
||||||
|
tBTA_DM_API_ISO_SET_HOST_FEATURE iso_set_host_feat;
|
||||||
|
tBTA_DM_API_ISO_READ_TX_SYNC iso_read_tx_sync;
|
||||||
|
tBTA_DM_API_ISO_READ_LINK_QUALITY iso_read_link_quality;
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
tBTA_DM_API_SET_CIG_PARAM api_cig_params;
|
||||||
|
tBTA_DM_API_SET_CIG_PARAM_TEST api_cig_params_test;
|
||||||
|
tBTA_DM_API_CREATE_CIS_PARAM create_cis;
|
||||||
|
tBTA_DM_API_REMOVE_CIG_PARAM remove_cig;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
tBTA_DM_API_ACCEPT_CIS_REQ_PARAM accept_cis_req;
|
||||||
|
tBTA_DM_API_REJECT_CIS_REQ_PARAM reject_cis_req;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
tBTA_DM_API_DISCON_CIS_PARAM discon_cis;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
} tBTA_DM_MSG;
|
} tBTA_DM_MSG;
|
||||||
|
|
||||||
|
|
||||||
@ -2085,4 +2289,33 @@ extern void bta_dm_ble_gap_periodic_adv_set_info_trans(tBTA_DM_MSG *p_data);
|
|||||||
extern void bta_dm_ble_gap_set_periodic_adv_sync_trans_params(tBTA_DM_MSG *p_data);
|
extern void bta_dm_ble_gap_set_periodic_adv_sync_trans_params(tBTA_DM_MSG *p_data);
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
extern void bta_dm_ble_big_create(tBTA_DM_MSG *p_data);
|
||||||
|
extern void bta_dm_ble_big_create_test(tBTA_DM_MSG *p_data);
|
||||||
|
extern void bta_dm_ble_big_terminate(tBTA_DM_MSG *p_data);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
extern void bta_dm_ble_big_sync_create(tBTA_DM_MSG *p_data);
|
||||||
|
extern void bta_dm_ble_big_sync_terminate(tBTA_DM_MSG *p_data);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
extern void bta_dm_ble_iso_set_data_path(tBTA_DM_MSG *p_data);
|
||||||
|
extern void bta_dm_ble_iso_remove_data_path(tBTA_DM_MSG *p_data);
|
||||||
|
extern void bta_dm_ble_iso_set_host_feature(tBTA_DM_MSG *p_data);
|
||||||
|
extern void bta_dm_ble_iso_read_tx_sync(tBTA_DM_MSG *p_data);
|
||||||
|
void bta_dm_ble_iso_read_link_quality(tBTA_DM_MSG *p_data);
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
void bta_dm_ble_set_cig_params(tBTA_DM_MSG *p_data);
|
||||||
|
void bta_dm_ble_set_cig_params_test(tBTA_DM_MSG *p_data);
|
||||||
|
void bta_dm_ble_create_cis(tBTA_DM_MSG *p_data);
|
||||||
|
void bta_dm_ble_remove_cig(tBTA_DM_MSG *p_data);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
void bta_dm_ble_accept_cis_req(tBTA_DM_MSG *p_data);
|
||||||
|
void bta_dm_ble_reject_cis_req(tBTA_DM_MSG *p_data);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
void bta_dm_ble_discon_cis(tBTA_DM_MSG *p_data);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
#endif /* BTA_DM_INT_H */
|
#endif /* BTA_DM_INT_H */
|
||||||
|
@ -1689,6 +1689,42 @@ extern tBTM_BLE_5_HCI_CBACK ble_5_hci_cb;
|
|||||||
|
|
||||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#define BTA_BLE_ISO_BIG_CREATE_COMPLETE_EVT BTM_BLE_ISO_BIG_CREATE_COMPLETE_EVT
|
||||||
|
#define BTA_BLE_ISO_BIG_TERMINATE_COMPLETE_EVT BTM_BLE_ISO_BIG_TERMINATE_COMPLETE_EVT
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#define BTA_BLE_ISO_BIG_SYNC_ESTABLISHED_EVT BTM_BLE_ISO_BIG_SYNC_ESTABLISHED_EVT
|
||||||
|
#define BTA_BLE_ISO_BIG_SYNC_LOST_EVT BTM_BLE_ISO_BIG_SYNC_LOST_EVT
|
||||||
|
#define BTA_BLE_ISO_BIG_SYNC_TERMINATE_COMPLETE_EVT BTM_BLE_ISO_BIG_SYNC_TERMINATE_COMPLETE_EVT
|
||||||
|
#define BTA_BLE_ISO_BIGINFO_ADV_REPORT_EVT BTM_BLE_ISO_BIGINFO_ADV_REPORT_EVT
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#define BTA_BLE_ISO_DATA_PATH_UPFATE_EVT BTM_BLE_ISO_DATA_PATH_UPFATE_EVT
|
||||||
|
#define BTA_BLE_ISO_SET_HOST_FEATURE_EVT BTM_BLE_ISO_SET_HOST_FEATURE_EVT
|
||||||
|
#define BTA_BLE_ISO_READ_TX_SYNC_EVT BTM_BLE_ISO_READ_TX_SYNC_EVT
|
||||||
|
#define BTA_BLE_ISO_READ_LINK_QUALITY_EVT BTM_BLE_ISO_READ_LINK_QUALITY_EVT
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#define BTA_BLE_ISO_SET_CIG_PARAMS_EVT BTM_BLE_ISO_SET_CIG_PARAMS_EVT
|
||||||
|
#define BTA_BLE_ISO_CREATE_CIS_EVT BTM_BLE_ISO_CREATE_CIS_EVT
|
||||||
|
#define BTA_BLE_ISO_REMOVE_CIG_EVT BTM_BLE_ISO_REMOVE_CIG_EVT
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#define BTA_BLE_ISO_ACCEPT_CIS_REQ_EVT BTM_BLE_ISO_ACCEPT_CIS_REQ_EVT
|
||||||
|
#define BTA_BLE_ISO_REJECT_CIS_REQ_EVT BTM_BLE_ISO_REJECT_CIS_REQ_EVT
|
||||||
|
#define BTA_BLE_ISO_CIS_REQUEST_EVT BTM_BLE_ISO_CIS_REQUEST_EVT
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
#define BTA_BLE_ISO_CIS_ESTABLISHED_EVT BTM_BLE_ISO_CIS_ESTABLISHED_EVT
|
||||||
|
#define BTA_BLE_ISO_CIS_DISCONNECTED_EVT BTM_BLE_ISO_CIS_DISCONNECTED_EVT
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
#define BTA_DM_BLE_ISO_UNKNOWN_EVT BTM_BLE_ISO_UNKNOWN_EVT
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
|
|
||||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT8 mode;
|
UINT8 mode;
|
||||||
@ -1698,6 +1734,77 @@ typedef struct {
|
|||||||
} tBTA_DM_BLE_PAST_PARAMS;
|
} tBTA_DM_BLE_PAST_PARAMS;
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
UINT8 big_handle;
|
||||||
|
UINT8 adv_handle;
|
||||||
|
UINT8 num_bis;
|
||||||
|
UINT32 sdu_interval;
|
||||||
|
UINT16 max_sdu;
|
||||||
|
UINT16 max_transport_latency;
|
||||||
|
UINT8 rtn;
|
||||||
|
UINT8 phy;
|
||||||
|
UINT8 packing;
|
||||||
|
UINT8 framing;
|
||||||
|
UINT8 encryption;
|
||||||
|
UINT8 broadcast_code[16];
|
||||||
|
} tBTA_DM_BLE_BIG_CREATE_PARAMS;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT8 big_handle;
|
||||||
|
UINT8 adv_handle;
|
||||||
|
UINT8 num_bis;
|
||||||
|
UINT32 sdu_interval;
|
||||||
|
UINT16 iso_interval;
|
||||||
|
UINT8 nse;
|
||||||
|
UINT16 max_sdu;
|
||||||
|
UINT16 max_pdu;
|
||||||
|
UINT8 phy;
|
||||||
|
UINT8 packing;
|
||||||
|
UINT8 framing;
|
||||||
|
UINT8 bn;
|
||||||
|
UINT8 irc;
|
||||||
|
UINT8 pto;
|
||||||
|
UINT8 encryption;
|
||||||
|
UINT8 broadcast_code[16];
|
||||||
|
} tBTA_DM_BLE_BIG_CREATE_TEST_PARAMS;
|
||||||
|
typedef struct {
|
||||||
|
UINT8 big_handle;
|
||||||
|
UINT8 reason;
|
||||||
|
} tBTA_DM_BLE_BIG_TERMINATE_PARAMS;
|
||||||
|
typedef struct {
|
||||||
|
UINT8 big_handle;
|
||||||
|
UINT16 sync_handle;
|
||||||
|
UINT8 encryption;
|
||||||
|
UINT8 bc_code[16];
|
||||||
|
UINT8 mse;
|
||||||
|
UINT16 big_sync_timeout;
|
||||||
|
UINT8 num_bis;
|
||||||
|
UINT8 bis[BLE_ISO_BIS_MAX_COUNT];
|
||||||
|
} tBTA_DM_BLE_BIG_SYNC_CREATE_PARAMS;
|
||||||
|
typedef struct {
|
||||||
|
UINT8 big_handle;
|
||||||
|
} tBTA_DM_BLE_BIG_SYNC_TERMINATE_PARAMS;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16_t conn_handle;
|
||||||
|
uint8_t data_path_dir;
|
||||||
|
uint8_t data_path_id;
|
||||||
|
uint8_t coding_fmt;
|
||||||
|
uint16_t company_id;
|
||||||
|
uint16_t vs_codec_id;
|
||||||
|
uint32_t controller_delay;
|
||||||
|
uint8_t codec_len;
|
||||||
|
uint8_t *codec_cfg;
|
||||||
|
} tBTA_DM_BLE_ISO_SET_DATA_PATH_PARAMS;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16_t conn_handle;
|
||||||
|
uint8_t data_path_dir;
|
||||||
|
} tBTA_DM_BLE_ISO_REMOVE_DATA_PATH_PARAMS;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
** External Function Declarations
|
** External Function Declarations
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
@ -3200,6 +3307,36 @@ extern void BTA_DmBleGapPeriodicAdvSetInfoTrans(BD_ADDR peer_addr, UINT16 servic
|
|||||||
extern void BTA_DmBleGapSetPeriodicAdvSyncTransParams(BD_ADDR peer_addr, tBTA_DM_BLE_PAST_PARAMS *params);
|
extern void BTA_DmBleGapSetPeriodicAdvSyncTransParams(BD_ADDR peer_addr, tBTA_DM_BLE_PAST_PARAMS *params);
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
extern void BTA_DmBleGapIsoBigCreate(tBTA_DM_BLE_BIG_CREATE_PARAMS *p_big_creat_param);
|
||||||
|
extern void BTA_DmBleGapIsoBigCreateTest(tBTA_DM_BLE_BIG_CREATE_TEST_PARAMS *p_big_creat_test_param);
|
||||||
|
extern void BTA_DmBleGapIsoBigTerminate(tBTA_DM_BLE_BIG_TERMINATE_PARAMS *p_big_terminate_param);
|
||||||
|
#endif// #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
extern void BTA_DmBleGapIsoBigSyncCreate(tBTA_DM_BLE_BIG_SYNC_CREATE_PARAMS *p_big_sync_param);
|
||||||
|
extern void BTA_DmBleGapIsoBigSyncTerminate(tBTA_DM_BLE_BIG_SYNC_TERMINATE_PARAMS *p_big_sync_terminate_param);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
extern void BTA_DmBleGapIsoDataPathSet(tBTA_DM_BLE_ISO_SET_DATA_PATH_PARAMS *p_iso_data_path_param);
|
||||||
|
extern void BTA_DmBleGapIsoDataPathRemove(tBTA_DM_BLE_ISO_REMOVE_DATA_PATH_PARAMS *p_iso_data_path_param);
|
||||||
|
extern void BTA_DmBleGapIsoSetHostFeature(uint16_t bit_num, uint8_t bit_val);
|
||||||
|
extern void BTA_DmBleGapIsoReadTxSync(uint16_t iso_handle);
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
extern void BTA_DmBleIsoSetCigParams(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t worse_case_SCA, uint8_t packing,
|
||||||
|
uint8_t framing, uint16_t mtl_c_to_p, uint16_t mtl_p_to_c, uint8_t cis_cnt, uint8_t *cis_params);
|
||||||
|
void BTA_DmBleIsoSetCigParamsTest(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t ft_c_to_p, uint8_t ft_p_to_c,
|
||||||
|
uint16_t iso_interval, uint8_t worse_case_SCA, uint8_t packing, uint8_t framing, uint8_t cis_cnt, uint8_t *cis_params_test);
|
||||||
|
extern void BTA_DmBleIsoCreateCis(uint8_t cig_count, uint8_t *cis_hdl_info);
|
||||||
|
extern void BTA_DmBleIsoRemoveCig(uint8_t cig_id);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
extern void BTA_DmBleIsoAcceptCisReq(uint16_t cis_handle);
|
||||||
|
extern void BTA_DmBleIsoRejectCisReq(uint16_t cis_handle, uint8_t reason);
|
||||||
|
#endif // BLE_FEAT_ISO_CIG_PERIPHERAL_EN
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
extern void BTA_DmBleIsoDisconCis(uint16_t cis_handle, uint8_t reason);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
#endif // if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -0,0 +1,228 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __BTC_ISO_BLE_H__
|
||||||
|
#define __BTC_ISO_BLE_H__
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#include "esp_bt_defs.h"
|
||||||
|
#include "esp_ble_iso_api.h"
|
||||||
|
#include "btc/btc_manage.h"
|
||||||
|
|
||||||
|
struct btc_iso_cis_params {
|
||||||
|
uint8_t cis_id;
|
||||||
|
uint16_t max_sdu_c_to_p;
|
||||||
|
uint16_t max_sdu_p_to_c;
|
||||||
|
uint8_t phy_c_to_p;
|
||||||
|
uint8_t phy_p_to_c;
|
||||||
|
uint8_t rtn_c_to_p;
|
||||||
|
uint8_t rtn_p_to_c;
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
struct btc_iso_cis_params_test {
|
||||||
|
uint8_t cis_id;
|
||||||
|
uint8_t nse;
|
||||||
|
uint16_t max_sdu_c_to_p;
|
||||||
|
uint16_t max_sdu_p_to_c;
|
||||||
|
uint16_t max_pdu_c_to_p;
|
||||||
|
uint16_t max_pdu_p_to_c;
|
||||||
|
uint8_t phy_c_to_p;
|
||||||
|
uint8_t phy_p_to_c;
|
||||||
|
uint8_t bn_c_to_p;
|
||||||
|
uint8_t bn_p_to_c;
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
struct btc_iso_cis_hdls {
|
||||||
|
uint16_t cis_hdl;
|
||||||
|
uint16_t acl_hdl;
|
||||||
|
}__attribute__((packed));
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
BTC_ISO_ACT_BIG_CREATE,
|
||||||
|
BTC_ISO_ACT_BIG_CREATE_TEST,
|
||||||
|
BTC_ISO_ACT_BIG_TERMINATE,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
BTC_ISO_ACT_BIG_SYNC_CREATE,
|
||||||
|
BTC_ISO_ACT_BIG_SYNC_TERMINATE,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
BTC_ISO_ACT_SET_DATA_PATH,
|
||||||
|
BTC_ISO_ACT_REMOVE_DATA_PATH,
|
||||||
|
BTC_ISO_ACT_SET_HOST_FEATURE,
|
||||||
|
BTC_ISO_ACT_READ_ISO_TX_SYNC,
|
||||||
|
BTC_ISO_ACT_READ_ISO_LINK_QUALITY,
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
BTC_ISO_ACT_SET_CIG_PARAMS,
|
||||||
|
BTC_ISO_ACT_SET_CIG_PARAMS_TEST,
|
||||||
|
BTC_ISO_ACT_CREATE_CIS,
|
||||||
|
BTC_ISO_ACT_REMOVE_CIG,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
BTC_ISO_ACT_ACCEPT_CIS_REQ,
|
||||||
|
BTC_ISO_ACT_REJECT_CIS_REQ,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
BTC_ISO_ACT_DISCON_CIS,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
} btc_iso_ble_act_t;
|
||||||
|
|
||||||
|
/* btc_ble_iso_args_t */
|
||||||
|
typedef union {
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
struct iso_big_create_args {
|
||||||
|
uint8_t big_handle;
|
||||||
|
uint8_t adv_handle;
|
||||||
|
uint8_t num_bis;
|
||||||
|
uint32_t sdu_interval;
|
||||||
|
uint16_t max_sdu;
|
||||||
|
uint16_t max_transport_latency;
|
||||||
|
uint8_t rtn;
|
||||||
|
uint8_t phy;
|
||||||
|
uint8_t packing;
|
||||||
|
uint8_t framing;
|
||||||
|
uint8_t encryption;
|
||||||
|
uint8_t broadcast_code[16];
|
||||||
|
} iso_big_creat_params;
|
||||||
|
|
||||||
|
struct iso_big_create_test_args {
|
||||||
|
uint8_t big_handle;
|
||||||
|
uint8_t adv_handle;
|
||||||
|
uint8_t num_bis;
|
||||||
|
uint32_t sdu_interval;
|
||||||
|
uint16_t iso_interval;
|
||||||
|
uint8_t nse;
|
||||||
|
uint16_t max_sdu;
|
||||||
|
uint16_t max_pdu;
|
||||||
|
uint8_t phy;
|
||||||
|
uint8_t packing;
|
||||||
|
uint8_t framing;
|
||||||
|
uint8_t bn;
|
||||||
|
uint8_t irc;
|
||||||
|
uint8_t pto;
|
||||||
|
uint8_t encryption;
|
||||||
|
uint8_t broadcast_code[16];
|
||||||
|
} iso_big_creat_test_params;
|
||||||
|
|
||||||
|
struct iso_big_terminate_args {
|
||||||
|
uint8_t big_handle;
|
||||||
|
uint8_t reason;
|
||||||
|
} iso_big_terminate_params;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
struct iso_big_sync_creat_arg {
|
||||||
|
uint8_t big_handle;
|
||||||
|
uint16_t sync_handle;
|
||||||
|
uint8_t encryption;
|
||||||
|
uint8_t bc_code[16];
|
||||||
|
uint8_t mse;
|
||||||
|
uint16_t big_sync_timeout;
|
||||||
|
uint8_t num_bis;
|
||||||
|
uint8_t bis[BLE_ISO_BIS_MAX_COUNT];
|
||||||
|
} iso_big_sync_creat_params;
|
||||||
|
|
||||||
|
struct iso_big_sync_terminate_arg {
|
||||||
|
uint8_t big_handle;
|
||||||
|
} iso_big_sync_terminate_params;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
struct iso_set_data_path_arg {
|
||||||
|
uint16_t conn_handle;
|
||||||
|
uint8_t data_path_dir;
|
||||||
|
uint8_t data_path_id;
|
||||||
|
uint8_t coding_fmt;
|
||||||
|
uint16_t company_id;
|
||||||
|
uint16_t vs_codec_id;
|
||||||
|
uint32_t controller_delay;
|
||||||
|
uint8_t codec_cfg_len;
|
||||||
|
uint8_t *codec_cfg;
|
||||||
|
} iso_set_data_path_params;
|
||||||
|
|
||||||
|
struct iso_remove_data_path_arg {
|
||||||
|
uint16_t conn_handle;
|
||||||
|
uint8_t data_path_dir;
|
||||||
|
} iso_remove_data_path_params;
|
||||||
|
|
||||||
|
struct iso_set_host_feature_arg {
|
||||||
|
uint16_t bit_num;
|
||||||
|
uint8_t bit_val;
|
||||||
|
} iso_set_host_feature_params;
|
||||||
|
|
||||||
|
struct iso_read_tx_sync_arg {
|
||||||
|
uint16_t iso_handle;
|
||||||
|
} iso_read_tx_sync_params;
|
||||||
|
|
||||||
|
struct iso_read_link_quality_arg {
|
||||||
|
uint16_t iso_handle;
|
||||||
|
} iso_read_link_quality_params;
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
struct set_cig_params_arg {
|
||||||
|
uint8_t cig_id;
|
||||||
|
uint32_t sdu_int_c_to_p;
|
||||||
|
uint32_t sdu_int_p_to_c;
|
||||||
|
uint8_t worse_case_SCA;
|
||||||
|
uint8_t packing;
|
||||||
|
uint8_t framing;
|
||||||
|
uint16_t mtl_c_to_p;
|
||||||
|
uint16_t mtl_p_to_c;
|
||||||
|
uint8_t cis_cnt;
|
||||||
|
struct btc_iso_cis_params cis_params[BLE_ISO_CIS_MAX_COUNT];
|
||||||
|
} set_cig_params;
|
||||||
|
|
||||||
|
struct set_cig_params_test_arg {
|
||||||
|
uint8_t cig_id;
|
||||||
|
uint32_t sdu_int_c_to_p;
|
||||||
|
uint32_t sdu_int_p_to_c;
|
||||||
|
uint8_t ft_c_to_p;
|
||||||
|
uint8_t ft_p_to_c;
|
||||||
|
uint16_t iso_interval;
|
||||||
|
uint8_t worse_case_SCA;
|
||||||
|
uint8_t packing;
|
||||||
|
uint8_t framing;
|
||||||
|
uint8_t cis_cnt;
|
||||||
|
struct btc_iso_cis_params_test cis_params_test[ESP_BLE_MAX_CIS_NUM];
|
||||||
|
} set_cig_params_test;
|
||||||
|
|
||||||
|
struct creat_cis_arg {
|
||||||
|
uint8_t cis_count;
|
||||||
|
struct btc_iso_cis_hdls cis_hdls[BLE_ISO_CIS_MAX_COUNT];
|
||||||
|
} creat_cis_params;
|
||||||
|
struct remove_cig_arg {
|
||||||
|
uint8_t cig_id;
|
||||||
|
} remove_cig_params;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
struct accept_cis_req_arg {
|
||||||
|
uint16_t cis_handle;
|
||||||
|
} accept_cis_req_params;
|
||||||
|
|
||||||
|
struct reject_cis_req_arg {
|
||||||
|
uint16_t cis_handle;
|
||||||
|
uint8_t reason;
|
||||||
|
} reject_cis_req_params;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
struct discon_cis_arg {
|
||||||
|
uint16_t cis_handle;
|
||||||
|
uint8_t reason;
|
||||||
|
} discon_cis_params;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
} btc_ble_iso_args_t;
|
||||||
|
|
||||||
|
void btc_iso_ble_call_handler(btc_msg_t *msg);
|
||||||
|
void btc_iso_ble_cb_handler(btc_msg_t *msg);
|
||||||
|
void btc_iso_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
|
||||||
|
void btc_iso_ble_arg_deep_free(btc_msg_t *msg);
|
||||||
|
void btc_iso_ble_cb_deep_free(btc_msg_t *msg);
|
||||||
|
void btc_iso_ble_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
|
||||||
|
void btc_iso_callback_init(void);
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
|
#endif /* __BTC_ISO_BLE_H__ */
|
391
components/bt/host/bluedroid/btc/profile/std/iso/btc_iso_ble.c
Normal file
391
components/bt/host/bluedroid/btc/profile/std/iso/btc_iso_ble.c
Normal file
@ -0,0 +1,391 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "osi/allocator.h"
|
||||||
|
|
||||||
|
#include "bta/bta_api.h"
|
||||||
|
#include "bta/bta_dm_co.h"
|
||||||
|
#include "btc/btc_task.h"
|
||||||
|
#include "btc/btc_util.h"
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#include "btc_iso_ble.h"
|
||||||
|
#include "esp_ble_iso_api.h"
|
||||||
|
|
||||||
|
static inline void btc_iso_ble_cb_to_app(esp_ble_iso_cb_event_t event, esp_ble_iso_cb_param_t *param)
|
||||||
|
{
|
||||||
|
esp_ble_iso_cb_t btc_iso_ble_cb = (esp_ble_iso_cb_t)btc_profile_cb_get(BTC_PID_ISO_BLE);
|
||||||
|
if (btc_iso_ble_cb) {
|
||||||
|
btc_iso_ble_cb(event, param);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void btc_ble_iso_callback(tBTM_BLE_ISO_EVENT event,
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS *params)
|
||||||
|
{
|
||||||
|
esp_ble_iso_cb_param_t param;
|
||||||
|
bt_status_t ret;
|
||||||
|
btc_msg_t msg;
|
||||||
|
msg.sig = BTC_SIG_API_CB;
|
||||||
|
msg.pid = BTC_PID_ISO_BLE;
|
||||||
|
|
||||||
|
switch(event) {
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
case BTA_BLE_ISO_BIG_CREATE_COMPLETE_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_BIG_CREATE_CMPL_EVT;
|
||||||
|
param.create_big_cmpl.status = btc_btm_status_to_esp_status(params->btm_big_cmpl.status);
|
||||||
|
param.create_big_cmpl.big_handle = params->btm_big_cmpl.big_handle;
|
||||||
|
param.create_big_cmpl.big_sync_delay = params->btm_big_cmpl.big_sync_delay;
|
||||||
|
param.create_big_cmpl.transport_latency = params->btm_big_cmpl.transport_latency;
|
||||||
|
param.create_big_cmpl.phy = params->btm_big_cmpl.phy;
|
||||||
|
param.create_big_cmpl.nse = params->btm_big_cmpl.nse;
|
||||||
|
param.create_big_cmpl.bn = params->btm_big_cmpl.bn;
|
||||||
|
param.create_big_cmpl.pto = params->btm_big_cmpl.pto;
|
||||||
|
param.create_big_cmpl.irc = params->btm_big_cmpl.irc;
|
||||||
|
param.create_big_cmpl.max_pdu = params->btm_big_cmpl.max_pdu;
|
||||||
|
param.create_big_cmpl.iso_interval = params->btm_big_cmpl.iso_interval;
|
||||||
|
param.create_big_cmpl.num_bis = params->btm_big_cmpl.num_bis;
|
||||||
|
for (uint8_t i = 0; i < params->btm_big_cmpl.num_bis; i++)
|
||||||
|
{
|
||||||
|
param.create_big_cmpl.bis_handle[i] = params->btm_big_cmpl.bis_handle[i];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_BIG_TERMINATE_COMPLETE_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_BIG_TERMINATE_CMPL_EVT;
|
||||||
|
param.term_big_cmpl.status = btc_btm_status_to_esp_status(params->btm_big_term.status);
|
||||||
|
param.term_big_cmpl.big_handle = params->btm_big_term.big_handle;
|
||||||
|
param.term_big_cmpl.reason = params->btm_big_term.reason;
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
case BTA_BLE_ISO_BIG_SYNC_ESTABLISHED_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_BIG_SYNC_ESTABLISHED_EVT;
|
||||||
|
param.big_sync_estab.status = btc_btm_status_to_esp_status(params->btm_big_sync_estab.status);
|
||||||
|
param.big_sync_estab.big_handle = params->btm_big_sync_estab.big_handle;
|
||||||
|
param.big_sync_estab.transport_latency = params->btm_big_sync_estab.transport_latency_big;
|
||||||
|
param.big_sync_estab.nse = params->btm_big_sync_estab.nse;
|
||||||
|
param.big_sync_estab.bn = params->btm_big_sync_estab.bn;
|
||||||
|
param.big_sync_estab.pto = params->btm_big_sync_estab.pto;
|
||||||
|
param.big_sync_estab.irc = params->btm_big_sync_estab.irc;
|
||||||
|
param.big_sync_estab.max_pdu = params->btm_big_sync_estab.max_pdu;
|
||||||
|
param.big_sync_estab.iso_interval = params->btm_big_sync_estab.iso_interval;
|
||||||
|
param.big_sync_estab.num_bis = params->btm_big_sync_estab.num_bis;
|
||||||
|
for (uint8_t i = 0; i < params->btm_big_sync_estab.num_bis; i++)
|
||||||
|
{
|
||||||
|
param.big_sync_estab.bis_handle[i] = params->btm_big_sync_estab.bis_handle[i];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_BIG_SYNC_LOST_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_BIG_SYNC_LOST_EVT;
|
||||||
|
param.big_sync_lost.big_handle = params->btm_big_sync_lost.big_handle;
|
||||||
|
param.big_sync_lost.reason = params->btm_big_sync_lost.reason;
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_BIG_SYNC_TERMINATE_COMPLETE_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_BIG_SYNC_TERMINATE_CMPL_EVT;
|
||||||
|
param.term_big_sync.status = btc_btm_status_to_esp_status(params->btm_big_sync_ter.status);
|
||||||
|
param.term_big_sync.big_handle = params->btm_big_sync_ter.big_hdl;
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_BIGINFO_ADV_REPORT_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_BIGINFO_ADV_REPORT_EVT;
|
||||||
|
param.biginfo_report.sync_handle = params->btm_biginfo_report.sync_handle;
|
||||||
|
param.biginfo_report.num_bis = params->btm_biginfo_report.num_bis;
|
||||||
|
param.biginfo_report.nse = params->btm_biginfo_report.nse;
|
||||||
|
param.biginfo_report.iso_interval = params->btm_biginfo_report.iso_interval;
|
||||||
|
param.biginfo_report.bn = params->btm_biginfo_report.bn;
|
||||||
|
param.biginfo_report.pto = params->btm_biginfo_report.pto;
|
||||||
|
param.biginfo_report.irc = params->btm_biginfo_report.irc;
|
||||||
|
param.biginfo_report.max_pdu = params->btm_biginfo_report.max_pdu;
|
||||||
|
param.biginfo_report.sdu_interval = params->btm_biginfo_report.sdu_interval;
|
||||||
|
param.biginfo_report.max_sdu = params->btm_biginfo_report.max_sdu;
|
||||||
|
param.biginfo_report.phy = params->btm_biginfo_report.phy;
|
||||||
|
param.biginfo_report.framing = params->btm_biginfo_report.framing;
|
||||||
|
param.biginfo_report.encryption = params->btm_biginfo_report.encryption;
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
case BTA_BLE_ISO_DATA_PATH_UPFATE_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_ISO_DATA_PATH_UPDATE_EVT;
|
||||||
|
param.data_path.op_type = params->btm_data_path_update.op_type;
|
||||||
|
param.data_path.status = btc_btm_status_to_esp_status(params->btm_data_path_update.status);
|
||||||
|
param.data_path.iso_hdl = params->btm_data_path_update.conn_hdl;
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_SET_HOST_FEATURE_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_SET_HOST_FEATURE_CMPL_EVT;
|
||||||
|
param.host_feature.status = btc_btm_status_to_esp_status(params->status);
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_READ_TX_SYNC_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_READ_ISO_TX_SYNC_CMPL_EVT;
|
||||||
|
param.read_tx_sync.status = btc_btm_status_to_esp_status(params->btm_read_tx_sync.status);
|
||||||
|
param.read_tx_sync.iso_hdl = params->btm_read_tx_sync.conn_hdl;
|
||||||
|
param.read_tx_sync.pkt_seq_num = params->btm_read_tx_sync.pkt_seq_num;
|
||||||
|
param.read_tx_sync.tx_time_stamp = params->btm_read_tx_sync.tx_time_stamp;
|
||||||
|
param.read_tx_sync.time_offset = params->btm_read_tx_sync.time_offset;
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_READ_LINK_QUALITY_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_READ_LINK_QUALITY_CMPL_EVT;
|
||||||
|
param.read_link_quality.status = btc_btm_status_to_esp_status(params->btm_read_link_quality.status);
|
||||||
|
param.read_link_quality.iso_hdl = params->btm_read_link_quality.conn_hdl;
|
||||||
|
param.read_link_quality.tx_unacked_pkts = params->btm_read_link_quality.tx_unacked_pkts;
|
||||||
|
param.read_link_quality.tx_flushed_pkts = params->btm_read_link_quality.tx_flushed_pkts;
|
||||||
|
param.read_link_quality.tx_last_subevt_pkts = params->btm_read_link_quality.tx_last_subevt_pkts;
|
||||||
|
param.read_link_quality.retransmitted_pkts = params->btm_read_link_quality.retransmitted_pkts;
|
||||||
|
param.read_link_quality.crc_error_pkts = params->btm_read_link_quality.crc_error_pkts;
|
||||||
|
param.read_link_quality.rx_unreceived_pkts = params->btm_read_link_quality.rx_unreceived_pkts;
|
||||||
|
param.read_link_quality.duplicate_pkts = params->btm_read_link_quality.duplicate_pkts;
|
||||||
|
break;
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
case BTA_BLE_ISO_CIS_ESTABLISHED_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_CIS_ESTABLISHED_EVT;
|
||||||
|
param.cis_estab.status = btc_btm_status_to_esp_status(params->btm_cis_established_evt.status);
|
||||||
|
param.cis_estab.cis_handle = params->btm_cis_established_evt.conn_handle;
|
||||||
|
param.cis_estab.cig_sync_delay = params->btm_cis_established_evt.cig_sync_delay;
|
||||||
|
param.cis_estab.cis_sync_delay = params->btm_cis_established_evt.cis_sync_delay;
|
||||||
|
param.cis_estab.trans_lat_c_to_p = params->btm_cis_established_evt.trans_lat_c_to_p;
|
||||||
|
param.cis_estab.trans_lat_p_to_c = params->btm_cis_established_evt.trans_lat_p_to_c;
|
||||||
|
param.cis_estab.phy_c_to_p = params->btm_cis_established_evt.phy_c_to_p;
|
||||||
|
param.cis_estab.phy_p_to_c = params->btm_cis_established_evt.phy_p_to_c;
|
||||||
|
param.cis_estab.nse = params->btm_cis_established_evt.nse;
|
||||||
|
param.cis_estab.bn_c_to_p = params->btm_cis_established_evt.bn_c_to_p;
|
||||||
|
param.cis_estab.bn_p_to_c = params->btm_cis_established_evt.bn_p_to_c;
|
||||||
|
param.cis_estab.ft_c_to_p = params->btm_cis_established_evt.ft_c_to_p;
|
||||||
|
param.cis_estab.ft_p_to_c = params->btm_cis_established_evt.ft_p_to_c;
|
||||||
|
param.cis_estab.max_pdu_c_to_p = params->btm_cis_established_evt.max_pdu_c_to_p;
|
||||||
|
param.cis_estab.max_pdu_p_to_c = params->btm_cis_established_evt.max_pdu_p_to_c;
|
||||||
|
param.cis_estab.iso_interval = params->btm_cis_established_evt.iso_interval;
|
||||||
|
#if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
param.cis_estab.sub_interval = params->btm_cis_established_evt.sub_interval;
|
||||||
|
param.cis_estab.max_sdu_c_to_p = params->btm_cis_established_evt.max_sdu_c_to_p;
|
||||||
|
param.cis_estab.max_sdu_p_to_c = params->btm_cis_established_evt.max_sdu_p_to_c;
|
||||||
|
param.cis_estab.sdu_int_c_to_p = params->btm_cis_established_evt.sdu_int_c_to_p;
|
||||||
|
param.cis_estab.sdu_int_p_to_c = params->btm_cis_established_evt.sdu_int_p_to_c;
|
||||||
|
param.cis_estab.framing = params->btm_cis_established_evt.framing;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_CIS_DISCONNECTED_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_CIS_DISCONNECTED_EVT;
|
||||||
|
param.cis_disconnected.cis_handle = params->btm_cis_disconnectd_evt.cis_handle;
|
||||||
|
param.cis_disconnected.reason = params->btm_cis_disconnectd_evt.reason;
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
case BTM_BLE_ISO_CIS_REQUEST_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_CIS_REQUEST_EVT;
|
||||||
|
param.cis_request.acl_handle = params->btm_cis_request_evt.acl_handle;
|
||||||
|
param.cis_request.cis_handle = params->btm_cis_request_evt.cis_handle;
|
||||||
|
param.cis_request.cig_id = params->btm_cis_request_evt.cig_id;
|
||||||
|
param.cis_request.cis_id = params->btm_cis_request_evt.cis_id;
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
case BTA_BLE_ISO_SET_CIG_PARAMS_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_SET_CIG_PARAMS_CMPL_EVT;
|
||||||
|
param.set_cig_params.status = btc_btm_status_to_esp_status(params->btm_set_cig_params.status);
|
||||||
|
param.set_cig_params.cig_id = params->btm_set_cig_params.cig_id;
|
||||||
|
param.set_cig_params.cis_count = params->btm_set_cig_params.cis_count;
|
||||||
|
memcpy(¶m.set_cig_params.cis_hdl[0], ¶ms->btm_set_cig_params.conn_hdl[0], params->btm_set_cig_params.cis_count * 2);
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_CREATE_CIS_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_CREATE_CIS_CMPL_EVT;
|
||||||
|
param.create_cis.status = btc_btm_status_to_esp_status(params->status);
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_REMOVE_CIG_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_REMOVE_CIG_CMPL_EVT;
|
||||||
|
param.remove_cig.status = btc_btm_status_to_esp_status(params->btm_remove_cig.status);
|
||||||
|
param.remove_cig.cig_id = params->btm_remove_cig.cig_id;
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
case BTA_BLE_ISO_ACCEPT_CIS_REQ_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_ACCEPT_CIS_REQ_CMPL_EVT;
|
||||||
|
param.accept_req.status = btc_btm_status_to_esp_status(params->status);
|
||||||
|
break;
|
||||||
|
case BTA_BLE_ISO_REJECT_CIS_REQ_EVT:
|
||||||
|
msg.act = ESP_BLE_ISO_REJECT_CIS_REQ_CMPL_EVT;
|
||||||
|
param.reject_req.status = btc_btm_status_to_esp_status(params->btm_reject_cis_req.status);
|
||||||
|
param.reject_req.cis_handle = params->btm_reject_cis_req.cis_handle;
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = btc_transfer_context(&msg, ¶m,
|
||||||
|
sizeof(esp_ble_iso_cb_param_t), NULL, NULL);
|
||||||
|
|
||||||
|
if (ret != BT_STATUS_SUCCESS) {
|
||||||
|
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void btc_iso_ble_cb_handler(btc_msg_t *msg)
|
||||||
|
{
|
||||||
|
BTC_TRACE_DEBUG("%s act %d \n", __func__, msg->act);
|
||||||
|
esp_ble_iso_cb_param_t *param = (esp_ble_iso_cb_param_t *)msg->arg;
|
||||||
|
|
||||||
|
if (msg->act < ESP_BLE_ISO_EVT_MAX) {
|
||||||
|
btc_iso_ble_cb_to_app(msg->act, param);
|
||||||
|
} else {
|
||||||
|
BTC_TRACE_ERROR("%s, unknown msg->act = %d", __func__, msg->act);
|
||||||
|
}
|
||||||
|
|
||||||
|
btc_iso_ble_cb_deep_free(msg);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void btc_iso_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||||
|
{
|
||||||
|
btc_ble_iso_args_t *src = (btc_ble_iso_args_t *)p_src;
|
||||||
|
btc_ble_iso_args_t *dst = (btc_ble_iso_args_t *)p_dest;
|
||||||
|
|
||||||
|
switch (msg->act) {
|
||||||
|
case BTC_ISO_ACT_SET_DATA_PATH: {
|
||||||
|
if (src->iso_set_data_path_params.codec_cfg_len && src->iso_set_data_path_params.codec_cfg) {
|
||||||
|
dst->iso_set_data_path_params.codec_cfg = osi_malloc(src->iso_set_data_path_params.codec_cfg_len);
|
||||||
|
if (dst->iso_set_data_path_params.codec_cfg) {
|
||||||
|
memcpy(dst->iso_set_data_path_params.codec_cfg, src->iso_set_data_path_params.codec_cfg, src->iso_set_data_path_params.codec_cfg_len);
|
||||||
|
} else {
|
||||||
|
BTC_TRACE_ERROR("%s %d no mem\n",__func__, msg->act);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
BTC_TRACE_ERROR("Unhandled deep copy %d\n", msg->act);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void btc_iso_ble_cb_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||||
|
{
|
||||||
|
// esp_ble_iso_cb_param_t *src = (esp_ble_iso_cb_param_t *)p_src;
|
||||||
|
// esp_ble_iso_cb_param_t *dst = (esp_ble_iso_cb_param_t *) p_dest;
|
||||||
|
|
||||||
|
switch (msg->act) {
|
||||||
|
default:
|
||||||
|
BTC_TRACE_ERROR("%s, Unhandled deep copy %d\n", __func__, msg->act);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void btc_iso_ble_arg_deep_free(btc_msg_t *msg)
|
||||||
|
{
|
||||||
|
BTC_TRACE_DEBUG("%s \n", __func__);
|
||||||
|
switch (msg->act) {
|
||||||
|
|
||||||
|
case BTC_ISO_ACT_SET_DATA_PATH: {
|
||||||
|
uint8_t *p_codec_cfg = ((btc_ble_iso_args_t *)msg->arg)->iso_set_data_path_params.codec_cfg;
|
||||||
|
if (p_codec_cfg) {
|
||||||
|
osi_free(p_codec_cfg);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
BTC_TRACE_DEBUG("Unhandled deep free %d\n", msg->act);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void btc_iso_ble_cb_deep_free(btc_msg_t *msg)
|
||||||
|
{
|
||||||
|
BTC_TRACE_DEBUG("%s", __func__);
|
||||||
|
switch (msg->act) {
|
||||||
|
default:
|
||||||
|
BTC_TRACE_DEBUG("Unhandled deep free %d", msg->act);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void btc_iso_ble_call_handler(btc_msg_t *msg)
|
||||||
|
{
|
||||||
|
btc_ble_iso_args_t *arg = (btc_ble_iso_args_t *)msg->arg;
|
||||||
|
BTC_TRACE_DEBUG("%s act %d\n", __FUNCTION__, msg->act);
|
||||||
|
|
||||||
|
switch (msg->act) {
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
case BTC_ISO_ACT_BIG_CREATE:
|
||||||
|
BTA_DmBleGapIsoBigCreate((tBTA_DM_BLE_BIG_CREATE_PARAMS *)&arg->iso_big_creat_params);
|
||||||
|
break;
|
||||||
|
case BTC_ISO_ACT_BIG_CREATE_TEST:
|
||||||
|
BTA_DmBleGapIsoBigCreateTest((tBTA_DM_BLE_BIG_CREATE_TEST_PARAMS *)&arg->iso_big_creat_test_params);
|
||||||
|
break;
|
||||||
|
case BTC_ISO_ACT_BIG_TERMINATE:
|
||||||
|
BTA_DmBleGapIsoBigTerminate((tBTA_DM_BLE_BIG_TERMINATE_PARAMS *)&arg->iso_big_terminate_params);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
case BTC_ISO_ACT_BIG_SYNC_CREATE:
|
||||||
|
BTA_DmBleGapIsoBigSyncCreate((tBTA_DM_BLE_BIG_SYNC_CREATE_PARAMS *)&arg->iso_big_sync_creat_params);
|
||||||
|
break;
|
||||||
|
case BTC_ISO_ACT_BIG_SYNC_TERMINATE:
|
||||||
|
BTA_DmBleGapIsoBigSyncTerminate((tBTA_DM_BLE_BIG_SYNC_TERMINATE_PARAMS *)&arg->iso_big_sync_terminate_params);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
case BTC_ISO_ACT_SET_DATA_PATH:
|
||||||
|
BTA_DmBleGapIsoDataPathSet((tBTA_DM_BLE_ISO_SET_DATA_PATH_PARAMS *)&arg->iso_set_data_path_params);
|
||||||
|
break;
|
||||||
|
case BTC_ISO_ACT_REMOVE_DATA_PATH:
|
||||||
|
BTA_DmBleGapIsoDataPathRemove((tBTA_DM_BLE_ISO_REMOVE_DATA_PATH_PARAMS *)&arg->iso_remove_data_path_params);
|
||||||
|
break;
|
||||||
|
case BTC_ISO_ACT_SET_HOST_FEATURE:
|
||||||
|
BTA_DmBleGapIsoSetHostFeature(arg->iso_set_host_feature_params.bit_num, arg->iso_set_host_feature_params.bit_val);
|
||||||
|
break;
|
||||||
|
case BTC_ISO_ACT_READ_ISO_TX_SYNC:
|
||||||
|
BTA_DmBleGapIsoReadTxSync(arg->iso_read_tx_sync_params.iso_handle);
|
||||||
|
break;
|
||||||
|
case BTC_ISO_ACT_READ_ISO_LINK_QUALITY:
|
||||||
|
break;
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
case BTC_ISO_ACT_SET_CIG_PARAMS: {
|
||||||
|
struct set_cig_params_arg *set_cig_params = (struct set_cig_params_arg *)arg;
|
||||||
|
BTA_DmBleIsoSetCigParams(set_cig_params->cig_id, set_cig_params->sdu_int_c_to_p, set_cig_params->sdu_int_p_to_c,
|
||||||
|
set_cig_params->worse_case_SCA, set_cig_params->packing, set_cig_params->framing,
|
||||||
|
set_cig_params->mtl_c_to_p, set_cig_params->mtl_p_to_c, set_cig_params->cis_cnt,
|
||||||
|
(uint8_t *)&set_cig_params->cis_params[0]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BTC_ISO_ACT_SET_CIG_PARAMS_TEST:
|
||||||
|
struct set_cig_params_test_arg *set_cig_params_test = (struct set_cig_params_test_arg *)arg;
|
||||||
|
BTA_DmBleIsoSetCigParamsTest(set_cig_params_test->cig_id, set_cig_params_test->sdu_int_c_to_p, set_cig_params_test->sdu_int_p_to_c,
|
||||||
|
set_cig_params_test->ft_c_to_p, set_cig_params_test->ft_p_to_c, set_cig_params_test->iso_interval,
|
||||||
|
set_cig_params_test->worse_case_SCA, set_cig_params_test->packing, set_cig_params_test->framing,
|
||||||
|
set_cig_params_test->cis_cnt, (uint8_t *)&set_cig_params_test->cis_params_test[0]);
|
||||||
|
break;
|
||||||
|
case BTC_ISO_ACT_CREATE_CIS: {
|
||||||
|
struct creat_cis_arg * create_cis = (struct creat_cis_arg *)arg;
|
||||||
|
BTA_DmBleIsoCreateCis(create_cis->cis_count, (uint8_t *)&create_cis->cis_hdls[0]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BTC_ISO_ACT_REMOVE_CIG:
|
||||||
|
BTA_DmBleIsoRemoveCig(arg->remove_cig_params.cig_id);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
case BTC_ISO_ACT_ACCEPT_CIS_REQ:
|
||||||
|
BTA_DmBleIsoAcceptCisReq(arg->accept_cis_req_params.cis_handle);
|
||||||
|
break;
|
||||||
|
case BTC_ISO_ACT_REJECT_CIS_REQ:
|
||||||
|
BTA_DmBleIsoRejectCisReq(arg->reject_cis_req_params.cis_handle, arg->reject_cis_req_params.reason);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
case BTC_ISO_ACT_DISCON_CIS:
|
||||||
|
BTA_DmBleIsoDisconCis(arg->discon_cis_params.cis_handle, arg->discon_cis_params.reason);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
btc_iso_ble_arg_deep_free(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
//register connection parameter update callback
|
||||||
|
void btc_iso_callback_init(void)
|
||||||
|
{
|
||||||
|
BTM_BleIsoRegisterCallback(btc_ble_iso_callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif ///BLE_FEAT_ISO_EN == TRUE
|
@ -220,6 +220,62 @@
|
|||||||
#define UC_BT_BLE_FEAT_CREATE_SYNC_ENH FALSE
|
#define UC_BT_BLE_FEAT_CREATE_SYNC_ENH FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BT_BLE_FEAT_ISO_EN
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_EN CONFIG_BT_BLE_FEAT_ISO_EN
|
||||||
|
#else
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_EN FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if CONFIG_BT_BLE_FEAT_ISO_60_EN
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_60_EN CONFIG_BT_BLE_FEAT_ISO_60_EN
|
||||||
|
#else
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_60_EN FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BT_BLE_FEAT_ISO_BIG_SYNCER
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_BIG_SYNCER CONFIG_BT_BLE_FEAT_ISO_BIG_SYNCER
|
||||||
|
#else
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_BIG_SYNCER FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BT_BLE_FEAT_ISO_BIG_BROCASTER
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_BIG_BROCASTER CONFIG_BT_BLE_FEAT_ISO_BIG_BROCASTER
|
||||||
|
#else
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_BIG_BROCASTER FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BT_BLE_FEAT_ISO_CIG_CENTRAL
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_CIG_CENTRAL CONFIG_BT_BLE_FEAT_ISO_CIG_CENTRAL
|
||||||
|
#else
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_CIG_CENTRAL FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BT_BLE_FEAT_ISO_CIG_PERIPHERAL
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_CIG_PERIPHERAL CONFIG_BT_BLE_FEAT_ISO_CIG_PERIPHERAL
|
||||||
|
#else
|
||||||
|
#define UC_BT_BLE_FEAT_ISO_CIG_PERIPHERAL FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BT_BLE_ISO_CIS_MAX_COUNT
|
||||||
|
#define UC_BT_BLE_ISO_CIS_MAX_COUNT CONFIG_BT_BLE_ISO_CIS_MAX_COUNT
|
||||||
|
#else
|
||||||
|
#define UC_BT_BLE_ISO_CIS_MAX_COUNT (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BT_BLE_ISO_BIS_MAX_COUNT
|
||||||
|
#define UC_BT_BLE_ISO_BIS_MAX_COUNT CONFIG_BT_BLE_ISO_BIS_MAX_COUNT
|
||||||
|
#else
|
||||||
|
#define UC_BT_BLE_ISO_BIS_MAX_COUNT (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BT_BLE_ISO_STD_FLOW_CTRL
|
||||||
|
#define UC_BT_BLE_ISO_STD_FLOW_CTRL CONFIG_BT_BLE_ISO_STD_FLOW_CTRL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BT_BLE_ISO_NON_STD_FLOW_CTRL
|
||||||
|
#define UC_BT_BLE_ISO_NON_STD_FLOW_CTRL CONFIG_BT_BLE_ISO_NON_STD_FLOW_CTRL
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
#ifdef CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||||
#define UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
#define UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
|
||||||
#else
|
#else
|
||||||
|
@ -281,6 +281,72 @@
|
|||||||
#define BLE_FEAT_CREATE_SYNC_ENH FALSE
|
#define BLE_FEAT_CREATE_SYNC_ENH FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (UC_BT_BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#define BLE_FEAT_ISO_EN TRUE
|
||||||
|
#else
|
||||||
|
#define BLE_FEAT_ISO_EN FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (UC_BT_BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
#define BLE_FEAT_ISO_60_EN TRUE
|
||||||
|
#else
|
||||||
|
#define BLE_FEAT_ISO_60_EN FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (UC_BT_BLE_FEAT_ISO_BIG_BROCASTER == TRUE)
|
||||||
|
#define BLE_FEAT_ISO_BIG_BROCASTER_EN TRUE
|
||||||
|
#else
|
||||||
|
#define BLE_FEAT_ISO_BIG_BROCASTER_EN FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (UC_BT_BLE_FEAT_ISO_BIG_SYNCER == TRUE)
|
||||||
|
#define BLE_FEAT_ISO_BIG_SYNCER_EN TRUE
|
||||||
|
#else
|
||||||
|
#define BLE_FEAT_ISO_BIG_SYNCER_EN FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (UC_BT_BLE_FEAT_ISO_CIG_CENTRAL == TRUE)
|
||||||
|
#define BLE_FEAT_ISO_CIG_CENTRAL_EN TRUE
|
||||||
|
#else
|
||||||
|
#define BLE_FEAT_ISO_CIG_CENTRAL_EN FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (UC_BT_BLE_FEAT_ISO_CIG_PERIPHERAL == TRUE)
|
||||||
|
#define BLE_FEAT_ISO_CIG_PERIPHERAL_EN TRUE
|
||||||
|
#else
|
||||||
|
#define BLE_FEAT_ISO_CIG_PERIPHERAL_EN FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ((BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE) || (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE))
|
||||||
|
#define BLE_FEAT_ISO_CIG_EN TRUE
|
||||||
|
#else
|
||||||
|
#define BLE_FEAT_ISO_CIG_EN FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef UC_BT_BLE_ISO_CIS_MAX_COUNT
|
||||||
|
#define BLE_ISO_CIS_MAX_COUNT UC_BT_BLE_ISO_CIS_MAX_COUNT
|
||||||
|
#else
|
||||||
|
#define BLE_ISO_CIS_MAX_COUNT (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BT_BLE_ISO_BIS_MAX_COUNT
|
||||||
|
#define BLE_ISO_BIS_MAX_COUNT CONFIG_BT_BLE_ISO_BIS_MAX_COUNT
|
||||||
|
#else
|
||||||
|
#define BLE_ISO_BIS_MAX_COUNT (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef UC_BT_BLE_ISO_STD_FLOW_CTRL
|
||||||
|
#define BLE_ISO_STD_FLOW_CTRL TRUE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef UC_BT_BLE_ISO_NON_STD_FLOW_CTRL
|
||||||
|
#define BLE_ISO_NON_STD_FLOW_CTRL TRUE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ((UC_BT_BLE_ISO_STD_FLOW_CTRL == TRUE) && (UC_BT_BLE_ISO_NON_STD_FLOW_CTRL == TRUE))
|
||||||
|
#error "Only one of standard or non-standard can be enabled"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL == TRUE)
|
#if (UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL == TRUE)
|
||||||
#define BLE_HIGH_DUTY_ADV_INTERVAL TRUE
|
#define BLE_HIGH_DUTY_ADV_INTERVAL TRUE
|
||||||
#else
|
#else
|
||||||
|
@ -31,10 +31,14 @@
|
|||||||
#include "osi/future.h"
|
#include "osi/future.h"
|
||||||
#include "config/stack_config.h"
|
#include "config/stack_config.h"
|
||||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
const bt_event_mask_t BLE_EVENT_MASK = { "\x00\x00\x00\x02\xff\xff\xff\xff" };
|
||||||
|
#else
|
||||||
const bt_event_mask_t BLE_EVENT_MASK = { "\x00\x00\x00\x00\x00\xff\xff\xff" };
|
const bt_event_mask_t BLE_EVENT_MASK = { "\x00\x00\x00\x00\x00\xff\xff\xff" };
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
#else
|
#else
|
||||||
const bt_event_mask_t BLE_EVENT_MASK = { "\x00\x00\x00\x00\x00\x00\x06\x7f" };
|
const bt_event_mask_t BLE_EVENT_MASK = { "\x00\x00\x00\x00\x00\x00\x06\x7f" };
|
||||||
#endif
|
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||||
|
|
||||||
#if (BLE_INCLUDED)
|
#if (BLE_INCLUDED)
|
||||||
const bt_event_mask_t CLASSIC_EVENT_MASK = { HCI_DUMO_EVENT_MASK_EXT };
|
const bt_event_mask_t CLASSIC_EVENT_MASK = { HCI_DUMO_EVENT_MASK_EXT };
|
||||||
@ -103,6 +107,10 @@ static controller_local_param_t *controller_param_ptr;
|
|||||||
static void start_up(void)
|
static void start_up(void)
|
||||||
{
|
{
|
||||||
BT_HDR *response;
|
BT_HDR *response;
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
uint16_t iso_pktlen = 0;
|
||||||
|
uint8_t iso_max_pkts = 0;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
// Send the initial reset command
|
// Send the initial reset command
|
||||||
response = AWAIT_COMMAND(controller_param.packet_factory->make_reset());
|
response = AWAIT_COMMAND(controller_param.packet_factory->make_reset());
|
||||||
@ -241,7 +249,19 @@ static void start_up(void)
|
|||||||
&controller_param.acl_data_size_ble,
|
&controller_param.acl_data_size_ble,
|
||||||
&controller_param.acl_buffer_count_ble
|
&controller_param.acl_buffer_count_ble
|
||||||
);
|
);
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
// Request the ble buffer size next
|
||||||
|
response = AWAIT_COMMAND(controller_param.packet_factory->make_ble_read_buffer_size_v2());
|
||||||
|
controller_param.packet_parser->parse_ble_read_buffer_size_response_v2(
|
||||||
|
response,
|
||||||
|
&controller_param.acl_data_size_ble,
|
||||||
|
&controller_param.acl_buffer_count_ble,
|
||||||
|
&iso_pktlen,
|
||||||
|
&iso_max_pkts
|
||||||
|
);
|
||||||
|
extern int ble_hci_set_iso_buf_sz(uint16_t pktlen, uint8_t max_pkts);
|
||||||
|
ble_hci_set_iso_buf_sz(iso_pktlen, iso_max_pkts);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
// Response of 0 indicates ble has the same buffer size as classic
|
// Response of 0 indicates ble has the same buffer size as classic
|
||||||
if (controller_param.acl_data_size_ble == 0) {
|
if (controller_param.acl_data_size_ble == 0) {
|
||||||
controller_param.acl_data_size_ble = controller_param.acl_data_size_classic;
|
controller_param.acl_data_size_ble = controller_param.acl_data_size_classic;
|
||||||
|
346
components/bt/host/bluedroid/hci/ble_hci_iso.c
Normal file
346
components/bt/host/bluedroid/hci/ble_hci_iso.c
Normal file
@ -0,0 +1,346 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include "hci/ble_hci_iso.h"
|
||||||
|
#include "common/bt_target.h"
|
||||||
|
#include "osi/mutex.h"
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
|
#define BLE_HCI_ISO_PB_FIRST_FRAG 0
|
||||||
|
#define BLE_HCI_ISO_PB_CONT_FRAG 1
|
||||||
|
#define BLE_HCI_ISO_PB_COMP_SDU 2
|
||||||
|
#define BLE_HCI_ISO_PB_LAST_FRAG 3
|
||||||
|
|
||||||
|
#define BLE_HCI_ISO_DATA_HDR_SZ 4
|
||||||
|
#define BLE_HCI_ISO_DATA_LOAD_TS_SZ 4
|
||||||
|
#define BLE_HCI_ISO_DATA_LOAD_HDR_SZ 4
|
||||||
|
|
||||||
|
#ifndef min
|
||||||
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static uint16_t ble_hs_iso_buf_sz;
|
||||||
|
static uint8_t ble_hs_iso_max_pkts;
|
||||||
|
|
||||||
|
#if (BLE_ISO_STD_FLOW_CTRL == TRUE)
|
||||||
|
/* Number of available ISO transmit buffers on the controller.
|
||||||
|
* It must only be accessed while the host mutex is locked.
|
||||||
|
*/
|
||||||
|
static uint16_t ble_hs_iso_avail_pkts;
|
||||||
|
#endif // #if (BLE_ISO_STD_FLOW_CTRL == TRUE)
|
||||||
|
|
||||||
|
static struct ble_hci_iso_conn g_iso_conn[BLE_ISO_BIS_MAX_COUNT + BLE_ISO_CIS_MAX_COUNT];
|
||||||
|
|
||||||
|
int
|
||||||
|
ble_hci_set_iso_buf_sz(uint16_t pktlen, uint8_t max_pkts)
|
||||||
|
{
|
||||||
|
if (pktlen == 0 || max_pkts == 0) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
ble_hs_iso_buf_sz = pktlen;
|
||||||
|
ble_hs_iso_max_pkts = max_pkts;
|
||||||
|
|
||||||
|
#if (BLE_ISO_STD_FLOW_CTRL == TRUE)
|
||||||
|
ble_hs_iso_avail_pkts = max_pkts;
|
||||||
|
#endif /* (BLE_ISO_STD_FLOW_CTRL) */
|
||||||
|
|
||||||
|
HCI_TRACE_WARNING("ISO Flow Control:\n");
|
||||||
|
HCI_TRACE_WARNING(" Length: %u\n", pktlen);
|
||||||
|
HCI_TRACE_WARNING(" Count: %u\n", max_pkts);
|
||||||
|
HCI_TRACE_WARNING(" Status: ");
|
||||||
|
#if (BLE_ISO_STD_FLOW_CTRL == TRUE)
|
||||||
|
HCI_TRACE_WARNING("%s\n", "Standard");
|
||||||
|
#elif (BLE_ISO_NON_STD_FLOW_CTRL == TRUE)
|
||||||
|
HCI_TRACE_WARNING("%s\n", "Non-standard");
|
||||||
|
#else
|
||||||
|
HCI_TRACE_WARNING("%s\n", "Not support");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ble_hci_get_iso_buf_size(uint16_t *pktlen, uint8_t *max_pkts)
|
||||||
|
{
|
||||||
|
assert(pktlen && max_pkts);
|
||||||
|
|
||||||
|
*pktlen = ble_hs_iso_buf_sz;
|
||||||
|
*max_pkts = ble_hs_iso_max_pkts;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_ISO_STD_FLOW_CTRL == TRUE)
|
||||||
|
void
|
||||||
|
ble_hci_add_iso_avail_pkts(uint16_t delta)
|
||||||
|
{
|
||||||
|
osi_mutex_global_lock();
|
||||||
|
|
||||||
|
if (ble_hs_iso_avail_pkts + delta > ble_hs_iso_max_pkts) {
|
||||||
|
HCI_TRACE_ERROR("ISO_HS_RESET %u %u %u\n", ble_hs_iso_avail_pkts, delta, ble_hs_iso_max_pkts);
|
||||||
|
// ble_hs_sched_reset(BLE_HS_ECONTROLLER);
|
||||||
|
assert(0);
|
||||||
|
} else {
|
||||||
|
ble_hs_iso_avail_pkts += delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
osi_mutex_global_unlock();
|
||||||
|
}
|
||||||
|
#endif /* (BLE_ISO_STD_FLOW_CTRL) */
|
||||||
|
|
||||||
|
#define BLE_ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
|
||||||
|
|
||||||
|
struct ble_hci_iso_conn *
|
||||||
|
ble_hci_iso_conn_find(uint16_t conn_handle)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < BLE_ARRAY_SIZE(g_iso_conn); i++) {
|
||||||
|
struct ble_hci_iso_conn *conn = &g_iso_conn[i];
|
||||||
|
|
||||||
|
if (conn->enabled &&
|
||||||
|
conn->conn_handle == conn_handle) {
|
||||||
|
return conn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ble_hci_iso_conn_free(uint16_t conn_handle)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < BLE_ARRAY_SIZE(g_iso_conn); i++) {
|
||||||
|
struct ble_hci_iso_conn *conn = &g_iso_conn[i];
|
||||||
|
|
||||||
|
if (conn->enabled &&
|
||||||
|
conn->conn_handle == conn_handle) {
|
||||||
|
conn->enabled = 0;
|
||||||
|
conn->conn_handle = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct ble_hci_iso_conn *
|
||||||
|
ble_hci_iso_alloc_conn(uint16_t conn_handle)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < BLE_ARRAY_SIZE(g_iso_conn); i++) {
|
||||||
|
struct ble_hci_iso_conn *conn = &g_iso_conn[i];
|
||||||
|
|
||||||
|
if (!conn->enabled) {
|
||||||
|
conn->enabled = 1;
|
||||||
|
conn->conn_handle = conn_handle;
|
||||||
|
conn->pkt_seq_num = 0; /* Initialize to 0 */
|
||||||
|
return conn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_ISO_STD_FLOW_CTRL == TRUE)
|
||||||
|
static uint8_t
|
||||||
|
ble_hci_iso_buf_needed(struct ble_hs_iso_conn *conn)
|
||||||
|
{
|
||||||
|
uint16_t sdu_offset;
|
||||||
|
uint16_t dl_len;
|
||||||
|
uint8_t dlh_len;
|
||||||
|
uint8_t count;
|
||||||
|
|
||||||
|
dlh_len = (conn->ts_flag ? BLE_HCI_ISO_DATA_LOAD_TS_SZ : 0) + BLE_HCI_ISO_DATA_LOAD_HDR_SZ;
|
||||||
|
sdu_offset = 0;
|
||||||
|
count = 1; /* 1 extra since framed pdu may be used */
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
dl_len = min(dlh_len + conn->sdu_len - sdu_offset, ble_hs_iso_buf_sz);
|
||||||
|
|
||||||
|
count += 1;
|
||||||
|
|
||||||
|
sdu_offset += dl_len - dlh_len;
|
||||||
|
assert(sdu_offset <= conn->sdu_len);
|
||||||
|
|
||||||
|
if (sdu_offset == conn->sdu_len) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* No data load header for continuation/last segment */
|
||||||
|
dlh_len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
#endif /* (BLE_ISO_STD_FLOW_CTRL) */
|
||||||
|
|
||||||
|
static void
|
||||||
|
ble_hci_iso_hdr_append(struct ble_hci_iso_conn *conn,
|
||||||
|
uint8_t *frag,
|
||||||
|
uint8_t pb_flag, uint16_t dl_len)
|
||||||
|
{
|
||||||
|
uint32_t pkt_hdr;
|
||||||
|
uint32_t dl_hdr;
|
||||||
|
|
||||||
|
pkt_hdr = conn->conn_handle;
|
||||||
|
pkt_hdr |= (pb_flag << 12);
|
||||||
|
if (pb_flag == BLE_HCI_ISO_PB_FIRST_FRAG ||
|
||||||
|
pb_flag == BLE_HCI_ISO_PB_COMP_SDU) {
|
||||||
|
pkt_hdr |= (conn->ts_flag << 14);
|
||||||
|
}
|
||||||
|
pkt_hdr |= (dl_len << 16);
|
||||||
|
|
||||||
|
memcpy(frag, &pkt_hdr, BLE_HCI_ISO_DATA_HDR_SZ);
|
||||||
|
|
||||||
|
/* No data load header for continuation/last segment */
|
||||||
|
if (pb_flag == BLE_HCI_ISO_PB_CONT_FRAG ||
|
||||||
|
pb_flag == BLE_HCI_ISO_PB_LAST_FRAG) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (conn->ts_flag) {
|
||||||
|
memcpy(frag + BLE_HCI_ISO_DATA_HDR_SZ, &conn->time_stamp, BLE_HCI_ISO_DATA_LOAD_TS_SZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
dl_hdr = (conn->sdu_len << 16) | conn->pkt_seq_num;
|
||||||
|
|
||||||
|
memcpy(frag + BLE_HCI_ISO_DATA_HDR_SZ + (conn->ts_flag ? BLE_HCI_ISO_DATA_LOAD_TS_SZ : 0),
|
||||||
|
&dl_hdr, BLE_HCI_ISO_DATA_LOAD_HDR_SZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ble_hci_tx_iso_data(const uint8_t *data, uint16_t len, void *arg)
|
||||||
|
{
|
||||||
|
int rc = 1;
|
||||||
|
#if CONFIG_BT_LE_ISO_SUPPORT
|
||||||
|
// return ble_transport_to_ll_iso(data, len, arg);
|
||||||
|
extern int ble_hci_trans_hs_iso_tx(const uint8_t *data, uint16_t length, void *arg);
|
||||||
|
rc = ble_hci_trans_hs_iso_tx(data, len, arg);
|
||||||
|
#endif // #if CONFIG_BT_LE_ISO_SUPPORT
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ble_hci_iso_tx_now(struct ble_hci_iso_conn *conn, const uint8_t *sdu,
|
||||||
|
uint32_t time_stamp, uint16_t pkt_seq_num)
|
||||||
|
{
|
||||||
|
uint8_t dlh_len;
|
||||||
|
uint8_t *frag;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
#if (BLE_ISO_STD_FLOW_CTRL == TRUE)
|
||||||
|
/* Get the Controller ISO buffer needed for the SDU */
|
||||||
|
uint8_t count = ble_hs_hci_iso_buf_needed(conn);
|
||||||
|
|
||||||
|
/* Make sure the Controller ISO buffer can accommodate the SDU completely */
|
||||||
|
if (count > ble_hs_iso_avail_pkts) {
|
||||||
|
HCI_TRACE_ERROR("ISO flow control(%u/%u)!\n", count, ble_hs_iso_avail_pkts);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#elif (BLE_ISO_NON_STD_FLOW_CTRL == TRUE)
|
||||||
|
extern uint16_t ble_ll_iso_free_buf_num_get(uint16_t conn_handle);
|
||||||
|
if (ble_ll_iso_free_buf_num_get(conn->conn_handle) == 0) {
|
||||||
|
HCI_TRACE_ERROR("ISO flow control!\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
dlh_len = (conn->ts_flag ? BLE_HCI_ISO_DATA_LOAD_TS_SZ : 0) + BLE_HCI_ISO_DATA_LOAD_HDR_SZ;
|
||||||
|
|
||||||
|
frag = malloc(BLE_HCI_ISO_DATA_HDR_SZ + dlh_len + conn->sdu_len);
|
||||||
|
if (frag == NULL) {
|
||||||
|
HCI_TRACE_ERROR("frag is null\n");
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
ble_hci_iso_hdr_append(conn,
|
||||||
|
frag,
|
||||||
|
BLE_HCI_ISO_PB_COMP_SDU,
|
||||||
|
dlh_len + conn->sdu_len);
|
||||||
|
|
||||||
|
memcpy(frag + BLE_HCI_ISO_DATA_HDR_SZ + dlh_len,
|
||||||
|
sdu,
|
||||||
|
conn->sdu_len);
|
||||||
|
|
||||||
|
rc = ble_hci_tx_iso_data(frag, BLE_HCI_ISO_DATA_HDR_SZ + dlh_len + conn->sdu_len, NULL);
|
||||||
|
if (rc) {
|
||||||
|
HCI_TRACE_ERROR("iso tx failed\n");
|
||||||
|
return 14;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_ISO_STD_FLOW_CTRL == TRUE)
|
||||||
|
/* If an ISO SDU is fragmented into fragments, flow control is not supported.
|
||||||
|
*
|
||||||
|
* Currently even if an SDU is larger than the ISO buffer size, fragmentation
|
||||||
|
* will not happen here, the SDU will be posted to Controller completely.
|
||||||
|
*/
|
||||||
|
ble_hs_iso_avail_pkts -= 1;
|
||||||
|
#endif /* (BLE_ISO_STD_FLOW_CTRL) */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
esp_ble_hci_iso_tx(uint16_t conn_handle, const uint8_t *sdu, uint16_t sdu_len,
|
||||||
|
bool ts_flag, uint32_t time_stamp, uint16_t pkt_seq_num)
|
||||||
|
{
|
||||||
|
struct ble_hci_iso_conn *conn;
|
||||||
|
uint16_t max_sdu;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
osi_mutex_global_lock();
|
||||||
|
|
||||||
|
/* For sending empty SDU, we could use an SDU with zero length. */
|
||||||
|
if (sdu == NULL && sdu_len != 0) {
|
||||||
|
HCI_TRACE_ERROR("Invalid iso sdu\n");
|
||||||
|
rc = 3;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO:
|
||||||
|
* Use Host functions to replace the above LL implementation.
|
||||||
|
*/
|
||||||
|
max_sdu = 0x0FFF;
|
||||||
|
|
||||||
|
if (sdu_len > max_sdu) {
|
||||||
|
HCI_TRACE_ERROR("Too large iso sdu %d, max_sdu %d\n", sdu_len, max_sdu);
|
||||||
|
rc = 8;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
conn = ble_hci_iso_conn_find(conn_handle);
|
||||||
|
if (!conn) {
|
||||||
|
conn = ble_hci_iso_alloc_conn(conn_handle);
|
||||||
|
}
|
||||||
|
if (!conn) {
|
||||||
|
rc = 7;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
conn->ts_flag = ts_flag;
|
||||||
|
conn->time_stamp = time_stamp;
|
||||||
|
conn->pkt_seq_num = pkt_seq_num;
|
||||||
|
conn->sdu_len = sdu_len;
|
||||||
|
|
||||||
|
rc = ble_hci_iso_tx_now(conn, sdu, time_stamp, pkt_seq_num);
|
||||||
|
end:
|
||||||
|
osi_mutex_global_unlock();
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
@ -135,6 +135,7 @@ static bool hci_hal_env_init(const hci_hal_callbacks_t *upper_callbacks, osi_thr
|
|||||||
hci_hal_env.adv_rpt_q = pkt_queue_create();
|
hci_hal_env.adv_rpt_q = pkt_queue_create();
|
||||||
assert(hci_hal_env.adv_rpt_q != NULL);
|
assert(hci_hal_env.adv_rpt_q != NULL);
|
||||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||||
|
|
||||||
struct osi_event *event = osi_event_create(hci_upstream_data_handler, NULL);
|
struct osi_event *event = osi_event_create(hci_upstream_data_handler, NULL);
|
||||||
assert(event != NULL);
|
assert(event != NULL);
|
||||||
hci_hal_env.upstream_data_ready = event;
|
hci_hal_env.upstream_data_ready = event;
|
||||||
@ -156,7 +157,6 @@ static void hci_hal_env_deinit(void)
|
|||||||
hci_hal_env.adv_rpt_q = NULL;
|
hci_hal_env.adv_rpt_q = NULL;
|
||||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||||
hci_hal_env.upstream_data_ready = NULL;
|
hci_hal_env.upstream_data_ready = NULL;
|
||||||
|
|
||||||
fixed_queue_free(rx_q, osi_free_func);
|
fixed_queue_free(rx_q, osi_free_func);
|
||||||
#if (BLE_42_SCAN_EN == TRUE)
|
#if (BLE_42_SCAN_EN == TRUE)
|
||||||
pkt_queue_destroy(adv_rpt_q, NULL);
|
pkt_queue_destroy(adv_rpt_q, NULL);
|
||||||
@ -231,6 +231,30 @@ static uint16_t transmit_data(serial_data_type_t type,
|
|||||||
return length - 1;
|
return length - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
typedef void ble_host_rx_iso_data_fn(uint8_t *data, uint16_t len);
|
||||||
|
|
||||||
|
static ble_host_rx_iso_data_fn *ble_host_iso_rx_cb = NULL;
|
||||||
|
|
||||||
|
void ble_host_register_rx_iso_data_cb(void *cb)
|
||||||
|
{
|
||||||
|
/* If the iso rx cb is already registered, we will give
|
||||||
|
* a warning log here, and the cb will still be updated.
|
||||||
|
*/
|
||||||
|
if (ble_host_iso_rx_cb) {
|
||||||
|
HCI_TRACE_WARNING("iso rx cb %p already registered\n", ble_host_iso_rx_cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
ble_host_iso_rx_cb = cb;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ble_hci_register_rx_iso_data_cb(void *cb)
|
||||||
|
{
|
||||||
|
ble_host_register_rx_iso_data_cb(cb);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
// Internal functions
|
// Internal functions
|
||||||
static void hci_upstream_data_handler(void *arg)
|
static void hci_upstream_data_handler(void *arg)
|
||||||
{
|
{
|
||||||
@ -563,7 +587,12 @@ void bt_record_hci_data(uint8_t *data, uint16_t len)
|
|||||||
)) {
|
)) {
|
||||||
bt_hci_log_record_hci_adv(HCI_LOG_DATA_TYPE_ADV, &data[2], len - 2);
|
bt_hci_log_record_hci_adv(HCI_LOG_DATA_TYPE_ADV, &data[2], len - 2);
|
||||||
} else {
|
} else {
|
||||||
uint8_t data_type = ((data[0] == 2) ? HCI_LOG_DATA_TYPE_C2H_ACL : data[0]);
|
uint8_t data_type;
|
||||||
|
if (data[0] == HCI_LOG_DATA_TYPE_ISO_DATA) {
|
||||||
|
data_type = HCI_LOG_DATA_TYPE_ISO_DATA;
|
||||||
|
} else {
|
||||||
|
data_type = ((data[0] == 2) ? HCI_LOG_DATA_TYPE_C2H_ACL : data[0]);
|
||||||
|
}
|
||||||
bt_hci_log_record_hci_data(data_type, &data[1], len - 1);
|
bt_hci_log_record_hci_data(data_type, &data[1], len - 1);
|
||||||
}
|
}
|
||||||
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
|
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
|
||||||
@ -581,12 +610,23 @@ static int host_recv_pkt_cb(uint8_t *data, uint16_t len)
|
|||||||
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
#endif // #if (BLE_42_SCAN_EN == TRUE)
|
||||||
size_t pkt_size;
|
size_t pkt_size;
|
||||||
|
|
||||||
if (hci_hal_env.rx_q == NULL) {
|
if ((hci_hal_env.rx_q == NULL) || (data == NULL)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bt_record_hci_data(data, len);
|
bt_record_hci_data(data, len);
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
if (data[0] == DATA_TYPE_ISO) {
|
||||||
|
if (ble_host_iso_rx_cb) {
|
||||||
|
ble_host_iso_rx_cb(&data[1], len -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(data);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
bool is_adv_rpt = host_recv_adv_packet(data);
|
bool is_adv_rpt = host_recv_adv_packet(data);
|
||||||
|
|
||||||
if (!is_adv_rpt) {
|
if (!is_adv_rpt) {
|
||||||
@ -601,7 +641,9 @@ static int host_recv_pkt_cb(uint8_t *data, uint16_t len)
|
|||||||
pkt->len = len;
|
pkt->len = len;
|
||||||
pkt->layer_specific = 0;
|
pkt->layer_specific = 0;
|
||||||
memcpy(pkt->data, data, len);
|
memcpy(pkt->data, data, len);
|
||||||
fixed_queue_enqueue(hci_hal_env.rx_q, pkt, FIXED_QUEUE_MAX_TIMEOUT);
|
{
|
||||||
|
fixed_queue_enqueue(hci_hal_env.rx_q, pkt, FIXED_QUEUE_MAX_TIMEOUT);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
#if (BLE_42_SCAN_EN == TRUE)
|
#if (BLE_42_SCAN_EN == TRUE)
|
||||||
#if !BLE_ADV_REPORT_FLOW_CONTROL
|
#if !BLE_ADV_REPORT_FLOW_CONTROL
|
||||||
|
@ -159,6 +159,13 @@ static BT_HDR *make_ble_read_buffer_size(void)
|
|||||||
return make_command_no_params(HCI_BLE_READ_BUFFER_SIZE);
|
return make_command_no_params(HCI_BLE_READ_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
static BT_HDR *make_ble_read_buffer_size_v2(void)
|
||||||
|
{
|
||||||
|
return make_command_no_params(HCI_BLE_READ_BUFFER_SZIE_V2);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
static BT_HDR *make_ble_read_supported_states(void)
|
static BT_HDR *make_ble_read_supported_states(void)
|
||||||
{
|
{
|
||||||
return make_command_no_params(HCI_BLE_READ_SUPPORTED_STATES);
|
return make_command_no_params(HCI_BLE_READ_SUPPORTED_STATES);
|
||||||
@ -270,6 +277,9 @@ static const hci_packet_factory_t interface = {
|
|||||||
make_ble_write_host_support,
|
make_ble_write_host_support,
|
||||||
make_ble_read_white_list_size,
|
make_ble_read_white_list_size,
|
||||||
make_ble_read_buffer_size,
|
make_ble_read_buffer_size,
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
make_ble_read_buffer_size_v2,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
make_ble_read_supported_states,
|
make_ble_read_supported_states,
|
||||||
make_ble_read_local_supported_features,
|
make_ble_read_local_supported_features,
|
||||||
make_ble_read_resolving_list_size,
|
make_ble_read_resolving_list_size,
|
||||||
|
@ -155,6 +155,26 @@ static void parse_ble_read_buffer_size_response(
|
|||||||
osi_free(response);
|
osi_free(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
static void parse_ble_read_buffer_size_response_v2 (
|
||||||
|
BT_HDR *response,
|
||||||
|
uint16_t *data_size_ptr,
|
||||||
|
uint8_t *acl_buffer_count_ptr,
|
||||||
|
uint16_t *iso_pkt_len_ptr,
|
||||||
|
uint8_t *iso_pkt_num_ptr)
|
||||||
|
{
|
||||||
|
|
||||||
|
uint8_t *stream = read_command_complete_header(response, HCI_BLE_READ_BUFFER_SZIE_V2, 3 /* bytes after */);
|
||||||
|
assert(stream != NULL);
|
||||||
|
STREAM_TO_UINT16(*data_size_ptr, stream);
|
||||||
|
STREAM_TO_UINT8(*acl_buffer_count_ptr, stream);
|
||||||
|
STREAM_TO_UINT16(*iso_pkt_len_ptr, stream);
|
||||||
|
STREAM_TO_UINT8(*iso_pkt_num_ptr, stream);
|
||||||
|
|
||||||
|
osi_free(response);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
static void parse_ble_read_supported_states_response(
|
static void parse_ble_read_supported_states_response(
|
||||||
BT_HDR *response,
|
BT_HDR *response,
|
||||||
uint8_t *supported_states,
|
uint8_t *supported_states,
|
||||||
@ -280,6 +300,9 @@ static const hci_packet_parser_t interface = {
|
|||||||
parse_read_local_extended_features_response,
|
parse_read_local_extended_features_response,
|
||||||
parse_ble_read_white_list_size_response,
|
parse_ble_read_white_list_size_response,
|
||||||
parse_ble_read_buffer_size_response,
|
parse_ble_read_buffer_size_response,
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
parse_ble_read_buffer_size_response_v2,
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
parse_ble_read_supported_states_response,
|
parse_ble_read_supported_states_response,
|
||||||
parse_ble_read_local_supported_features_response,
|
parse_ble_read_local_supported_features_response,
|
||||||
parse_ble_read_resolving_list_size_response,
|
parse_ble_read_resolving_list_size_response,
|
||||||
|
85
components/bt/host/bluedroid/hci/include/hci/ble_hci_iso.h
Normal file
85
components/bt/host/bluedroid/hci/include/hci/ble_hci_iso.h
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef H_BLE_HCI_ISO_
|
||||||
|
#define H_BLE_HCI_ISO_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct ble_hci_iso_pkt_hdr {
|
||||||
|
uint16_t conn_handle : 12,
|
||||||
|
pb_flag : 2,
|
||||||
|
ts_flag : 1;
|
||||||
|
uint16_t data_load_len;
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
struct ble_hci_iso_pkt {
|
||||||
|
/* ISO header */
|
||||||
|
uint16_t conn_handle; /* CIS or BIS handle. */
|
||||||
|
uint8_t pb_flag : 2, /* Packet boundary flag. */
|
||||||
|
ts_flag : 1; /* Timestamp flag. */
|
||||||
|
uint16_t iso_data_load_len; /* ISO Data Load length. */
|
||||||
|
|
||||||
|
/* ISO Data Load */
|
||||||
|
uint32_t time_stamp; /* Timestamp. */
|
||||||
|
uint16_t packet_seq; /* Packet sequence number. */
|
||||||
|
uint16_t iso_sdu_len; /* SDU length. */
|
||||||
|
uint8_t ps_flag; /* Packet status. */
|
||||||
|
const uint8_t *sdu; /* First byte of ISO SDU. */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ble_hci_iso_tx {
|
||||||
|
struct ble_hci_iso_pkt pkt;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ble_hci_iso_rx {
|
||||||
|
struct ble_hci_iso_pkt pkt;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ble_hci_iso_conn {
|
||||||
|
uint16_t conn_handle;
|
||||||
|
uint8_t enabled : 1,
|
||||||
|
pb_flag : 2,
|
||||||
|
ts_flag : 1;
|
||||||
|
uint32_t time_stamp;
|
||||||
|
uint16_t pkt_seq_num;
|
||||||
|
uint16_t sdu_len;
|
||||||
|
};
|
||||||
|
|
||||||
|
int ble_hci_set_iso_buf_sz(uint16_t pktlen, uint8_t max_pkts);
|
||||||
|
|
||||||
|
void ble_hci_get_iso_buf_size(uint16_t *pktlen, uint8_t *max_pkts);
|
||||||
|
|
||||||
|
void ble_hci_add_iso_avail_pkts(uint16_t delta);
|
||||||
|
|
||||||
|
struct ble_hci_iso_conn *ble_hci_iso_conn_find(uint16_t conn_handle);
|
||||||
|
|
||||||
|
int esp_ble_hci_iso_tx(uint16_t conn_handle, const uint8_t *sdu, uint16_t sdu_len,
|
||||||
|
bool ts_flag, uint32_t time_stamp, uint16_t pkt_seq_num);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* H_BLE_HCI_ISO_ */
|
@ -31,7 +31,8 @@ typedef enum {
|
|||||||
DATA_TYPE_COMMAND = 1,
|
DATA_TYPE_COMMAND = 1,
|
||||||
DATA_TYPE_ACL = 2,
|
DATA_TYPE_ACL = 2,
|
||||||
DATA_TYPE_SCO = 3,
|
DATA_TYPE_SCO = 3,
|
||||||
DATA_TYPE_EVENT = 4
|
DATA_TYPE_EVENT = 4,
|
||||||
|
DATA_TYPE_ISO = 5,
|
||||||
} serial_data_type_t;
|
} serial_data_type_t;
|
||||||
|
|
||||||
typedef void (*packet_ready_cb)(BT_HDR *packet);
|
typedef void (*packet_ready_cb)(BT_HDR *packet);
|
||||||
|
@ -41,6 +41,9 @@ typedef struct {
|
|||||||
BT_HDR *(*make_ble_write_host_support)(uint8_t supported_host, uint8_t simultaneous_host);
|
BT_HDR *(*make_ble_write_host_support)(uint8_t supported_host, uint8_t simultaneous_host);
|
||||||
BT_HDR *(*make_ble_read_white_list_size)(void);
|
BT_HDR *(*make_ble_read_white_list_size)(void);
|
||||||
BT_HDR *(*make_ble_read_buffer_size)(void);
|
BT_HDR *(*make_ble_read_buffer_size)(void);
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
BT_HDR *(*make_ble_read_buffer_size_v2)(void);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
BT_HDR *(*make_ble_read_supported_states)(void);
|
BT_HDR *(*make_ble_read_supported_states)(void);
|
||||||
BT_HDR *(*make_ble_read_local_supported_features)(void);
|
BT_HDR *(*make_ble_read_local_supported_features)(void);
|
||||||
BT_HDR *(*make_ble_read_resolving_list_size)(void);
|
BT_HDR *(*make_ble_read_resolving_list_size)(void);
|
||||||
|
@ -79,6 +79,16 @@ typedef struct {
|
|||||||
uint8_t *acl_buffer_count_ptr
|
uint8_t *acl_buffer_count_ptr
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
void (*parse_ble_read_buffer_size_response_v2) (
|
||||||
|
BT_HDR *response,
|
||||||
|
uint16_t *data_size_ptr,
|
||||||
|
uint8_t *acl_buffer_count_ptr,
|
||||||
|
uint16_t *iso_pkt_len_ptr,
|
||||||
|
uint8_t *iso_pkt_num_ptr
|
||||||
|
);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
void (*parse_ble_read_supported_states_response)(
|
void (*parse_ble_read_supported_states_response)(
|
||||||
BT_HDR *response,
|
BT_HDR *response,
|
||||||
uint8_t *supported_states,
|
uint8_t *supported_states,
|
||||||
|
@ -2727,9 +2727,10 @@ void btm_acl_connected(BD_ADDR bda, UINT16 handle, UINT8 link_type, UINT8 enc_mo
|
|||||||
** Description Handle ACL disconnection complete event
|
** Description Handle ACL disconnection complete event
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void btm_acl_disconnected(UINT16 handle, UINT8 reason)
|
BOOLEAN btm_acl_disconnected(UINT16 handle, UINT8 reason)
|
||||||
{
|
{
|
||||||
|
BOOLEAN status = FALSE;
|
||||||
|
BOOLEAN dis_status;
|
||||||
/* Report BR/EDR ACL disconnection result to upper layer */
|
/* Report BR/EDR ACL disconnection result to upper layer */
|
||||||
tACL_CONN *conn = btm_handle_to_acl(handle);
|
tACL_CONN *conn = btm_handle_to_acl(handle);
|
||||||
if (conn) {
|
if (conn) {
|
||||||
@ -2737,6 +2738,7 @@ void btm_acl_disconnected(UINT16 handle, UINT8 reason)
|
|||||||
if (conn->transport == BT_TRANSPORT_BR_EDR)
|
if (conn->transport == BT_TRANSPORT_BR_EDR)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
status = TRUE;
|
||||||
tBTM_ACL_LINK_STAT_EVENT_DATA evt_data = {
|
tBTM_ACL_LINK_STAT_EVENT_DATA evt_data = {
|
||||||
.event = BTM_ACL_DISCONN_CMPL_EVT,
|
.event = BTM_ACL_DISCONN_CMPL_EVT,
|
||||||
.link_act.disconn_cmpl.reason = reason,
|
.link_act.disconn_cmpl.reason = reason,
|
||||||
@ -2748,16 +2750,29 @@ void btm_acl_disconnected(UINT16 handle, UINT8 reason)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if BTM_SCO_INCLUDED == TRUE
|
#if BTM_SCO_INCLUDED == TRUE
|
||||||
|
dis_status = l2c_link_hci_disc_comp (handle, reason);
|
||||||
/* If L2CAP doesn't know about it, send it to SCO */
|
/* If L2CAP doesn't know about it, send it to SCO */
|
||||||
if (!l2c_link_hci_disc_comp (handle, reason)) {
|
if (!dis_status) {
|
||||||
btm_sco_removed (handle, reason);
|
dis_status = btm_sco_removed (handle, reason);
|
||||||
|
} else {
|
||||||
|
status = TRUE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
l2c_link_hci_disc_comp(handle, reason);
|
dis_status = l2c_link_hci_disc_comp(handle, reason);
|
||||||
#endif /* BTM_SCO_INCLUDED */
|
#endif /* BTM_SCO_INCLUDED */
|
||||||
|
if (dis_status) {
|
||||||
|
// find tL2C_LCB
|
||||||
|
status = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#if (SMP_INCLUDED == TRUE)
|
#if (SMP_INCLUDED == TRUE)
|
||||||
/* Notify security manager */
|
/* Notify security manager */
|
||||||
btm_sec_disconnected(handle, reason);
|
if (btm_sec_disconnected(handle, reason)) {
|
||||||
|
// find tBTM_SEC_DEV_REC
|
||||||
|
status = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* SMP_INCLUDED == TRUE */
|
#endif /* SMP_INCLUDED == TRUE */
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
544
components/bt/host/bluedroid/stack/btm/btm_ble_iso.c
Normal file
544
components/bt/host/bluedroid/stack/btm/btm_ble_iso.c
Normal file
@ -0,0 +1,544 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "btm_int.h"
|
||||||
|
#include "stack/hcimsgs.h"
|
||||||
|
#include "osi/allocator.h"
|
||||||
|
#include "device/controller.h"
|
||||||
|
#include <string.h>
|
||||||
|
#include "l2c_int.h"
|
||||||
|
|
||||||
|
tBTM_BLE_ISO_CBACK ble_iso_cb;
|
||||||
|
|
||||||
|
extern void btm_ble_inter_set(bool extble_inter);
|
||||||
|
|
||||||
|
void BTM_BleIsoRegisterCallback(tBTM_BLE_ISO_CBACK cb)
|
||||||
|
{
|
||||||
|
if (cb) {
|
||||||
|
ble_iso_cb = cb;
|
||||||
|
} else {
|
||||||
|
BTM_TRACE_ERROR("%s, register fail, the cb function is NULL.", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BTM_IsoBleCallbackTrigger(tBTM_BLE_5_GAP_EVENT event, tBTM_BLE_ISO_CB_PARAMS *params)
|
||||||
|
{
|
||||||
|
if(params && params->status == BTM_SUCCESS) {
|
||||||
|
btm_ble_inter_set(true);
|
||||||
|
}
|
||||||
|
if (ble_iso_cb) {
|
||||||
|
ble_iso_cb(event, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void btm_ble_iso_read_iso_tx_sync_complete(UINT8 *p)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
STREAM_TO_UINT8(cb_params.btm_read_tx_sync.status, p);
|
||||||
|
STREAM_TO_UINT16(cb_params.btm_read_tx_sync.conn_hdl, p);
|
||||||
|
STREAM_TO_UINT16(cb_params.btm_read_tx_sync.pkt_seq_num, p);
|
||||||
|
STREAM_TO_UINT32(cb_params.btm_read_tx_sync.tx_time_stamp, p);
|
||||||
|
STREAM_TO_UINT24(cb_params.btm_read_tx_sync.time_offset, p);
|
||||||
|
|
||||||
|
if (cb_params.btm_read_tx_sync.status != HCI_SUCCESS) {
|
||||||
|
cb_params.btm_read_tx_sync.status = (BTM_HCI_ERROR | cb_params.btm_read_tx_sync.status);
|
||||||
|
}
|
||||||
|
cb_params.btm_read_tx_sync.conn_hdl = (cb_params.btm_read_tx_sync.conn_hdl & 0xEFF);
|
||||||
|
cb_params.btm_read_tx_sync.time_offset = (cb_params.btm_read_tx_sync.time_offset & 0xFFFFFF);
|
||||||
|
BTM_TRACE_DEBUG("read tx sync cmpl, status 0x%x conn_hdl 0x%x pkt_seq_num %d tx_time_stamp %ld time_offset %ld\n",
|
||||||
|
cb_params.btm_read_tx_sync.status, cb_params.btm_read_tx_sync.conn_hdl, cb_params.btm_read_tx_sync.pkt_seq_num,
|
||||||
|
cb_params.btm_read_tx_sync.tx_time_stamp, cb_params.btm_read_tx_sync.time_offset);
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_READ_TX_SYNC_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
void btm_ble_iso_read_iso_link_quality_complete(UINT8 *p)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
STREAM_TO_UINT8(cb_params.btm_read_link_quality.status, p);
|
||||||
|
STREAM_TO_UINT16(cb_params.btm_read_link_quality.conn_hdl, p);
|
||||||
|
STREAM_TO_UINT32(cb_params.btm_read_link_quality.tx_unacked_pkts, p);
|
||||||
|
STREAM_TO_UINT32(cb_params.btm_read_link_quality.tx_flushed_pkts, p);
|
||||||
|
STREAM_TO_UINT32(cb_params.btm_read_link_quality.tx_last_subevt_pkts, p);
|
||||||
|
STREAM_TO_UINT32(cb_params.btm_read_link_quality.retransmitted_pkts, p);
|
||||||
|
STREAM_TO_UINT32(cb_params.btm_read_link_quality.crc_error_pkts, p);
|
||||||
|
STREAM_TO_UINT32(cb_params.btm_read_link_quality.rx_unreceived_pkts, p);
|
||||||
|
STREAM_TO_UINT32(cb_params.btm_read_link_quality.duplicate_pkts, p);
|
||||||
|
|
||||||
|
if (cb_params.btm_read_link_quality.status != HCI_SUCCESS) {
|
||||||
|
cb_params.btm_read_link_quality.status = (BTM_HCI_ERROR | cb_params.btm_read_link_quality.status);
|
||||||
|
}
|
||||||
|
|
||||||
|
BTM_TRACE_DEBUG("read link quality cmpl, status 0x%x conn_hdl 0x%x tx_unacked_pkts %d tx_flushed_pkts %ld tx_last_subevt_pkts %ld retransmitted_pkts %d\
|
||||||
|
crc_error_pkts %d rx_unreceived_pkts %d duplicate_pkts %d\n",
|
||||||
|
cb_params.btm_read_link_quality.status, cb_params.btm_read_link_quality.conn_hdl, cb_params.btm_read_link_quality.tx_unacked_pkts,
|
||||||
|
cb_params.btm_read_link_quality.tx_flushed_pkts, cb_params.btm_read_link_quality.tx_last_subevt_pkts, cb_params.btm_read_link_quality.retransmitted_pkts,
|
||||||
|
cb_params.btm_read_link_quality.crc_error_pkts, cb_params.btm_read_link_quality.rx_unreceived_pkts, cb_params.btm_read_link_quality.duplicate_pkts);
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_READ_LINK_QUALITY_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
void btm_ble_iso_set_cig_params_complete(UINT8 *p)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
|
||||||
|
STREAM_TO_UINT8(cb_params.btm_set_cig_params.status, p);
|
||||||
|
STREAM_TO_UINT8(cb_params.btm_set_cig_params.cig_id, p);
|
||||||
|
STREAM_TO_UINT8(cb_params.btm_set_cig_params.cis_count, p);
|
||||||
|
for (uint8_t i = 0; i < cb_params.btm_set_cig_params.cis_count; i++)
|
||||||
|
{
|
||||||
|
STREAM_TO_UINT16(cb_params.btm_set_cig_params.conn_hdl[i], p);
|
||||||
|
BTM_TRACE_DEBUG("i = %d, conn_hdl = %d", i, cb_params.btm_set_cig_params.conn_hdl[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cb_params.btm_set_cig_params.status != HCI_SUCCESS) {
|
||||||
|
cb_params.btm_set_cig_params.status = (BTM_HCI_ERROR | cb_params.btm_set_cig_params.status);
|
||||||
|
}
|
||||||
|
|
||||||
|
BTM_TRACE_DEBUG("set cig params, status 0x%x cig_id %d cis_count %d\n",
|
||||||
|
cb_params.btm_set_cig_params.status, cb_params.btm_set_cig_params.cig_id, cb_params.btm_set_cig_params.cis_count);
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_SET_CIG_PARAMS_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
void btm_ble_cis_disconnected_evt(tBTM_BLE_CIS_DISCON_CMPL *params)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
if (!params) {
|
||||||
|
BTM_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cb_params.btm_cis_disconnectd_evt.cis_handle = params->cis_handle;
|
||||||
|
cb_params.btm_cis_disconnectd_evt.reason = params->reason;
|
||||||
|
|
||||||
|
BTM_TRACE_DEBUG("btm cis disconnect, cis_handle %d reason 0x%x\n", params->cis_handle, params->reason);
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_CIS_DISCONNECTED_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
void btm_ble_cis_established_evt(tBTM_BLE_CIS_ESTABLISHED_CMPL *params)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
if (!params) {
|
||||||
|
BTM_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params->status != HCI_SUCCESS) {
|
||||||
|
params->status = (params->status | BTM_HCI_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(&cb_params.btm_cis_established_evt, params, sizeof(tBTM_BLE_CIS_ESTABLISHED_CMPL));
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_CIS_ESTABLISHED_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
void btm_ble_cis_request_evt(tBTM_BLE_CIS_REQUEST_CMPL *params)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
if (!params) {
|
||||||
|
BTM_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
memcpy(&cb_params.btm_cis_request_evt, params, sizeof(tBTM_BLE_CIS_REQUEST_CMPL));
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_CIS_REQUEST_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
void btm_ble_big_create_cmpl_evt(tBTM_BLE_BIG_CREATE_CMPL *params)
|
||||||
|
{
|
||||||
|
BTM_TRACE_DEBUG("%s", __func__);
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
if (!params) {
|
||||||
|
BTM_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params->status != HCI_SUCCESS) {
|
||||||
|
params->status = (params->status | BTM_HCI_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
cb_params.btm_big_cmpl.status = params->status;
|
||||||
|
cb_params.btm_big_cmpl.big_handle = params->big_handle;
|
||||||
|
cb_params.btm_big_cmpl.big_sync_delay = params->big_sync_delay;
|
||||||
|
cb_params.btm_big_cmpl.transport_latency = params->transport_latency;
|
||||||
|
cb_params.btm_big_cmpl.phy = params->phy;
|
||||||
|
cb_params.btm_big_cmpl.nse = params->nse;
|
||||||
|
cb_params.btm_big_cmpl.bn = params->bn;
|
||||||
|
cb_params.btm_big_cmpl.pto = params->pto;
|
||||||
|
cb_params.btm_big_cmpl.irc = params->irc;
|
||||||
|
cb_params.btm_big_cmpl.max_pdu = params->max_pdu;
|
||||||
|
cb_params.btm_big_cmpl.iso_interval = params->iso_interval;
|
||||||
|
cb_params.btm_big_cmpl.num_bis = params->num_bis;
|
||||||
|
// for (uint8_t i = 0; i < params->num_bis; i++)
|
||||||
|
// {
|
||||||
|
// cb_params.btm_big_cmpl.bis_handle[i] = params->bis_handle[i];
|
||||||
|
// }
|
||||||
|
memcpy(&cb_params.btm_big_cmpl.bis_handle[0], ¶ms->bis_handle[0], params->num_bis * 2);
|
||||||
|
|
||||||
|
//memcpy(&cb_params.btm_big_cmpl, params, sizeof(tBTM_BLE_BIG_CREATE_CMPL));
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_BIG_CREATE_COMPLETE_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
void btm_ble_big_terminate_cmpl_evt(tBTM_BLE_BIG_TERMINATE_CMPL *params)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
if (!params) {
|
||||||
|
BTM_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
memcpy(&cb_params.btm_big_term, params, sizeof(tBTM_BLE_BIG_TERMINATE_CMPL));
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_BIG_TERMINATE_COMPLETE_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
void btm_ble_big_sync_estab_evt(tBTM_BLE_BIG_SYNC_ESTAB_CMPL *params)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
if (!params) {
|
||||||
|
BTM_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params->status != HCI_SUCCESS) {
|
||||||
|
params->status = (params->status | BTM_HCI_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(&cb_params.btm_big_sync_estab, params, sizeof(tBTM_BLE_BIG_SYNC_ESTAB_CMPL));
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_BIG_SYNC_ESTABLISHED_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
void btm_ble_big_sync_terminate_complete(UINT8 hci_status, UINT8 big_handle)
|
||||||
|
{
|
||||||
|
BTM_TRACE_DEBUG("%s hci_status 0x%x big_handle %d\n", __func__, hci_status, big_handle);
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
|
||||||
|
if (hci_status != HCI_SUCCESS) {
|
||||||
|
hci_status = (hci_status | BTM_HCI_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
cb_params.status = hci_status;
|
||||||
|
cb_params.btm_big_sync_ter.big_hdl = big_handle;
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_BIG_SYNC_TERMINATE_COMPLETE_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
void btm_ble_big_sync_lost_evt(tBTM_BLE_BIG_SYNC_LOST_EVT *params)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
if (!params) {
|
||||||
|
BTM_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(&cb_params.btm_big_sync_lost, params, sizeof(tBTM_BLE_BIG_SYNC_LOST_EVT));
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_BIG_SYNC_LOST_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
void btm_ble_biginfo_adv_report_evt(tBTM_BLE_BIGINFO_ADV_REPORT_EVT *params)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
if (!params) {
|
||||||
|
BTM_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(&cb_params.btm_biginfo_report, params, sizeof(tBTM_BLE_BIGINFO_ADV_REPORT_EVT));
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_BIGINFO_ADV_REPORT_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
|
||||||
|
void btm_ble_iso_data_path_update_complete(UINT16 opcode, UINT8 hci_status, UINT16 conn_handle)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
BTM_TRACE_DEBUG("data path update cmpl, opcode 0x%x status 0x%x conn_hdl %d\n", opcode, hci_status, conn_handle);
|
||||||
|
if (hci_status != HCI_SUCCESS) {
|
||||||
|
hci_status = (BTM_HCI_ERROR | hci_status);
|
||||||
|
}
|
||||||
|
cb_params.status = hci_status;
|
||||||
|
cb_params.btm_data_path_update.op_type = ((opcode == HCI_BLE_ISO_SET_DATA_PATH) ? BTM_BLE_ISO_DATA_PATH_SETUP : BTM_BLE_ISO_DATA_PATH_REMOVE);
|
||||||
|
cb_params.btm_data_path_update.conn_hdl = conn_handle;
|
||||||
|
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_DATA_PATH_UPFATE_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
tBTM_STATUS BTM_BleBigCreate(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
||||||
|
uint32_t sdu_interval, uint16_t max_sdu, uint16_t max_transport_latency,
|
||||||
|
uint8_t rtn, uint8_t phy, uint8_t packing, uint8_t framing,
|
||||||
|
uint8_t encryption, uint8_t *broadcast_code)
|
||||||
|
{
|
||||||
|
BTM_TRACE_API("big_handle %d adv_handle %d num_bis %d sdu_interval %d max_sdu %d max_transport_latency %d \
|
||||||
|
rtn %d phy %d packing %d framing %d encryption %d broadcast_code %d", big_handle, adv_handle, num_bis, sdu_interval, max_sdu, max_transport_latency,\
|
||||||
|
rtn, phy, packing, framing, encryption, broadcast_code);
|
||||||
|
|
||||||
|
btsnd_hcic_ble_big_create(big_handle, adv_handle, num_bis, sdu_interval, max_sdu, max_transport_latency,
|
||||||
|
rtn, phy, packing, framing, encryption, broadcast_code);
|
||||||
|
|
||||||
|
|
||||||
|
return BTM_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleBigCreateTest(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
||||||
|
uint32_t sdu_interval, uint16_t iso_interval, uint8_t nse,
|
||||||
|
uint16_t max_sdu, uint16_t max_pdu, uint8_t phy,
|
||||||
|
uint8_t packing, uint8_t framing, uint8_t bn, uint8_t irc,
|
||||||
|
uint8_t pto, uint8_t encryption, uint8_t *broadcast_code)
|
||||||
|
{
|
||||||
|
btsnd_hcic_ble_big_create_test(big_handle, adv_handle, num_bis, sdu_interval, iso_interval, nse,
|
||||||
|
max_sdu, max_pdu, phy, packing, framing, bn, irc, pto, encryption,
|
||||||
|
broadcast_code);
|
||||||
|
return BTM_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleBigTerminate(UINT8 big_handle, UINT8 reason)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
tBTM_STATUS status = BTM_SUCCESS;
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_big_terminate(big_handle, reason)) != TRUE) {
|
||||||
|
BTM_TRACE_ERROR("LE PA SyncCancel, cmd err=0x%x", err);
|
||||||
|
status = BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status != BTM_SUCCESS) {
|
||||||
|
cb_params.status = status;
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_BIG_TERMINATE_COMPLETE_EVT, &cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
tBTM_STATUS BTM_BleBigSyncCreate(uint8_t big_handle, uint16_t sync_handle,
|
||||||
|
uint8_t encryption, uint8_t *bc_code,
|
||||||
|
uint8_t mse, uint16_t big_sync_timeout,
|
||||||
|
uint8_t num_bis, uint8_t *bis)
|
||||||
|
{
|
||||||
|
btsnd_hcic_ble_big_sync_create(big_handle, sync_handle, encryption, bc_code,
|
||||||
|
mse, big_sync_timeout, num_bis, bis);
|
||||||
|
return BTM_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleBigSyncTerminate(uint8_t big_handle)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
tBTM_STATUS status = BTM_SUCCESS;
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_big_sync_terminate(big_handle)) != HCI_SUCCESS) {
|
||||||
|
BTM_TRACE_ERROR("LE big sync terminate, cmd err=0x%x", err);
|
||||||
|
status = BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleIsoSetDataPath(uint16_t conn_handle, uint8_t data_path_dir, uint8_t data_path_id, uint8_t coding_fmt,
|
||||||
|
uint16_t company_id, uint16_t vs_codec_id, uint32_t controller_delay, uint8_t codec_len,
|
||||||
|
uint8_t *codec_cfg)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
tBTM_STATUS status = BTM_SUCCESS;
|
||||||
|
|
||||||
|
if (codec_len && (codec_cfg == NULL)) {
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
status = BTM_ILLEGAL_VALUE;
|
||||||
|
cb_params.btm_data_path_update.op_type = BTM_BLE_ISO_DATA_PATH_SETUP;
|
||||||
|
cb_params.status = status;
|
||||||
|
cb_params.btm_data_path_update.conn_hdl = conn_handle;
|
||||||
|
BTM_TRACE_ERROR("codec_cfg is NULL, set data path error");
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_DATA_PATH_UPFATE_EVT, &cb_params);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
BTM_TRACE_DEBUG("BTM_BleIsoSetDataPath conn_handle %d data_path_dir %d\n", conn_handle, data_path_dir);
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_iso_set_data_path(conn_handle, data_path_dir, data_path_id, coding_fmt, company_id, vs_codec_id,
|
||||||
|
controller_delay, codec_len, codec_cfg)) != HCI_SUCCESS) {
|
||||||
|
BTM_TRACE_ERROR("iso data path update, cmd err=0x%x", err);
|
||||||
|
return BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleIsoRemoveDataPath(uint16_t conn_handle, uint8_t data_path_dir)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
|
||||||
|
BTM_TRACE_DEBUG("BTM_BleIsoRemoveDataPath conn_handle %d data_path_dir %d\n", conn_handle, data_path_dir);
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_iso_remove_data_path(conn_handle, data_path_dir)) != HCI_SUCCESS) {
|
||||||
|
BTM_TRACE_ERROR("iso data path remove, cmd err=0x%x", err);
|
||||||
|
return BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
return BTM_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleIsoSetHostFeature(uint16_t bit_num, uint8_t bit_val)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
tBTM_STATUS status = BTM_SUCCESS;
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
|
||||||
|
BTM_TRACE_DEBUG("BTM_BleIsoSetHostFeature bit_num %d bit_value %d\n", bit_num, bit_val);
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_iso_set_host_feature(bit_num, bit_val)) != HCI_SUCCESS) {
|
||||||
|
BTM_TRACE_ERROR("iso set host feature, cmd err=0x%x", err);
|
||||||
|
status = BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
cb_params.status = status;
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_SET_HOST_FEATURE_EVT, &cb_params);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleIsoReadTxSync(uint16_t iso_hdl)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
tBTM_STATUS status = BTM_SUCCESS;
|
||||||
|
|
||||||
|
BTM_TRACE_DEBUG("BTM_BleIsoReadTxSync iso_hdl %d\n", iso_hdl);
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_iso_read_tx_sync(iso_hdl)) != HCI_SUCCESS) {
|
||||||
|
BTM_TRACE_ERROR("iso read tx sync, cmd err=0x%x", err);
|
||||||
|
status = BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleIsoReadLinkQuality(uint16_t iso_hdl)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
tBTM_STATUS status = BTM_SUCCESS;
|
||||||
|
|
||||||
|
BTM_TRACE_DEBUG("BTM_BleIsoReadLinkQuality iso_hdl %d\n", iso_hdl);
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_iso_read_iso_link_quality(iso_hdl)) != HCI_SUCCESS) {
|
||||||
|
BTM_TRACE_ERROR("iso read link quality, cmd err=0x%x", err);
|
||||||
|
status = BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
tBTM_STATUS BTM_BleSetCigParams(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t worse_case_SCA, uint8_t packing,
|
||||||
|
uint8_t framing, uint16_t mtl_c_to_p, uint16_t mtl_p_to_c, uint8_t cis_cnt, uint8_t *cis_params)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
tBTM_STATUS status = BTM_SUCCESS;
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_iso_set_cig_params(cig_id, sdu_int_c_to_p, sdu_int_p_to_c, worse_case_SCA, packing,
|
||||||
|
framing, mtl_c_to_p, mtl_p_to_c, cis_cnt, (struct ble_hci_le_cis_params *)cis_params)) != HCI_SUCCESS) {
|
||||||
|
BTM_TRACE_ERROR("iso set cig params, cmd err=0x%x", err);
|
||||||
|
status = BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleSetCigParamsTest(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t ft_c_to_p, uint8_t ft_p_to_c, uint16_t iso_interval,
|
||||||
|
uint8_t worse_case_SCA, uint8_t packing, uint8_t framing, uint8_t cis_cnt, uint8_t *cis_params)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
tBTM_STATUS status = BTM_SUCCESS;
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_iso_set_cig_params_test(cig_id, sdu_int_c_to_p, sdu_int_p_to_c,ft_c_to_p, ft_p_to_c, iso_interval,
|
||||||
|
worse_case_SCA, packing, framing, cis_cnt, (struct ble_hci_le_cis_params_test *)cis_params)) != HCI_SUCCESS) {
|
||||||
|
BTM_TRACE_ERROR("iso set cig params test, cmd err=0x%x", err);
|
||||||
|
status = BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
void btm_ble_create_cis_cmd_status(tBTM_BLE_ISO_CB_PARAMS *cb_params)
|
||||||
|
{
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_CREATE_CIS_EVT, cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleCreateCis(uint8_t cis_count, uint8_t *cis_hdls)
|
||||||
|
{
|
||||||
|
btsnd_hcic_ble_iso_create_cis(cis_count, (struct ble_hci_cis_hdls *)cis_hdls);
|
||||||
|
|
||||||
|
return BTM_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleRemoveCig(uint8_t cig_id)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
tBTM_STATUS status = BTM_SUCCESS;
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_iso_remove_cig(cig_id)) != HCI_SUCCESS) {
|
||||||
|
BTM_TRACE_ERROR("iso remove cig, cmd err=0x%x", err);
|
||||||
|
status = BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
cb_params.btm_remove_cig.status = status;
|
||||||
|
cb_params.btm_remove_cig.cig_id = cig_id;
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_REMOVE_CIG_EVT, &cb_params);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
void btm_ble_accept_cis_req_cmd_status(tBTM_BLE_ISO_CB_PARAMS *cb_params)
|
||||||
|
{
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_ACCEPT_CIS_REQ_EVT, cb_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleAcceptCisReq(uint16_t cis_handle)
|
||||||
|
{
|
||||||
|
btsnd_hcic_ble_iso_accept_cis_req(cis_handle);
|
||||||
|
return BTM_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleRejectCisReq(uint16_t cis_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
tHCI_STATUS err = HCI_SUCCESS;
|
||||||
|
tBTM_STATUS status = BTM_SUCCESS;
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
|
||||||
|
if ((err = btsnd_hcic_ble_iso_reject_cis_req(cis_handle, reason)) != HCI_SUCCESS) {
|
||||||
|
BTM_TRACE_ERROR("iso reject cis req, cmd err=0x%x", err);
|
||||||
|
status = BTM_HCI_ERROR | err;
|
||||||
|
}
|
||||||
|
|
||||||
|
cb_params.btm_reject_cis_req.status = status;
|
||||||
|
cb_params.btm_reject_cis_req.cis_handle = cis_handle;
|
||||||
|
BTM_IsoBleCallbackTrigger(BTM_BLE_ISO_REJECT_CIS_REQ_EVT, &cb_params);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
tBTM_STATUS BTM_BleDisconCis(uint16_t cis_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
btsnd_hcic_disconnect(cis_handle, reason);
|
||||||
|
|
||||||
|
return BTM_SUCCESS;
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
@ -1216,7 +1216,7 @@ void btm_remove_sco_links (BD_ADDR bda)
|
|||||||
** Returns void
|
** Returns void
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void btm_sco_removed (UINT16 hci_handle, UINT8 reason)
|
BOOLEAN btm_sco_removed (UINT16 hci_handle, UINT8 reason)
|
||||||
{
|
{
|
||||||
#if (BTM_MAX_SCO_LINKS>0)
|
#if (BTM_MAX_SCO_LINKS>0)
|
||||||
tSCO_CONN *p = &btm_cb.sco_cb.sco_db[0];
|
tSCO_CONN *p = &btm_cb.sco_cb.sco_db[0];
|
||||||
@ -1240,10 +1240,11 @@ void btm_sco_removed (UINT16 hci_handle, UINT8 reason)
|
|||||||
p->esco.p_esco_cback = NULL; /* Deregister eSCO callback */
|
p->esco.p_esco_cback = NULL; /* Deregister eSCO callback */
|
||||||
(*p->p_disc_cb)(xx);
|
(*p->p_disc_cb)(xx);
|
||||||
|
|
||||||
return;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4594,10 +4594,10 @@ tBTM_STATUS btm_sec_disconnect (UINT16 handle, UINT8 reason)
|
|||||||
** Description This function is when a connection to the peer device is
|
** Description This function is when a connection to the peer device is
|
||||||
** dropped
|
** dropped
|
||||||
**
|
**
|
||||||
** Returns void
|
** Returns tBTM_SEC_DEV_REC is not NULL
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void btm_sec_disconnected (UINT16 handle, UINT8 reason)
|
BOOLEAN btm_sec_disconnected (UINT16 handle, UINT8 reason)
|
||||||
{
|
{
|
||||||
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev_by_handle (handle);
|
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev_by_handle (handle);
|
||||||
UINT8 old_pairing_flags = btm_cb.pairing_flags;
|
UINT8 old_pairing_flags = btm_cb.pairing_flags;
|
||||||
@ -4613,7 +4613,7 @@ void btm_sec_disconnected (UINT16 handle, UINT8 reason)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!p_dev_rec) {
|
if (!p_dev_rec) {
|
||||||
return;
|
return FALSE;
|
||||||
}
|
}
|
||||||
p_dev_rec->enc_init_by_we = FALSE;
|
p_dev_rec->enc_init_by_we = FALSE;
|
||||||
transport = (handle == p_dev_rec->hci_handle) ? BT_TRANSPORT_BR_EDR : BT_TRANSPORT_LE;
|
transport = (handle == p_dev_rec->hci_handle) ? BT_TRANSPORT_BR_EDR : BT_TRANSPORT_LE;
|
||||||
@ -4654,7 +4654,7 @@ void btm_sec_disconnected (UINT16 handle, UINT8 reason)
|
|||||||
if (p_dev_rec->sec_state == BTM_SEC_STATE_DISCONNECTING_BOTH) {
|
if (p_dev_rec->sec_state == BTM_SEC_STATE_DISCONNECTING_BOTH) {
|
||||||
p_dev_rec->sec_state = (transport == BT_TRANSPORT_LE) ?
|
p_dev_rec->sec_state = (transport == BT_TRANSPORT_LE) ?
|
||||||
BTM_SEC_STATE_DISCONNECTING : BTM_SEC_STATE_DISCONNECTING_BLE;
|
BTM_SEC_STATE_DISCONNECTING : BTM_SEC_STATE_DISCONNECTING_BLE;
|
||||||
return;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
p_dev_rec->sec_state = BTM_SEC_STATE_IDLE;
|
p_dev_rec->sec_state = BTM_SEC_STATE_IDLE;
|
||||||
@ -4690,6 +4690,7 @@ void btm_sec_disconnected (UINT16 handle, UINT8 reason)
|
|||||||
p_dev_rec->sec_bd_name, result);
|
p_dev_rec->sec_bd_name, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
@ -558,6 +558,32 @@ void btm_ble_periodic_adv_sync_establish_evt(tBTM_BLE_PERIOD_ADV_SYNC_ESTAB *par
|
|||||||
void btm_ble_periodic_adv_sync_trans_recv_evt(tBTM_BLE_PERIOD_ADV_SYNC_TRANS_RECV *params);
|
void btm_ble_periodic_adv_sync_trans_recv_evt(tBTM_BLE_PERIOD_ADV_SYNC_TRANS_RECV *params);
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
void btm_ble_cis_established_evt(tBTM_BLE_CIS_ESTABLISHED_CMPL *params);
|
||||||
|
void btm_ble_cis_disconnected_evt(tBTM_BLE_CIS_DISCON_CMPL *params);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
void btm_ble_iso_read_iso_tx_sync_complete(UINT8 *p);
|
||||||
|
void btm_ble_iso_read_iso_link_quality_complete(UINT8 *p);
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
void btm_ble_cis_request_evt(tBTM_BLE_CIS_REQUEST_CMPL *params);
|
||||||
|
void btm_ble_accept_cis_req_cmd_status(tBTM_BLE_ISO_CB_PARAMS *cb_params);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
void btm_ble_create_cis_cmd_status(tBTM_BLE_ISO_CB_PARAMS *cb_params);
|
||||||
|
void btm_ble_iso_set_cig_params_complete(UINT8 *p);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
void btm_ble_big_create_cmpl_evt(tBTM_BLE_BIG_CREATE_CMPL *param);
|
||||||
|
void btm_ble_big_terminate_cmpl_evt(tBTM_BLE_BIG_TERMINATE_CMPL *params);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
void btm_ble_big_sync_estab_evt(tBTM_BLE_BIG_SYNC_ESTAB_CMPL *params);
|
||||||
|
void btm_ble_big_sync_lost_evt(tBTM_BLE_BIG_SYNC_LOST_EVT *params);
|
||||||
|
void btm_ble_biginfo_adv_report_evt(tBTM_BLE_BIGINFO_ADV_REPORT_EVT *params);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
void btm_ble_iso_data_path_update_complete(UINT16 opcode, UINT8 hci_status, UINT16 conn_handle);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
/*
|
/*
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -1118,6 +1118,7 @@ void btm_read_phy_callback(uint8_t hci_status, uint16_t conn_handle, uint8_t tx_
|
|||||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
void btm_ble_periodic_adv_sync_trans_complete(UINT16 op_code, UINT8 hci_status, UINT16 conn_handle);
|
void btm_ble_periodic_adv_sync_trans_complete(UINT16 op_code, UINT8 hci_status, UINT16 conn_handle);
|
||||||
#endif
|
#endif
|
||||||
|
void btm_ble_big_sync_terminate_complete(UINT8 hci_status, UINT8 big_handle);
|
||||||
/* Internal functions provided by btm_sco.c
|
/* Internal functions provided by btm_sco.c
|
||||||
********************************************
|
********************************************
|
||||||
*/
|
*/
|
||||||
@ -1129,7 +1130,7 @@ void btm_esco_proc_conn_chg (UINT8 status, UINT16 handle, UINT8 tx_interval,
|
|||||||
UINT8 retrans_window, UINT16 rx_pkt_len,
|
UINT8 retrans_window, UINT16 rx_pkt_len,
|
||||||
UINT16 tx_pkt_len);
|
UINT16 tx_pkt_len);
|
||||||
void btm_sco_conn_req (BD_ADDR bda, DEV_CLASS dev_class, UINT8 link_type);
|
void btm_sco_conn_req (BD_ADDR bda, DEV_CLASS dev_class, UINT8 link_type);
|
||||||
void btm_sco_removed (UINT16 hci_handle, UINT8 reason);
|
BOOLEAN btm_sco_removed (UINT16 hci_handle, UINT8 reason);
|
||||||
void btm_sco_acl_removed (BD_ADDR bda);
|
void btm_sco_acl_removed (BD_ADDR bda);
|
||||||
void btm_route_sco_data (BT_HDR *p_msg);
|
void btm_route_sco_data (BT_HDR *p_msg);
|
||||||
BOOLEAN btm_is_sco_active (UINT16 handle);
|
BOOLEAN btm_is_sco_active (UINT16 handle);
|
||||||
@ -1209,7 +1210,7 @@ void btm_sec_auth_complete (UINT16 handle, UINT8 status);
|
|||||||
void btm_sec_encrypt_change (UINT16 handle, UINT8 status, UINT8 encr_enable);
|
void btm_sec_encrypt_change (UINT16 handle, UINT8 status, UINT8 encr_enable);
|
||||||
void btm_sec_connected (UINT8 *bda, UINT16 handle, UINT8 status, UINT8 enc_mode);
|
void btm_sec_connected (UINT8 *bda, UINT16 handle, UINT8 status, UINT8 enc_mode);
|
||||||
tBTM_STATUS btm_sec_disconnect (UINT16 handle, UINT8 reason);
|
tBTM_STATUS btm_sec_disconnect (UINT16 handle, UINT8 reason);
|
||||||
void btm_sec_disconnected (UINT16 handle, UINT8 reason);
|
BOOLEAN btm_sec_disconnected (UINT16 handle, UINT8 reason);
|
||||||
void btm_sec_rmt_name_request_complete (UINT8 *bd_addr, UINT8 *bd_name, UINT8 status);
|
void btm_sec_rmt_name_request_complete (UINT8 *bd_addr, UINT8 *bd_name, UINT8 status);
|
||||||
void btm_sec_rmt_host_support_feat_evt (UINT8 *p);
|
void btm_sec_rmt_host_support_feat_evt (UINT8 *p);
|
||||||
void btm_io_capabilities_req (UINT8 *p);
|
void btm_io_capabilities_req (UINT8 *p);
|
||||||
|
@ -174,10 +174,40 @@ static void btu_ble_scan_req_received_evt(UINT8 *p);
|
|||||||
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
|
||||||
static void btu_ble_channel_select_alg_evt(UINT8 *p);
|
static void btu_ble_channel_select_alg_evt(UINT8 *p);
|
||||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||||
|
|
||||||
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
static void btu_ble_periodic_adv_sync_trans_recv(UINT8 *p);
|
static void btu_ble_periodic_adv_sync_trans_recv(UINT8 *p);
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
void btu_ble_create_big_cmd_status(UINT8 status);
|
||||||
|
static void btu_ble_big_create_complete_evt(UINT8 *p);
|
||||||
|
void btu_ble_big_terminate_cmd_status(UINT8 status);
|
||||||
|
static void btu_ble_big_terminate_complete_evt(UINT8 *p);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
static void btu_ble_create_big_sync_cmd_status(UINT8 status);
|
||||||
|
static void btu_ble_big_sync_establish_evt(UINT8 *p);
|
||||||
|
static void btu_ble_big_sync_lost_evt(UINT8 *p);
|
||||||
|
static void btu_ble_biginfo_adv_report_evt(UINT8 *p);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
static void btu_ble_create_cis_cmd_status(UINT8 status);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
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_disconnected(UINT16 handle, UINT8 reason);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
#if (BLE_42_ADV_EN == TRUE)
|
#if (BLE_42_ADV_EN == TRUE)
|
||||||
extern osi_sem_t adv_enable_sem;
|
extern osi_sem_t adv_enable_sem;
|
||||||
extern osi_sem_t adv_data_sem;
|
extern osi_sem_t adv_data_sem;
|
||||||
@ -474,6 +504,38 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
|
|||||||
btu_ble_periodic_adv_sync_trans_recv(p);
|
btu_ble_periodic_adv_sync_trans_recv(p);
|
||||||
break;
|
break;
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
case HCI_BLE_CIS_ESTABLISHED_V1_EVT:
|
||||||
|
case HCI_BLE_CIS_ESTABLISHED_V2_EVT:
|
||||||
|
btu_ble_cis_established_evt(p);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
case HCI_BLE_CIS_REQUEST_EVT:
|
||||||
|
btu_ble_cis_request_evt(p);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
case HCI_BLE_BIG_CREATE_COMPLETE_EVT:
|
||||||
|
btu_ble_big_create_complete_evt(p);
|
||||||
|
break;
|
||||||
|
case HCI_BLE_BIG_TERMINATE_COMPLETE_EVT:
|
||||||
|
btu_ble_big_terminate_complete_evt(p);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
case HCI_BLE_BIG_SYNC_ESTABLISHED_EVT:
|
||||||
|
btu_ble_big_sync_establish_evt(p);
|
||||||
|
break;
|
||||||
|
case HCI_BLE_BIG_SYNC_LOST_EVT:
|
||||||
|
btu_ble_big_sync_lost_evt(p);
|
||||||
|
break;
|
||||||
|
case HCI_BLE_BIGINFO_ADV_REPORT_EVT:
|
||||||
|
btu_ble_biginfo_adv_report_evt(p);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* BLE_INCLUDED */
|
#endif /* BLE_INCLUDED */
|
||||||
@ -758,6 +820,7 @@ static void btu_hcif_disconnection_comp_evt (UINT8 *p)
|
|||||||
{
|
{
|
||||||
UINT16 handle;
|
UINT16 handle;
|
||||||
UINT8 reason;
|
UINT8 reason;
|
||||||
|
BOOLEAN dev_find = FALSE;
|
||||||
|
|
||||||
++p;
|
++p;
|
||||||
STREAM_TO_UINT16 (handle, p);
|
STREAM_TO_UINT16 (handle, p);
|
||||||
@ -765,9 +828,18 @@ static void btu_hcif_disconnection_comp_evt (UINT8 *p)
|
|||||||
|
|
||||||
handle = HCID_GET_HANDLE (handle);
|
handle = HCID_GET_HANDLE (handle);
|
||||||
|
|
||||||
btm_acl_disconnected(handle, reason);
|
dev_find = btm_acl_disconnected(handle, reason);
|
||||||
|
|
||||||
HCI_TRACE_WARNING("hcif disc complete: hdl 0x%x, rsn 0x%x", handle, reason);
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
// Not find device. it is iso handle
|
||||||
|
if (!dev_find) {
|
||||||
|
btu_ble_cis_disconnected(handle, reason);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
HCI_TRACE_WARNING("hcif disc complete: hdl 0x%x, rsn 0x%x dev_find %d", handle, reason, dev_find);
|
||||||
|
|
||||||
|
UNUSED(dev_find);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -1212,6 +1284,47 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
case HCI_BLE_BIG_TERMINATE_SYNC:
|
||||||
|
UINT16 big_handle;
|
||||||
|
STREAM_TO_UINT8(status, p);
|
||||||
|
STREAM_TO_UINT8(big_handle, p);
|
||||||
|
btm_ble_big_sync_terminate_complete(status, big_handle);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
case HCI_BLE_ISO_SET_DATA_PATH:
|
||||||
|
case HCI_BLE_ISO_REMOVE_DATA_PATH:
|
||||||
|
UINT16 conn_handle;
|
||||||
|
STREAM_TO_UINT8(status, p);
|
||||||
|
STREAM_TO_UINT16(conn_handle, p);
|
||||||
|
btm_ble_iso_data_path_update_complete(opcode, status, conn_handle);
|
||||||
|
break;
|
||||||
|
case HCI_BLE_ISO_READ_TX_SYNC:
|
||||||
|
btm_ble_iso_read_iso_tx_sync_complete(p);
|
||||||
|
break;
|
||||||
|
case HCI_BLE_ISO_READ_ISO_LINK_QUALITY:
|
||||||
|
btm_ble_iso_read_iso_link_quality_complete(p);
|
||||||
|
break;
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
case HCI_BLE_ISO_SET_CIG_PARAMS:
|
||||||
|
case HCI_BLE_ISO_SET_CIG_PARAMS_TEST:
|
||||||
|
btm_ble_iso_set_cig_params_complete(p);
|
||||||
|
break;
|
||||||
|
case HCI_BLE_ISO_REMOVE_CIG:
|
||||||
|
// do nothing
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
case HCI_BLE_ISO_ACCEPT_CIS_REQ:
|
||||||
|
case HCI_BLE_ISO_REJECT_CIS_REQ:
|
||||||
|
// do nothing
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
#endif /* (BLE_INCLUDED == TRUE) */
|
#endif /* (BLE_INCLUDED == TRUE) */
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
@ -1383,6 +1496,32 @@ static void btu_hcif_hdl_command_status (UINT16 opcode, UINT8 status, UINT8 *p_c
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
case HCI_BLE_CREATE_BIG:
|
||||||
|
case HCI_BLE_CREATE_BIG_TEST:
|
||||||
|
btu_ble_create_big_cmd_status(status);
|
||||||
|
break;
|
||||||
|
case HCI_BLE_TERMINATE_BIG:
|
||||||
|
btu_ble_big_terminate_cmd_status(status);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
case HCI_BLE_BIG_CREATE_SYNC:
|
||||||
|
btu_ble_create_big_sync_cmd_status(status);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
case HCI_BLE_ISO_CREATE_CIS:
|
||||||
|
btu_ble_create_cis_cmd_status(status);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
case HCI_BLE_ISO_ACCEPT_CIS_REQ:
|
||||||
|
btu_ble_accept_cis_req_cmd_status(status);
|
||||||
|
break;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
default:
|
default:
|
||||||
/* If command failed to start, we may need to tell BTM */
|
/* If command failed to start, we may need to tell BTM */
|
||||||
if (status != HCI_SUCCESS) {
|
if (status != HCI_SUCCESS) {
|
||||||
@ -2491,6 +2630,248 @@ static void btu_ble_periodic_adv_sync_trans_recv(UINT8 *p)
|
|||||||
}
|
}
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
static void btu_ble_create_cis_cmd_status(UINT8 status)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
if (status != HCI_SUCCESS) {
|
||||||
|
status = (BTM_HCI_ERROR | status);
|
||||||
|
}
|
||||||
|
cb_params.status = status;
|
||||||
|
btm_ble_create_cis_cmd_status(&cb_params);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
static void btu_ble_accept_cis_req_cmd_status(UINT8 status)
|
||||||
|
{
|
||||||
|
tBTM_BLE_ISO_CB_PARAMS cb_params = {0};
|
||||||
|
if (status != HCI_SUCCESS) {
|
||||||
|
status = (BTM_HCI_ERROR | status);
|
||||||
|
}
|
||||||
|
cb_params.status = status;
|
||||||
|
|
||||||
|
btm_ble_accept_cis_req_cmd_status(&cb_params);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
static void btu_ble_cis_disconnected(UINT16 handle, UINT8 reason)
|
||||||
|
{
|
||||||
|
tBTM_BLE_CIS_DISCON_CMPL cis_disconnected_evt = {0};
|
||||||
|
cis_disconnected_evt.cis_handle = handle;
|
||||||
|
cis_disconnected_evt.reason = reason;
|
||||||
|
btm_ble_cis_disconnected_evt(&cis_disconnected_evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void btu_ble_cis_established_evt(UINT8 *p)
|
||||||
|
{
|
||||||
|
HCI_TRACE_DEBUG("%s", __func__);
|
||||||
|
tBTM_BLE_CIS_ESTABLISHED_CMPL cis_estab_evt = {0};
|
||||||
|
|
||||||
|
if (!p) {
|
||||||
|
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
STREAM_TO_UINT8(cis_estab_evt.status, p);
|
||||||
|
STREAM_TO_UINT16(cis_estab_evt.conn_handle, p);
|
||||||
|
STREAM_TO_UINT24(cis_estab_evt.cig_sync_delay, p);
|
||||||
|
STREAM_TO_UINT24(cis_estab_evt.cis_sync_delay, p);
|
||||||
|
STREAM_TO_UINT24(cis_estab_evt.trans_lat_c_to_p, p);
|
||||||
|
STREAM_TO_UINT24(cis_estab_evt.trans_lat_p_to_c, p);
|
||||||
|
STREAM_TO_UINT8(cis_estab_evt.phy_c_to_p, p);
|
||||||
|
STREAM_TO_UINT8(cis_estab_evt.phy_p_to_c, p);
|
||||||
|
STREAM_TO_UINT8(cis_estab_evt.nse, p);
|
||||||
|
STREAM_TO_UINT8(cis_estab_evt.bn_c_to_p, p);
|
||||||
|
STREAM_TO_UINT8(cis_estab_evt.bn_p_to_c, p);
|
||||||
|
STREAM_TO_UINT8(cis_estab_evt.ft_c_to_p, p);
|
||||||
|
STREAM_TO_UINT8(cis_estab_evt.ft_p_to_c, p);
|
||||||
|
STREAM_TO_UINT16(cis_estab_evt.max_pdu_c_to_p, 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);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
|
||||||
|
btm_ble_cis_established_evt(&cis_estab_evt);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
static void btu_ble_cis_request_evt(UINT8 *p)
|
||||||
|
{
|
||||||
|
HCI_TRACE_DEBUG("%s", __func__);
|
||||||
|
tBTM_BLE_CIS_REQUEST_CMPL cis_req_evt = {0};
|
||||||
|
|
||||||
|
if (!p) {
|
||||||
|
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
STREAM_TO_UINT16(cis_req_evt.acl_handle, p);
|
||||||
|
STREAM_TO_UINT16(cis_req_evt.cis_handle, p);
|
||||||
|
STREAM_TO_UINT8(cis_req_evt.cig_id, p);
|
||||||
|
STREAM_TO_UINT8(cis_req_evt.cis_id, p);
|
||||||
|
|
||||||
|
|
||||||
|
btm_ble_cis_request_evt(&cis_req_evt);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
void btu_ble_create_big_cmd_status(UINT8 status)
|
||||||
|
{
|
||||||
|
if (status != HCI_SUCCESS) {
|
||||||
|
tBTM_BLE_BIG_CREATE_CMPL big_cmpl = {0};
|
||||||
|
btm_ble_big_create_cmpl_evt(&big_cmpl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void btu_ble_big_create_complete_evt(UINT8 *p)
|
||||||
|
{
|
||||||
|
HCI_TRACE_DEBUG("%s", __func__);
|
||||||
|
tBTM_BLE_BIG_CREATE_CMPL big_cmpl = {0};
|
||||||
|
|
||||||
|
if (!p) {
|
||||||
|
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
STREAM_TO_UINT8(big_cmpl.status, p);
|
||||||
|
STREAM_TO_UINT8(big_cmpl.big_handle, p);
|
||||||
|
STREAM_TO_UINT24(big_cmpl.big_sync_delay, p);
|
||||||
|
STREAM_TO_UINT24(big_cmpl.transport_latency, p);
|
||||||
|
STREAM_TO_UINT8(big_cmpl.phy, p);
|
||||||
|
STREAM_TO_UINT8(big_cmpl.nse, p);
|
||||||
|
STREAM_TO_UINT8(big_cmpl.bn, p);
|
||||||
|
STREAM_TO_UINT8(big_cmpl.pto, p);
|
||||||
|
STREAM_TO_UINT8(big_cmpl.irc, p);
|
||||||
|
STREAM_TO_UINT16(big_cmpl.max_pdu, p);
|
||||||
|
STREAM_TO_UINT16(big_cmpl.iso_interval, p);
|
||||||
|
STREAM_TO_UINT8(big_cmpl.num_bis, p);
|
||||||
|
for (uint8_t i = 0; i < big_cmpl.num_bis; i++)
|
||||||
|
{
|
||||||
|
STREAM_TO_UINT16(big_cmpl.bis_handle[i], p);
|
||||||
|
// only 12 bits meaningful
|
||||||
|
big_cmpl.bis_handle[i] = (big_cmpl.bis_handle[i] & 0x0FFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
btm_ble_big_create_cmpl_evt(&big_cmpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
void btu_ble_big_terminate_cmd_status(UINT8 status)
|
||||||
|
{
|
||||||
|
if (status != HCI_SUCCESS) {
|
||||||
|
tBTM_BLE_BIG_TERMINATE_CMPL big_term = {0};
|
||||||
|
big_term.status = (status | BTM_HCI_ERROR);
|
||||||
|
btm_ble_big_terminate_cmpl_evt(&big_term);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void btu_ble_big_terminate_complete_evt(UINT8 *p)
|
||||||
|
{
|
||||||
|
tBTM_BLE_BIG_TERMINATE_CMPL big_term = {0};
|
||||||
|
|
||||||
|
if (!p) {
|
||||||
|
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
STREAM_TO_UINT8(big_term.big_handle, p);
|
||||||
|
STREAM_TO_UINT8(big_term.reason, p);
|
||||||
|
big_term.status = HCI_SUCCESS;
|
||||||
|
|
||||||
|
btm_ble_big_terminate_cmpl_evt(&big_term);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
void btu_ble_create_big_sync_cmd_status(UINT8 status)
|
||||||
|
{
|
||||||
|
if (status != HCI_SUCCESS) {
|
||||||
|
tBTM_BLE_BIG_SYNC_ESTAB_CMPL big_estb = {0};
|
||||||
|
big_estb.status = status;
|
||||||
|
btm_ble_big_sync_estab_evt(&big_estb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void btu_ble_big_sync_establish_evt(UINT8 *p)
|
||||||
|
{
|
||||||
|
tBTM_BLE_BIG_SYNC_ESTAB_CMPL big_estb = {0};
|
||||||
|
|
||||||
|
if (!p) {
|
||||||
|
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
STREAM_TO_UINT8(big_estb.status, p);
|
||||||
|
STREAM_TO_UINT8(big_estb.big_handle, p);
|
||||||
|
STREAM_TO_UINT24(big_estb.transport_latency_big, p);
|
||||||
|
STREAM_TO_UINT8(big_estb.nse, p);
|
||||||
|
STREAM_TO_UINT8(big_estb.bn, p);
|
||||||
|
STREAM_TO_UINT8(big_estb.pto, p);
|
||||||
|
STREAM_TO_UINT8(big_estb.irc, p);
|
||||||
|
STREAM_TO_UINT16(big_estb.max_pdu, p);
|
||||||
|
STREAM_TO_UINT16(big_estb.iso_interval, p);
|
||||||
|
STREAM_TO_UINT8(big_estb.num_bis, p);
|
||||||
|
for (uint8_t i = 0; i < big_estb.num_bis; i++)
|
||||||
|
{
|
||||||
|
STREAM_TO_UINT16(big_estb.bis_handle[i], p);
|
||||||
|
}
|
||||||
|
|
||||||
|
btm_ble_big_sync_estab_evt(&big_estb);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void btu_ble_big_sync_lost_evt(UINT8 *p)
|
||||||
|
{
|
||||||
|
tBTM_BLE_BIG_SYNC_LOST_EVT big_sync_lost = {0};
|
||||||
|
|
||||||
|
if (!p) {
|
||||||
|
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
STREAM_TO_UINT8(big_sync_lost.big_handle, p);
|
||||||
|
STREAM_TO_UINT8(big_sync_lost.reason, p);
|
||||||
|
|
||||||
|
btm_ble_big_sync_lost_evt(&big_sync_lost);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void btu_ble_biginfo_adv_report_evt(UINT8 *p)
|
||||||
|
{
|
||||||
|
tBTM_BLE_BIGINFO_ADV_REPORT_EVT biginfo_report = {0};
|
||||||
|
|
||||||
|
if (!p) {
|
||||||
|
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
STREAM_TO_UINT16(biginfo_report.sync_handle, p);
|
||||||
|
STREAM_TO_UINT8(biginfo_report.num_bis, p);
|
||||||
|
STREAM_TO_UINT8(biginfo_report.nse, p);
|
||||||
|
STREAM_TO_UINT16(biginfo_report.iso_interval, p);
|
||||||
|
STREAM_TO_UINT8(biginfo_report.bn, p);
|
||||||
|
STREAM_TO_UINT8(biginfo_report.pto, p);
|
||||||
|
STREAM_TO_UINT8(biginfo_report.irc, p);
|
||||||
|
STREAM_TO_UINT16(biginfo_report.max_pdu, p);
|
||||||
|
STREAM_TO_UINT24(biginfo_report.sdu_interval, p);
|
||||||
|
STREAM_TO_UINT16(biginfo_report.max_sdu, p);
|
||||||
|
STREAM_TO_UINT8(biginfo_report.phy, p);
|
||||||
|
STREAM_TO_UINT8(biginfo_report.framing, p);
|
||||||
|
STREAM_TO_UINT8(biginfo_report.encryption, p);
|
||||||
|
|
||||||
|
btm_ble_biginfo_adv_report_evt(&biginfo_report);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
/**********************************************
|
/**********************************************
|
||||||
** End of BLE Events Handler
|
** End of BLE Events Handler
|
||||||
***********************************************/
|
***********************************************/
|
||||||
|
@ -1992,3 +1992,458 @@ BOOLEAN btsnd_hcic_ble_set_vendor_evt_mask (UINT32 evt_mask)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
UINT8 btsnd_hcic_ble_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
||||||
|
uint32_t sdu_interval, uint16_t max_sdu, uint16_t max_transport_latency,
|
||||||
|
uint8_t rtn, uint8_t phy, uint8_t packing, uint8_t framing,
|
||||||
|
uint8_t encryption, uint8_t *broadcast_code)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci big create: big_handle %d, adv_handle %d, num_bis %d sdu_interval %d max_sdu %d max_transport_latency %d \
|
||||||
|
rtn %d phy %d packing %d framing %d encryption %d", big_handle, adv_handle, num_bis, sdu_interval, max_sdu,\
|
||||||
|
max_transport_latency, rtn, phy, packing, framing, encryption);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_BIG_CREATE_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_CREATE_BIG);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BIG_CREATE_PARAMS);
|
||||||
|
|
||||||
|
UINT8_TO_STREAM(pp, big_handle);
|
||||||
|
UINT8_TO_STREAM(pp, adv_handle);
|
||||||
|
UINT8_TO_STREAM(pp, num_bis);
|
||||||
|
UINT24_TO_STREAM(pp, sdu_interval);
|
||||||
|
UINT16_TO_STREAM(pp, max_sdu);
|
||||||
|
UINT16_TO_STREAM(pp, max_transport_latency);
|
||||||
|
UINT8_TO_STREAM(pp, rtn);
|
||||||
|
UINT8_TO_STREAM(pp, phy);
|
||||||
|
UINT8_TO_STREAM(pp, packing);
|
||||||
|
UINT8_TO_STREAM(pp, framing);
|
||||||
|
UINT8_TO_STREAM(pp, encryption);
|
||||||
|
ARRAY_TO_STREAM(pp, broadcast_code, 16);
|
||||||
|
|
||||||
|
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_big_create_test(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
||||||
|
uint32_t sdu_interval, uint16_t iso_interval, uint8_t nse,
|
||||||
|
uint16_t max_sdu, uint16_t max_pdu, uint8_t phy,
|
||||||
|
uint8_t packing, uint8_t framing, uint8_t bn, uint8_t irc,
|
||||||
|
uint8_t pto, uint8_t encryption, uint8_t *broadcast_code)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("%s big_handle %d, adv_handle %d, num_bis %d sdu_interval %d max_sdu %d max_pdu %d iso_interval %d \
|
||||||
|
nse %d phy %d packing %d framing %d bn %d irc %dencryption %d", __func__, big_handle, adv_handle, num_bis, sdu_interval, max_sdu, max_pdu, \
|
||||||
|
iso_interval, nse, phy, packing, framing, bn, irc, encryption);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_BIG_CREATE_TEST_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_CREATE_BIG_TEST);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BIG_CREATE_TEST_PARAMS);
|
||||||
|
|
||||||
|
UINT8_TO_STREAM(pp, big_handle);
|
||||||
|
UINT8_TO_STREAM(pp, adv_handle);
|
||||||
|
UINT8_TO_STREAM(pp, num_bis);
|
||||||
|
UINT24_TO_STREAM(pp, sdu_interval);
|
||||||
|
UINT16_TO_STREAM(pp, iso_interval);
|
||||||
|
UINT8_TO_STREAM(pp, nse);
|
||||||
|
UINT16_TO_STREAM(pp, max_sdu);
|
||||||
|
UINT16_TO_STREAM(pp, max_pdu);
|
||||||
|
UINT8_TO_STREAM(pp, phy);
|
||||||
|
UINT8_TO_STREAM(pp, packing);
|
||||||
|
UINT8_TO_STREAM(pp, framing);
|
||||||
|
UINT8_TO_STREAM(pp, bn);
|
||||||
|
UINT8_TO_STREAM(pp, irc);
|
||||||
|
UINT8_TO_STREAM(pp, pto);
|
||||||
|
UINT8_TO_STREAM(pp, encryption);
|
||||||
|
ARRAY_TO_STREAM(pp, broadcast_code, 16);
|
||||||
|
|
||||||
|
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_big_terminate(uint8_t big_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("%s big_handle %d reason 0x%x", __func__, big_handle, reason);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_BIG_TERMINATE_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_TERMINATE_BIG);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BIG_TERMINATE_PARAMS);
|
||||||
|
|
||||||
|
UINT8_TO_STREAM(pp, big_handle);
|
||||||
|
UINT8_TO_STREAM(pp, reason);
|
||||||
|
|
||||||
|
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
UINT8 btsnd_hcic_ble_big_sync_create(uint8_t big_handle, uint16_t sync_handle,
|
||||||
|
uint8_t encryption, uint8_t *bc_code,
|
||||||
|
uint8_t mse, uint16_t big_sync_timeout,
|
||||||
|
uint8_t num_bis, uint8_t *bis)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("big sync create: big_handle %d sync_handle %d encryption %d mse %d big_sync_timeout %d", big_handle, sync_handle, encryption, mse, big_sync_timeout);
|
||||||
|
|
||||||
|
// for (uint8_t i = 0; i < num_bis; i++)
|
||||||
|
// {
|
||||||
|
// HCI_TRACE_ERROR("i %d bis %d", bis[i]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_BIG_SYNC_CREATE_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_BIG_CREATE_SYNC);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BIG_SYNC_CREATE_PARAMS);
|
||||||
|
|
||||||
|
UINT8_TO_STREAM(pp, big_handle);
|
||||||
|
UINT16_TO_STREAM(pp, sync_handle);
|
||||||
|
UINT8_TO_STREAM(pp, encryption);
|
||||||
|
ARRAY_TO_STREAM(pp, bc_code, 16);
|
||||||
|
UINT8_TO_STREAM(pp, mse);
|
||||||
|
UINT16_TO_STREAM(pp, big_sync_timeout);
|
||||||
|
UINT8_TO_STREAM(pp, num_bis);
|
||||||
|
ARRAY_TO_STREAM(pp, bis, num_bis);
|
||||||
|
|
||||||
|
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_big_sync_terminate(uint8_t big_handle)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("%s big_handle %d", __func__, big_handle);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_BIG_SYNC_TERMINATE_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_BIG_TERMINATE_SYNC);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BIG_SYNC_TERMINATE_PARAMS);
|
||||||
|
|
||||||
|
UINT8_TO_STREAM(pp, big_handle);
|
||||||
|
|
||||||
|
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
UINT8 btsnd_hcic_ble_iso_set_data_path(uint16_t conn_handle, uint8_t data_path_dir, uint8_t data_path_id, uint8_t coding_fmt,
|
||||||
|
uint16_t company_id, uint16_t vs_codec_id, uint32_t controller_delay, uint8_t codec_len,
|
||||||
|
uint8_t *codec_cfg)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci set data path: conn_handle %d data_path_dir %d data_path_id %d coding_fmt %d company_id 0x%x vs_codec_id %d controller_delay %ld codec_len %d",
|
||||||
|
conn_handle, data_path_dir, data_path_id, coding_fmt, company_id, vs_codec_id, controller_delay, codec_len);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_SET_DATA_PATH_PARAMS + codec_len);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_SET_DATA_PATH);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_SET_DATA_PATH_PARAMS + codec_len);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, conn_handle);
|
||||||
|
UINT8_TO_STREAM(pp, data_path_dir);
|
||||||
|
UINT8_TO_STREAM(pp, data_path_id);
|
||||||
|
UINT8_TO_STREAM(pp, coding_fmt);
|
||||||
|
UINT16_TO_STREAM(pp, company_id);
|
||||||
|
UINT16_TO_STREAM(pp, vs_codec_id);
|
||||||
|
UINT24_TO_STREAM(pp, controller_delay);
|
||||||
|
UINT8_TO_STREAM(pp, codec_len);
|
||||||
|
if (codec_len && codec_cfg) {
|
||||||
|
ARRAY_TO_STREAM(pp, codec_cfg, codec_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_remove_data_path(uint16_t conn_handle, uint8_t data_path_dir)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci remove data path: conn_handle %d data_path_dir %d", conn_handle, data_path_dir);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_REMOVE_DATA_PATH_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_REMOVE_DATA_PATH);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_REMOVE_DATA_PATH_PARAMS);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, conn_handle);
|
||||||
|
UINT8_TO_STREAM(pp, data_path_dir);
|
||||||
|
|
||||||
|
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_set_host_feature(uint16_t bit_num, uint8_t bit_val)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci set host feature: bit_num %d bit_val %d", bit_num, bit_val);
|
||||||
|
#if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_SET_HOST_FEATURE_PARAMS_V2);
|
||||||
|
#else
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_SET_HOST_FEATURE_PARAMS);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
#if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_SET_HOST_FEATURE_V2);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_SET_HOST_FEATURE_PARAMS_V2);
|
||||||
|
// Bit_Number V1
|
||||||
|
UINT16_TO_STREAM(pp, bit_num);
|
||||||
|
#else
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_SET_HOST_FEATURE);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_SET_HOST_FEATURE_PARAMS);
|
||||||
|
// Bit_Number V1
|
||||||
|
UINT8_TO_STREAM(pp, bit_num);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
UINT8_TO_STREAM(pp, bit_val);
|
||||||
|
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_read_tx_sync(uint16_t iso_hdl)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci read iso tx sync: iso_hdl %d", iso_hdl);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_READ_TX_SYNC_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_READ_TX_SYNC);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_READ_TX_SYNC_PARAMS);
|
||||||
|
// Bit_Number V1
|
||||||
|
UINT16_TO_STREAM(pp, iso_hdl);
|
||||||
|
|
||||||
|
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
}
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
UINT8 btsnd_hcic_ble_iso_set_cig_params(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t worse_case_SCA, uint8_t packing,
|
||||||
|
uint8_t framing, uint16_t mtl_c_to_p, uint16_t mtl_p_to_c, uint8_t cis_cnt, struct ble_hci_le_cis_params *cis_params)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci set cig params: cig_id %d sdu_int_c_to_p %d sdu_int_p_to_c %d worse_case_SCA %d packing %d framing %d mtl_c_to_p %d mtl_p_to_c %d cis_cnt %d",
|
||||||
|
cig_id, sdu_int_c_to_p, sdu_int_p_to_c, worse_case_SCA, packing, framing, mtl_c_to_p, mtl_p_to_c, cis_cnt);
|
||||||
|
UINT8 cis_param_len = cis_cnt * 9;
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_SET_CIG_PARAMS + cis_param_len);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_SET_CIG_PARAMS);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_SET_CIG_PARAMS + cis_param_len);
|
||||||
|
|
||||||
|
UINT8_TO_STREAM(pp, cig_id);
|
||||||
|
UINT24_TO_STREAM(pp, sdu_int_c_to_p);
|
||||||
|
UINT24_TO_STREAM(pp, sdu_int_p_to_c);
|
||||||
|
UINT8_TO_STREAM(pp, worse_case_SCA);
|
||||||
|
UINT8_TO_STREAM(pp, packing);
|
||||||
|
UINT8_TO_STREAM(pp, framing);
|
||||||
|
UINT16_TO_STREAM(pp, mtl_c_to_p);
|
||||||
|
UINT16_TO_STREAM(pp, mtl_p_to_c);
|
||||||
|
UINT8_TO_STREAM(pp, cis_cnt);
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < cis_cnt; i++)
|
||||||
|
{
|
||||||
|
UINT8_TO_STREAM(pp, cis_params[i].cis_id);
|
||||||
|
UINT16_TO_STREAM(pp, cis_params[i].max_sdu_c_to_p);
|
||||||
|
UINT16_TO_STREAM(pp, cis_params[i].max_sdu_p_to_c);
|
||||||
|
UINT8_TO_STREAM(pp, cis_params[i].phy_c_to_p);
|
||||||
|
UINT8_TO_STREAM(pp, cis_params[i].phy_p_to_c);
|
||||||
|
UINT8_TO_STREAM(pp, cis_params[i].rtn_c_to_p);
|
||||||
|
UINT8_TO_STREAM(pp, cis_params[i].rtn_p_to_c);
|
||||||
|
}
|
||||||
|
|
||||||
|
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_set_cig_params_test(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t ft_c_to_p, uint8_t ft_p_to_c,
|
||||||
|
uint16_t iso_interval, uint8_t worse_case_SCA, uint8_t packing, uint8_t framing, uint8_t cis_cnt,
|
||||||
|
struct ble_hci_le_cis_params_test *cis_params_test)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci set cig params test: cig_id %d sdu_int_c_to_p %d sdu_int_p_to_c %d ft_c_to_p %d ft_p_to_c %d iso_interval %d worse_case_SCA %d packing %d framing %d cis_cnt %d",
|
||||||
|
cig_id, sdu_int_c_to_p, sdu_int_p_to_c, ft_c_to_p, ft_p_to_c, iso_interval, worse_case_SCA, packing, framing, cis_cnt);
|
||||||
|
UINT8 cis_param_len = cis_cnt * 14;
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_SET_CIG_TEST_PARAMS + cis_param_len);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_SET_CIG_PARAMS_TEST);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_SET_CIG_TEST_PARAMS + cis_param_len);
|
||||||
|
|
||||||
|
UINT8_TO_STREAM(pp, cig_id);
|
||||||
|
UINT24_TO_STREAM(pp, sdu_int_c_to_p);
|
||||||
|
UINT24_TO_STREAM(pp, sdu_int_p_to_c);
|
||||||
|
UINT8_TO_STREAM(pp, ft_c_to_p);
|
||||||
|
UINT8_TO_STREAM(pp, ft_p_to_c);
|
||||||
|
UINT16_TO_STREAM(pp, iso_interval);
|
||||||
|
UINT8_TO_STREAM(pp, worse_case_SCA);
|
||||||
|
UINT8_TO_STREAM(pp, packing);
|
||||||
|
UINT8_TO_STREAM(pp, framing);
|
||||||
|
UINT8_TO_STREAM(pp, cis_cnt);
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < cis_cnt; i++)
|
||||||
|
{
|
||||||
|
UINT8_TO_STREAM(pp, cis_params_test[i].cis_id);
|
||||||
|
UINT8_TO_STREAM(pp, cis_params_test[i].nse);
|
||||||
|
UINT16_TO_STREAM(pp, cis_params_test[i].max_sdu_c_to_p);
|
||||||
|
UINT16_TO_STREAM(pp, cis_params_test[i].max_sdu_p_to_c);
|
||||||
|
UINT16_TO_STREAM(pp, cis_params_test[i].max_pdu_c_to_p);
|
||||||
|
UINT16_TO_STREAM(pp, cis_params_test[i].max_pdu_p_to_c);
|
||||||
|
UINT8_TO_STREAM(pp, cis_params_test[i].phy_c_to_p);
|
||||||
|
UINT8_TO_STREAM(pp, cis_params_test[i].phy_p_to_c);
|
||||||
|
UINT8_TO_STREAM(pp, cis_params_test[i].bn_c_to_p);
|
||||||
|
UINT8_TO_STREAM(pp, cis_params_test[i].bn_p_to_c);
|
||||||
|
}
|
||||||
|
|
||||||
|
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_create_cis(uint8_t cis_count, struct ble_hci_cis_hdls *cis_hdls)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci create cis: cig_id ", cis_count);
|
||||||
|
// for (uint8_t i = 0; i < cis_count; i++)
|
||||||
|
// {
|
||||||
|
// HCI_TRACE_ERROR("i %d cis_hdl %d acl_hdl %d", i, cis_hdls[i].cis_hdl, cis_hdls[i].acl_hdl);
|
||||||
|
// }
|
||||||
|
|
||||||
|
UINT8 cis_param_len = cis_count * 4;
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_CREATE_CIS_PARAMS + cis_param_len);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_CREATE_CIS);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_CREATE_CIS_PARAMS + cis_param_len);
|
||||||
|
|
||||||
|
UINT8_TO_STREAM(pp, cis_count);
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < cis_count; i++)
|
||||||
|
{
|
||||||
|
UINT16_TO_STREAM(pp, cis_hdls[i].cis_hdl);
|
||||||
|
UINT16_TO_STREAM(pp, cis_hdls[i].acl_hdl);
|
||||||
|
}
|
||||||
|
|
||||||
|
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_remove_cig(uint8_t cig_id)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci remove cig: cig_id %d", cig_id);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_REMOVE_CIG_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_REMOVE_CIG);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_REMOVE_CIG_PARAMS);
|
||||||
|
|
||||||
|
UINT8_TO_STREAM(pp, cig_id);
|
||||||
|
|
||||||
|
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
UINT8 btsnd_hcic_ble_iso_accept_cis_req(uint16_t cis_handle)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci accept cis req: cis_handle %d", cis_handle);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_ACCEPT_CIS_REQ_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_ACCEPT_CIS_REQ);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_ACCEPT_CIS_REQ_PARAMS);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, cis_handle);
|
||||||
|
|
||||||
|
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_reject_cis_req(uint16_t cis_handle, uint8_t reason)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci reject cis req: cis_handle %d reason %d", cis_handle, reason);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_REJECT_CIS_REQ_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_REJECT_CIS_REQ);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_REJECT_CIS_REQ_PARAMS);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, cis_handle);
|
||||||
|
UINT8_TO_STREAM(pp, reason);
|
||||||
|
|
||||||
|
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
}
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_read_iso_link_quality(uint16_t iso_handle)
|
||||||
|
{
|
||||||
|
BT_HDR *p;
|
||||||
|
UINT8 *pp;
|
||||||
|
|
||||||
|
HCI_TRACE_DEBUG("hci read iso link quality: cis_handle %d", iso_handle);
|
||||||
|
|
||||||
|
HCIC_BLE_CMD_CREATED(p, pp, HCIC_PARAM_SIZE_ISO_READ_LINK_QUALITY_PARAMS);
|
||||||
|
|
||||||
|
pp = (UINT8 *)(p + 1);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, HCI_BLE_ISO_READ_ISO_LINK_QUALITY);
|
||||||
|
UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ISO_READ_LINK_QUALITY_PARAMS);
|
||||||
|
|
||||||
|
UINT16_TO_STREAM(pp, iso_handle);
|
||||||
|
|
||||||
|
return btu_hcif_send_cmd_sync(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
@ -10,6 +10,6 @@
|
|||||||
#include "bt_common.h"
|
#include "bt_common.h"
|
||||||
|
|
||||||
void btm_acl_connected(BD_ADDR bda, UINT16 handle, UINT8 link_type, UINT8 enc_mode, UINT8 status);
|
void btm_acl_connected(BD_ADDR bda, UINT16 handle, UINT8 link_type, UINT8 enc_mode, UINT8 status);
|
||||||
void btm_acl_disconnected(UINT16 handle, UINT8 reason);
|
BOOLEAN btm_acl_disconnected(UINT16 handle, UINT8 reason);
|
||||||
|
|
||||||
#endif /* ACL_HCI_LINK_INTERFACE_H */
|
#endif /* ACL_HCI_LINK_INTERFACE_H */
|
||||||
|
@ -1072,9 +1072,41 @@ typedef void (tBTM_SET_VENDOR_EVT_MASK_CBACK) (tBTM_STATUS status);
|
|||||||
#define BTM_BLE_GAP_PERIODIC_ADV_SYNC_TRANS_RECV_EVT 39
|
#define BTM_BLE_GAP_PERIODIC_ADV_SYNC_TRANS_RECV_EVT 39
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
#define BTM_BLE_GAP_SET_PRIVACY_MODE_COMPLETE_EVT 40
|
#define BTM_BLE_GAP_SET_PRIVACY_MODE_COMPLETE_EVT 40
|
||||||
#define BTM_BLE_5_GAP_UNKNOWN_EVT 41
|
#define BTM_BLE_5_GAP_UNKNOWN_EVT 50
|
||||||
typedef UINT8 tBTM_BLE_5_GAP_EVENT;
|
typedef UINT8 tBTM_BLE_5_GAP_EVENT;
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#define BTM_BLE_ISO_BIG_CREATE_COMPLETE_EVT 1
|
||||||
|
#define BTM_BLE_ISO_BIG_TERMINATE_COMPLETE_EVT 2
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#define BTM_BLE_ISO_BIG_SYNC_ESTABLISHED_EVT 3
|
||||||
|
#define BTM_BLE_ISO_BIG_SYNC_LOST_EVT 4
|
||||||
|
#define BTM_BLE_ISO_BIG_SYNC_TERMINATE_COMPLETE_EVT 5
|
||||||
|
#define BTM_BLE_ISO_BIGINFO_ADV_REPORT_EVT 6
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#define BTM_BLE_ISO_DATA_PATH_UPFATE_EVT 7
|
||||||
|
#define BTM_BLE_ISO_SET_HOST_FEATURE_EVT 8
|
||||||
|
#define BTM_BLE_ISO_READ_TX_SYNC_EVT 9
|
||||||
|
#define BTM_BLE_ISO_READ_LINK_QUALITY_EVT 10
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#define BTM_BLE_ISO_SET_CIG_PARAMS_EVT 11
|
||||||
|
#define BTM_BLE_ISO_CREATE_CIS_EVT 12
|
||||||
|
#define BTM_BLE_ISO_REMOVE_CIG_EVT 13
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#define BTM_BLE_ISO_ACCEPT_CIS_REQ_EVT 14
|
||||||
|
#define BTM_BLE_ISO_REJECT_CIS_REQ_EVT 15
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#define BTM_BLE_ISO_CIS_ESTABLISHED_EVT 16
|
||||||
|
#define BTM_BLE_ISO_CIS_REQUEST_EVT 17
|
||||||
|
#define BTM_BLE_ISO_CIS_DISCONNECTED_EVT 18
|
||||||
|
#define BTM_BLE_ISO_UNKNOWN_EVT 19
|
||||||
|
typedef UINT8 tBTM_BLE_ISO_EVENT;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
|
|
||||||
#define BTM_BLE_EXT_ADV_DATA_COMPLETE 0x00
|
#define BTM_BLE_EXT_ADV_DATA_COMPLETE 0x00
|
||||||
#define BTM_BLE_EXT_ADV_DATA_INCOMPLETE 0x01
|
#define BTM_BLE_EXT_ADV_DATA_INCOMPLETE 0x01
|
||||||
#define BTM_BLE_EXT_ADV_DATA_TRUNCATED 0x02
|
#define BTM_BLE_EXT_ADV_DATA_TRUNCATED 0x02
|
||||||
@ -1328,6 +1360,204 @@ typedef struct {
|
|||||||
} tBTM_BLE_PERIOD_ADV_SYNC_TRANS_RECV;
|
} tBTM_BLE_PERIOD_ADV_SYNC_TRANS_RECV;
|
||||||
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
UINT8 big_handle;
|
||||||
|
UINT32 big_sync_delay;
|
||||||
|
UINT32 transport_latency;
|
||||||
|
UINT8 phy;
|
||||||
|
UINT8 nse;
|
||||||
|
UINT8 bn;
|
||||||
|
UINT8 pto;
|
||||||
|
UINT8 irc;
|
||||||
|
UINT16 max_pdu;
|
||||||
|
UINT16 iso_interval;
|
||||||
|
UINT8 num_bis;
|
||||||
|
UINT16 bis_handle[BLE_ISO_BIS_MAX_COUNT];
|
||||||
|
} tBTM_BLE_BIG_CREATE_CMPL;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
UINT8 big_handle;
|
||||||
|
UINT8 reason;
|
||||||
|
} tBTM_BLE_BIG_TERMINATE_CMPL;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
UINT8 big_handle;
|
||||||
|
UINT32 transport_latency_big;
|
||||||
|
UINT8 nse;
|
||||||
|
UINT8 bn;
|
||||||
|
UINT8 pto;
|
||||||
|
UINT8 irc;
|
||||||
|
UINT16 max_pdu;
|
||||||
|
UINT16 iso_interval;
|
||||||
|
uint8_t num_bis;
|
||||||
|
uint16_t bis_handle[BLE_ISO_BIS_MAX_COUNT];
|
||||||
|
} tBTM_BLE_BIG_SYNC_ESTAB_CMPL;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT8 big_handle;
|
||||||
|
UINT8 reason;
|
||||||
|
} tBTM_BLE_BIG_SYNC_LOST_EVT;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT16 sync_handle;
|
||||||
|
UINT8 num_bis;
|
||||||
|
UINT8 nse;
|
||||||
|
UINT16 iso_interval;
|
||||||
|
UINT8 bn;
|
||||||
|
UINT8 pto;
|
||||||
|
UINT8 irc;
|
||||||
|
UINT16 max_pdu;
|
||||||
|
UINT32 sdu_interval;
|
||||||
|
UINT32 max_sdu;
|
||||||
|
UINT8 phy;
|
||||||
|
UINT8 framing;
|
||||||
|
UINT8 encryption;
|
||||||
|
} tBTM_BLE_BIGINFO_ADV_REPORT_EVT;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
UINT16 big_hdl;
|
||||||
|
} tBTM_BLE_BIG_SYNC_TERMINATE_EVT;
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
UINT16 conn_handle;
|
||||||
|
UINT32 cig_sync_delay;
|
||||||
|
UINT32 cis_sync_delay;
|
||||||
|
UINT32 trans_lat_c_to_p;
|
||||||
|
UINT32 trans_lat_p_to_c;
|
||||||
|
UINT8 phy_c_to_p;
|
||||||
|
UINT8 phy_p_to_c;
|
||||||
|
UINT8 nse;
|
||||||
|
UINT8 bn_c_to_p;
|
||||||
|
UINT8 bn_p_to_c;
|
||||||
|
UINT8 ft_c_to_p;
|
||||||
|
UINT8 ft_p_to_c;
|
||||||
|
UINT16 max_pdu_c_to_p;
|
||||||
|
UINT16 max_pdu_p_to_c;
|
||||||
|
UINT16 iso_interval;
|
||||||
|
#if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
UINT32 sub_interval;
|
||||||
|
UINT16 max_sdu_c_to_p;
|
||||||
|
UINT16 max_sdu_p_to_c;
|
||||||
|
UINT32 sdu_int_c_to_p;
|
||||||
|
UINT32 sdu_int_p_to_c;
|
||||||
|
UINT8 framing;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_60_EN == TRUE)
|
||||||
|
} tBTM_BLE_CIS_ESTABLISHED_CMPL;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT16 cis_handle;
|
||||||
|
UINT8 reason;
|
||||||
|
} tBTM_BLE_CIS_DISCON_CMPL;
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
UINT16 cis_handle;
|
||||||
|
} tBTM_BLE_ISO_REJECT_CIS_REQ_EVT;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT16 acl_handle;
|
||||||
|
UINT16 cis_handle;
|
||||||
|
UINT8 cig_id;
|
||||||
|
UINT8 cis_id;
|
||||||
|
} tBTM_BLE_CIS_REQUEST_CMPL;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
BTM_BLE_ISO_DATA_PATH_UNKNOWN = 0,
|
||||||
|
BTM_BLE_ISO_DATA_PATH_SETUP = 1,
|
||||||
|
BTM_BLE_ISO_DATA_PATH_REMOVE = 2,
|
||||||
|
BTM_BLE_ISO_DATA_PATH_MAX,
|
||||||
|
} tBTM_BLE_ISO_DATA_PATH_UPDATE_TYPE;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
tBTM_BLE_ISO_DATA_PATH_UPDATE_TYPE op_type;
|
||||||
|
UINT16 conn_hdl;
|
||||||
|
} tBTM_BLE_ISO_DATA_PATH_UPDATE_EVT;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
UINT16 conn_hdl;
|
||||||
|
UINT16 pkt_seq_num;
|
||||||
|
UINT32 tx_time_stamp;
|
||||||
|
UINT32 time_offset;
|
||||||
|
} tBTM_BLE_ISO_READ_TX_SYNC_EVT;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
UINT16 conn_hdl;
|
||||||
|
UINT32 tx_unacked_pkts;
|
||||||
|
UINT32 tx_flushed_pkts;
|
||||||
|
UINT32 tx_last_subevt_pkts;
|
||||||
|
UINT32 retransmitted_pkts;
|
||||||
|
UINT32 crc_error_pkts;
|
||||||
|
UINT32 rx_unreceived_pkts;
|
||||||
|
UINT32 duplicate_pkts;
|
||||||
|
} tBTM_BLE_ISO_READ_LINK_QUALITY_EVT;
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
UINT8 cig_id;
|
||||||
|
UINT8 cis_count;
|
||||||
|
UINT16 conn_hdl[BLE_ISO_CIS_MAX_COUNT];
|
||||||
|
} tBTM_BLE_ISO_SET_CIG_PARAMS_EVT;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINT8 status;
|
||||||
|
UINT8 cig_id;
|
||||||
|
} tBTM_BLE_ISO_REMOVE_CIG_EVT;
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
typedef union {
|
||||||
|
UINT8 status;
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
tBTM_BLE_BIG_CREATE_CMPL btm_big_cmpl;
|
||||||
|
tBTM_BLE_BIG_TERMINATE_CMPL btm_big_term;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
tBTM_BLE_BIG_SYNC_ESTAB_CMPL btm_big_sync_estab;
|
||||||
|
tBTM_BLE_BIG_SYNC_LOST_EVT btm_big_sync_lost;
|
||||||
|
tBTM_BLE_BIGINFO_ADV_REPORT_EVT btm_biginfo_report;
|
||||||
|
tBTM_BLE_BIG_SYNC_TERMINATE_EVT btm_big_sync_ter;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
tBTM_BLE_ISO_DATA_PATH_UPDATE_EVT btm_data_path_update;
|
||||||
|
tBTM_BLE_ISO_READ_TX_SYNC_EVT btm_read_tx_sync;
|
||||||
|
tBTM_BLE_ISO_READ_LINK_QUALITY_EVT btm_read_link_quality;
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
tBTM_BLE_ISO_SET_CIG_PARAMS_EVT btm_set_cig_params;
|
||||||
|
tBTM_BLE_ISO_REMOVE_CIG_EVT btm_remove_cig;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
tBTM_BLE_ISO_REJECT_CIS_REQ_EVT btm_reject_cis_req;
|
||||||
|
tBTM_BLE_CIS_REQUEST_CMPL btm_cis_request_evt;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
tBTM_BLE_CIS_ESTABLISHED_CMPL btm_cis_established_evt;
|
||||||
|
tBTM_BLE_CIS_DISCON_CMPL btm_cis_disconnectd_evt;
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
} tBTM_BLE_ISO_CB_PARAMS;
|
||||||
|
|
||||||
|
typedef void (*tBTM_BLE_ISO_CBACK)(tBTM_BLE_ISO_EVENT event, tBTM_BLE_ISO_CB_PARAMS *params);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
UINT8 status;
|
UINT8 status;
|
||||||
tBTM_BLE_READ_PHY_CMPL read_phy;
|
tBTM_BLE_READ_PHY_CMPL read_phy;
|
||||||
@ -2834,4 +3064,54 @@ void BTM_BlePeriodicAdvSetInfoTrans(BD_ADDR bd_addr, UINT16 service_data, UINT8
|
|||||||
void BTM_BleSetPeriodicAdvSyncTransParams(BD_ADDR bd_addr, UINT8 mode, UINT16 skip, UINT16 sync_timeout, UINT8 cte_type);
|
void BTM_BleSetPeriodicAdvSyncTransParams(BD_ADDR bd_addr, UINT8 mode, UINT16 skip, UINT16 sync_timeout, UINT8 cte_type);
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
void BTM_BleIsoRegisterCallback(tBTM_BLE_ISO_CBACK cb);
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
tBTM_STATUS BTM_BleBigCreate(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
||||||
|
uint32_t sdu_interval, uint16_t max_sdu, uint16_t max_transport_latency,
|
||||||
|
uint8_t rtn, uint8_t phy, uint8_t packing, uint8_t framing,
|
||||||
|
uint8_t encryption, uint8_t *broadcast_code);
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleBigCreateTest(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
||||||
|
uint32_t sdu_interval, uint16_t iso_interval, uint8_t nse,
|
||||||
|
uint16_t max_sdu, uint16_t max_pdu, uint8_t phy,
|
||||||
|
uint8_t packing, uint8_t framing, uint8_t bn, uint8_t irc,
|
||||||
|
uint8_t pto, uint8_t encryption, uint8_t *broadcast_code);
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleBigTerminate(UINT8 big_handle, UINT8 reason);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
tBTM_STATUS BTM_BleBigSyncCreate(uint8_t big_handle, uint16_t sync_handle,
|
||||||
|
uint8_t encryption, uint8_t *bc_code,
|
||||||
|
uint8_t mse, uint16_t big_sync_timeout,
|
||||||
|
uint8_t num_bis, uint8_t *bis);
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleBigSyncTerminate(uint8_t big_handle);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
tBTM_STATUS BTM_BleIsoSetDataPath(uint16_t conn_handle, uint8_t data_path_dir, uint8_t data_path_id, uint8_t coding_fmt,
|
||||||
|
uint16_t company_id, uint16_t vs_codec_id, uint32_t controller_delay, uint8_t codec_len,
|
||||||
|
uint8_t *codec_cfg);
|
||||||
|
tBTM_STATUS BTM_BleIsoRemoveDataPath(uint16_t conn_handle, uint8_t data_path_dir);
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleIsoSetHostFeature(uint16_t bit_num, uint8_t bit_val);
|
||||||
|
|
||||||
|
tBTM_STATUS BTM_BleIsoReadTxSync(uint16_t iso_hdl);
|
||||||
|
tBTM_STATUS BTM_BleIsoReadLinkQuality(uint16_t iso_hdl);
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
tBTM_STATUS BTM_BleSetCigParams(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t worse_case_SCA, uint8_t packing,
|
||||||
|
uint8_t framing, uint16_t mtl_c_to_p, uint16_t mtl_p_to_c, uint8_t cis_cnt, uint8_t *cis_params);
|
||||||
|
tBTM_STATUS BTM_BleSetCigParamsTest(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t ft_c_to_p, uint8_t ft_p_to_c, uint16_t iso_interval,
|
||||||
|
uint8_t worse_case_SCA, uint8_t packing, uint8_t framing, uint8_t cis_cnt, uint8_t *cis_params);
|
||||||
|
tBTM_STATUS BTM_BleCreateCis(uint8_t cis_count, uint8_t *cis_hdls);
|
||||||
|
tBTM_STATUS BTM_BleRemoveCig(uint8_t cig_id);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
tBTM_STATUS BTM_BleAcceptCisReq(uint16_t cis_handle);
|
||||||
|
tBTM_STATUS BTM_BleRejectCisReq(uint16_t cis_handle, uint8_t reason);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
tBTM_STATUS BTM_BleDisconCis(uint16_t cis_handle, uint8_t reason);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_EN == TRUE)
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
#endif
|
#endif
|
||||||
|
@ -397,6 +397,24 @@
|
|||||||
#define HCI_BLE_SET_PAST_PARAMS (0x005C | HCI_GRP_BLE_CMDS)
|
#define HCI_BLE_SET_PAST_PARAMS (0x005C | HCI_GRP_BLE_CMDS)
|
||||||
#define HCI_BLE_SET_DEFAULT_PAST_PARAMS (0x005D | HCI_GRP_BLE_CMDS)
|
#define HCI_BLE_SET_DEFAULT_PAST_PARAMS (0x005D | HCI_GRP_BLE_CMDS)
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
#define HCI_BLE_READ_BUFFER_SZIE_V2 (0x0060 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_READ_TX_SYNC (0x0061 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_SET_CIG_PARAMS (0x0062 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_SET_CIG_PARAMS_TEST (0x0063 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_CREATE_CIS (0x0064 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_REMOVE_CIG (0x0065 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_ACCEPT_CIS_REQ (0x0066 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_REJECT_CIS_REQ (0x0067 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_CREATE_BIG (0x0068 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_CREATE_BIG_TEST (0x0069 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_TERMINATE_BIG (0x006A | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_BIG_CREATE_SYNC (0x006B | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_BIG_TERMINATE_SYNC (0x006C | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_SET_DATA_PATH (0x006E | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_REMOVE_DATA_PATH (0x006F | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_SET_HOST_FEATURE (0x0074 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_READ_ISO_LINK_QUALITY (0x0075 | HCI_GRP_BLE_CMDS)
|
||||||
|
#define HCI_BLE_ISO_SET_HOST_FEATURE_V2 (0x0097 | HCI_GRP_BLE_CMDS)
|
||||||
// Vendor OGF define
|
// Vendor OGF define
|
||||||
#define HCI_VENDOR_OGF 0x3F
|
#define HCI_VENDOR_OGF 0x3F
|
||||||
|
|
||||||
@ -842,6 +860,21 @@
|
|||||||
#define HCI_BLE_PERIOD_ADV_SYNC_TRANS_RECV_EVT 0x18
|
#define HCI_BLE_PERIOD_ADV_SYNC_TRANS_RECV_EVT 0x18
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#define HCI_BLE_CIS_ESTABLISHED_V1_EVT 0x19
|
||||||
|
#define HCI_BLE_CIS_REQUEST_EVT 0x1A
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#define HCI_BLE_BIG_CREATE_COMPLETE_EVT 0x1B
|
||||||
|
#define HCI_BLE_BIG_TERMINATE_COMPLETE_EVT 0x1C
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#define HCI_BLE_BIG_SYNC_ESTABLISHED_EVT 0x1D
|
||||||
|
#define HCI_BLE_BIG_SYNC_LOST_EVT 0x1E
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#define HCI_BLE_BIGINFO_ADV_REPORT_EVT 0x22
|
||||||
|
#define HCI_BLE_CIS_ESTABLISHED_V2_EVT 0x2A
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
|
||||||
/* Definitions for LE Channel Map */
|
/* Definitions for LE Channel Map */
|
||||||
#define HCI_BLE_CHNL_MAP_SIZE 5
|
#define HCI_BLE_CHNL_MAP_SIZE 5
|
||||||
|
|
||||||
|
@ -1083,4 +1083,106 @@ BOOLEAN btsnd_hcic_ble_set_periodic_adv_sync_trans_params(UINT16 conn_handle, UI
|
|||||||
UINT8 btsnd_hcic_ble_set_default_periodic_adv_sync_trans_params(UINT8 mode, UINT16 skip, UINT16 sync_timeout, UINT8 cte_type);
|
UINT8 btsnd_hcic_ble_set_default_periodic_adv_sync_trans_params(UINT8 mode, UINT16 skip, UINT16 sync_timeout, UINT8 cte_type);
|
||||||
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_READ_TX_SYNC_PARAMS 2
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_SET_CIG_PARAMS 15
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_SET_CIG_TEST_PARAMS 15
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_CREATE_CIS_PARAMS 1
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_REMOVE_CIG_PARAMS 1
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_ACCEPT_CIS_REQ_PARAMS 2
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_REJECT_CIS_REQ_PARAMS 3
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_READ_LINK_QUALITY_PARAMS 2
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#define HCIC_PARAM_SIZE_BIG_CREATE_PARAMS 31
|
||||||
|
#define HCIC_PARAM_SIZE_BIG_CREATE_TEST_PARAMS 36
|
||||||
|
#define HCIC_PARAM_SIZE_BIG_TERMINATE_PARAMS 2
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#define HCIC_PARAM_SIZE_BIG_SYNC_CREATE_PARAMS 55
|
||||||
|
#define HCIC_PARAM_SIZE_BIG_SYNC_TERMINATE_PARAMS 1
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_SET_DATA_PATH_PARAMS 13
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_REMOVE_DATA_PATH_PARAMS 3
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_SET_HOST_FEATURE_PARAMS 2
|
||||||
|
#define HCIC_PARAM_SIZE_ISO_SET_HOST_FEATURE_PARAMS_V2 3
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
struct ble_hci_le_cis_params {
|
||||||
|
uint8_t cis_id;
|
||||||
|
uint16_t max_sdu_c_to_p;
|
||||||
|
uint16_t max_sdu_p_to_c;
|
||||||
|
uint8_t phy_c_to_p;
|
||||||
|
uint8_t phy_p_to_c;
|
||||||
|
uint8_t rtn_c_to_p;
|
||||||
|
uint8_t rtn_p_to_c;
|
||||||
|
} __attribute__((packed));
|
||||||
|
struct ble_hci_le_cis_params_test {
|
||||||
|
uint8_t cis_id;
|
||||||
|
uint8_t nse;
|
||||||
|
uint16_t max_sdu_c_to_p;
|
||||||
|
uint16_t max_sdu_p_to_c;
|
||||||
|
uint16_t max_pdu_c_to_p;
|
||||||
|
uint16_t max_pdu_p_to_c;
|
||||||
|
uint8_t phy_c_to_p;
|
||||||
|
uint8_t phy_p_to_c;
|
||||||
|
uint8_t bn_c_to_p;
|
||||||
|
uint8_t bn_p_to_c;
|
||||||
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
|
||||||
|
struct ble_hci_cis_hdls {
|
||||||
|
uint16_t cis_hdl;
|
||||||
|
uint16_t acl_hdl;
|
||||||
|
}__attribute__((packed));
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_set_cig_params(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t worse_case_SCA, uint8_t packing,
|
||||||
|
uint8_t framing, uint16_t mtl_c_to_p, uint16_t mtl_p_to_c, uint8_t cis_cnt, struct ble_hci_le_cis_params *cis_params);
|
||||||
|
UINT8 btsnd_hcic_ble_iso_set_cig_params_test(uint8_t cig_id, uint32_t sdu_int_c_to_p, uint32_t sdu_int_p_to_c, uint8_t ft_c_to_p, uint8_t ft_p_to_c,
|
||||||
|
uint16_t iso_interval, uint8_t worse_case_SCA, uint8_t packing, uint8_t framing, uint8_t cis_cnt,
|
||||||
|
struct ble_hci_le_cis_params_test *cis_params_test);
|
||||||
|
UINT8 btsnd_hcic_ble_iso_create_cis(uint8_t cis_count, struct ble_hci_cis_hdls *cis_hdls);
|
||||||
|
UINT8 btsnd_hcic_ble_iso_remove_cig(uint8_t cig_id);
|
||||||
|
#endif // (BLE_FEAT_ISO_CIG_CENTRAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
UINT8 btsnd_hcic_ble_iso_accept_cis_req(uint16_t cis_handle);
|
||||||
|
UINT8 btsnd_hcic_ble_iso_reject_cis_req(uint16_t cis_handle, uint8_t reason);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_CIG_PERIPHERAL_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
UINT8 btsnd_hcic_ble_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
||||||
|
uint32_t sdu_interval, uint16_t max_sdu, uint16_t max_transport_latency,
|
||||||
|
uint8_t rtn, uint8_t phy, uint8_t packing, uint8_t framing,
|
||||||
|
uint8_t encryption, uint8_t *broadcast_code);
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_big_create_test(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
||||||
|
uint32_t sdu_interval, uint16_t iso_interval, uint8_t nse,
|
||||||
|
uint16_t max_sdu, uint16_t max_pdu, uint8_t phy,
|
||||||
|
uint8_t packing, uint8_t framing, uint8_t bn, uint8_t irc,
|
||||||
|
uint8_t pto, uint8_t encryption, uint8_t *broadcast_code);
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_big_terminate(uint8_t big_handle, uint8_t reason);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE)
|
||||||
|
|
||||||
|
#if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
UINT8 btsnd_hcic_ble_big_sync_create(uint8_t big_handle, uint16_t sync_handle,
|
||||||
|
uint8_t encryption, uint8_t *bc_code,
|
||||||
|
uint8_t mse, uint16_t big_sync_timeout,
|
||||||
|
uint8_t num_bis, uint8_t *bis);
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_big_sync_terminate(uint8_t big_handle);
|
||||||
|
#endif // #if (BLE_FEAT_ISO_BIG_SYNCER_EN == TRUE)
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_set_data_path(uint16_t conn_handle, uint8_t data_path_dir, uint8_t data_path_id, uint8_t coding_fmt,
|
||||||
|
uint16_t company_id, uint16_t vs_codec_id, uint32_t controller_delay, uint8_t codec_len,
|
||||||
|
uint8_t *codec_cfg);
|
||||||
|
UINT8 btsnd_hcic_ble_iso_remove_data_path(uint16_t conn_handle, uint8_t data_path_dir);
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_set_host_feature(uint16_t bit_num, uint8_t bit_val);
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_read_tx_sync(uint16_t iso_hdl);
|
||||||
|
|
||||||
|
UINT8 btsnd_hcic_ble_iso_read_iso_link_quality(uint16_t iso_hdl);
|
||||||
|
|
||||||
|
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
|
||||||
#endif
|
#endif
|
||||||
|
@ -209,7 +209,12 @@ void bt_record_hci_data(uint8_t *data, uint16_t len)
|
|||||||
|| (data[3] == BLE_HCI_LE_SUBEV_EXT_ADV_RPT) || (data[3] == BLE_HCI_LE_SUBEV_PERIODIC_ADV_RPT))) {
|
|| (data[3] == BLE_HCI_LE_SUBEV_EXT_ADV_RPT) || (data[3] == BLE_HCI_LE_SUBEV_PERIODIC_ADV_RPT))) {
|
||||||
bt_hci_log_record_hci_adv(HCI_LOG_DATA_TYPE_ADV, &data[2], len - 2);
|
bt_hci_log_record_hci_adv(HCI_LOG_DATA_TYPE_ADV, &data[2], len - 2);
|
||||||
} else {
|
} else {
|
||||||
uint8_t data_type = ((data[0] == 2) ? HCI_LOG_DATA_TYPE_C2H_ACL : data[0]);
|
uint8_t data_type;
|
||||||
|
if (data[0] == HCI_LOG_DATA_TYPE_ISO_DATA) {
|
||||||
|
data_type = HCI_LOG_DATA_TYPE_ISO_DATA;
|
||||||
|
} else {
|
||||||
|
data_type = ((data[0] == 2) ? HCI_LOG_DATA_TYPE_C2H_ACL : data[0]);
|
||||||
|
}
|
||||||
bt_hci_log_record_hci_data(data_type, &data[1], len - 1);
|
bt_hci_log_record_hci_data(data_type, &data[1], len - 1);
|
||||||
}
|
}
|
||||||
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
|
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -43,6 +43,14 @@ hci_driver_vhci_controller_tx(hci_driver_data_type_t data_type, uint8_t *data, u
|
|||||||
buf[0] = HCI_DRIVER_TYPE_EVT;
|
buf[0] = HCI_DRIVER_TYPE_EVT;
|
||||||
memcpy(&buf[1], data, length);
|
memcpy(&buf[1], data, length);
|
||||||
r_ble_hci_trans_buf_free(data);
|
r_ble_hci_trans_buf_free(data);
|
||||||
|
} else if (data_type == HCI_DRIVER_TYPE_ISO) {
|
||||||
|
buf_len = length + 1;
|
||||||
|
buf = malloc(buf_len);
|
||||||
|
/* TODO: If there is no memory, should handle it in the controller. */
|
||||||
|
assert(buf);
|
||||||
|
buf[0] = HCI_DRIVER_TYPE_ISO;
|
||||||
|
memcpy(&buf[1], data, length);
|
||||||
|
free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = s_hci_driver_vhci_env.forward_cb(data_type, buf, buf_len, HCI_DRIVER_DIR_C2H);
|
rc = s_hci_driver_vhci_env.forward_cb(data_type, buf, buf_len, HCI_DRIVER_DIR_C2H);
|
||||||
|
Reference in New Issue
Block a user