Update bt fork to be based on v5.3
This commit is contained in:
@@ -615,6 +615,11 @@ void bta_dm_disable (tBTA_DM_MSG *p_data)
|
||||
btm_ble_resolving_list_cleanup (); //by TH, because cmn_ble_vsc_cb.max_filter has something mistake as btm_ble_adv_filter_cleanup
|
||||
#endif
|
||||
|
||||
#if BLE_INCLUDED == TRUE
|
||||
// btm_ble_multi_adv_init is called when the host is enabled, so btm_ble_multi_adv_cleanup is called when the host is disabled.
|
||||
btm_ble_multi_adv_cleanup();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -649,7 +654,7 @@ static void bta_dm_disable_timer_cback (TIMER_LIST_ENT *p_tle)
|
||||
}
|
||||
|
||||
/* Retrigger disable timer in case ACL disconnect failed, DISABLE_EVT still need
|
||||
to be sent out to avoid jave layer disable timeout */
|
||||
to be sent out to avoid the layer disable timeout */
|
||||
if (trigger_disc) {
|
||||
bta_dm_cb.disable_timer.p_cback = (TIMER_CBACK *)&bta_dm_disable_timer_cback;
|
||||
bta_dm_cb.disable_timer.param = 1;
|
||||
@@ -678,9 +683,11 @@ static void bta_dm_disable_timer_cback (TIMER_LIST_ENT *p_tle)
|
||||
*******************************************************************************/
|
||||
void bta_dm_set_dev_name (tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_SetLocalDeviceName((char *)p_data->set_name.name);
|
||||
BTM_SetLocalDeviceName((char *)p_data->set_name.name, p_data->set_name.name_type);
|
||||
#if CLASSIC_BT_INCLUDED
|
||||
bta_dm_set_eir ((char *)p_data->set_name.name);
|
||||
if (p_data->set_name.name_type & BT_DEVICE_TYPE_BREDR) {
|
||||
bta_dm_set_eir ((char *)p_data->set_name.name);
|
||||
}
|
||||
#endif /// CLASSIC_BT_INCLUDED
|
||||
}
|
||||
|
||||
@@ -699,7 +706,7 @@ void bta_dm_get_dev_name (tBTA_DM_MSG *p_data)
|
||||
tBTM_STATUS status;
|
||||
char *name = NULL;
|
||||
|
||||
status = BTM_ReadLocalDeviceName(&name);
|
||||
status = BTM_ReadLocalDeviceName(&name, p_data->get_name.name_type);
|
||||
if (p_data->get_name.p_cback) {
|
||||
(*p_data->get_name.p_cback)(status, name);
|
||||
}
|
||||
@@ -709,7 +716,7 @@ void bta_dm_get_dev_name (tBTA_DM_MSG *p_data)
|
||||
**
|
||||
** Function bta_dm_cfg_coex_status
|
||||
**
|
||||
** Description config coexistance status
|
||||
** Description config coexistence status
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
@@ -724,6 +731,14 @@ void bta_dm_cfg_coex_status (tBTA_DM_MSG *p_data)
|
||||
}
|
||||
#endif
|
||||
|
||||
void bta_dm_send_vendor_hci(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_VendorSpecificCommand(p_data->vendor_hci_cmd.opcode,
|
||||
p_data->vendor_hci_cmd.param_len,
|
||||
p_data->vendor_hci_cmd.p_param_buf,
|
||||
p_data->vendor_hci_cmd.vendor_hci_cb);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_set_afh_channels
|
||||
@@ -772,7 +787,7 @@ static BOOLEAN bta_dm_read_remote_device_name (BD_ADDR bd_addr, tBT_TRANSPORT tr
|
||||
APPL_TRACE_DEBUG("bta_dm_read_remote_device_name: BTM_ReadRemoteDeviceName is busy");
|
||||
|
||||
/* Remote name discovery is on going now so BTM cannot notify through "bta_dm_remname_cback" */
|
||||
/* adding callback to get notified that current reading remore name done */
|
||||
/* adding callback to get notified that current reading remote name done */
|
||||
BTM_SecAddRmtNameNotifyCallback(&bta_dm_service_search_remname_cback);
|
||||
|
||||
return (TRUE);
|
||||
@@ -907,6 +922,23 @@ void bta_dm_set_acl_pkt_types (tBTA_DM_MSG *p_data)
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_dm_set_min_enc_key_size
|
||||
**
|
||||
** Description Sets the minimal size of encryption key
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
void bta_dm_set_min_enc_key_size (tBTA_DM_MSG *p_data)
|
||||
{
|
||||
BTM_SetMinEncKeySize(p_data->set_min_enc_key_size.key_size, p_data->set_min_enc_key_size.set_min_enc_key_size_cb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -1156,7 +1188,7 @@ void bta_dm_add_device (tBTA_DM_MSG *p_data)
|
||||
}
|
||||
|
||||
if (p_dev->is_trusted) {
|
||||
/* covert BTA service mask to BTM mask */
|
||||
/* convert BTA service mask to BTM mask */
|
||||
while (p_dev->tm && (index < BTA_MAX_SERVICE_ID)) {
|
||||
if (p_dev->tm & (UINT32)(1 << index)) {
|
||||
|
||||
@@ -1184,7 +1216,7 @@ void bta_dm_add_device (tBTA_DM_MSG *p_data)
|
||||
** Function bta_dm_close_acl
|
||||
**
|
||||
** Description This function forces to close the connection to a remote device
|
||||
** and optionaly remove the device from security database if
|
||||
** and optionally remove the device from security database if
|
||||
** required.
|
||||
****
|
||||
*******************************************************************************/
|
||||
@@ -2707,7 +2739,7 @@ static void bta_dm_discover_device(BD_ADDR remote_bd_addr)
|
||||
&bta_dm_search_cb.services_found );
|
||||
}
|
||||
|
||||
/* if seaching with EIR is not completed */
|
||||
/* if searching with EIR is not completed */
|
||||
if (bta_dm_search_cb.services_to_search) {
|
||||
/* check whether connection already exists to the device
|
||||
if connection exists, we don't have to wait for ACL
|
||||
@@ -3794,7 +3826,7 @@ static void bta_dm_disable_conn_down_timer_cback (TIMER_LIST_ENT *p_tle)
|
||||
tBTA_SYS_HW_MSG *sys_enable_event;
|
||||
|
||||
#if (BTA_DM_PM_INCLUDED == TRUE)
|
||||
/* disable the power managment module */
|
||||
/* disable the power management module */
|
||||
bta_dm_disable_pm();
|
||||
#endif /* #if (BTA_DM_PM_INCLUDED == TRUE) */
|
||||
|
||||
@@ -4138,7 +4170,7 @@ static void bta_dm_set_eir (char *local_name)
|
||||
if (p_bta_dm_eir_cfg->bta_dm_eir_included_name) {
|
||||
/* if local name is not provided, get it from controller */
|
||||
if ( local_name == NULL ) {
|
||||
if ( BTM_ReadLocalDeviceName( &local_name ) != BTM_SUCCESS ) {
|
||||
if ( BTM_ReadLocalDeviceName( &local_name, BT_DEVICE_TYPE_BREDR) != BTM_SUCCESS ) {
|
||||
APPL_TRACE_ERROR("Fail to read local device name for EIR");
|
||||
}
|
||||
}
|
||||
@@ -4181,7 +4213,7 @@ static void bta_dm_set_eir (char *local_name)
|
||||
p = (UINT8 *)p_buf + BTM_HCI_EIR_OFFSET; /* reset p */
|
||||
#endif // BTA_EIR_CANNED_UUID_LIST
|
||||
|
||||
/* if UUID doesn't fit remaing space, shorten local name */
|
||||
/* if UUID doesn't fit remaining space, shorten local name */
|
||||
if ( local_name_len > (free_eir_length - 4 - num_uuid * LEN_UUID_16)) {
|
||||
APPL_TRACE_WARNING("BTA EIR: local name is shortened");
|
||||
local_name_len = p_bta_dm_eir_cfg->bta_dm_eir_min_name_len;
|
||||
@@ -5234,14 +5266,14 @@ void bta_dm_ble_disconnect (tBTA_DM_MSG *p_data)
|
||||
**
|
||||
** Description This function set the LE random address for the device.
|
||||
**
|
||||
** Parameters: rand_addr:the random address whitch should be setting
|
||||
** Parameters: rand_addr:the random address which should be setting
|
||||
** Explanation: This function added by Yulong at 2016/9/9
|
||||
*******************************************************************************/
|
||||
void bta_dm_ble_set_rand_address(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
tBTM_STATUS status = BTM_SET_STATIC_RAND_ADDR_FAIL;
|
||||
if (p_data->set_addr.addr_type != BLE_ADDR_RANDOM) {
|
||||
APPL_TRACE_ERROR("Invalid random adress type = %d\n", p_data->set_addr.addr_type);
|
||||
APPL_TRACE_ERROR("Invalid random address type = %d\n", p_data->set_addr.addr_type);
|
||||
if(p_data->set_addr.p_set_rand_addr_cback) {
|
||||
(*p_data->set_addr.p_set_rand_addr_cback)(status);
|
||||
}
|
||||
@@ -5596,7 +5628,7 @@ void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data)
|
||||
}
|
||||
|
||||
p_acl_cb->p_set_pkt_data_cback = p_data->ble_set_data_length.p_set_pkt_data_cback;
|
||||
// if the value of the data length is same, triger callback directly
|
||||
// if the value of the data length is same, trigger callback directly
|
||||
if(p_data->ble_set_data_length.tx_data_length == p_acl_cb->data_length_params.tx_len) {
|
||||
if(p_data->ble_set_data_length.p_set_pkt_data_cback) {
|
||||
(*p_data->ble_set_data_length.p_set_pkt_data_cback)(status, &p_acl_cb->data_length_params);
|
||||
@@ -5605,7 +5637,7 @@ void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data)
|
||||
}
|
||||
|
||||
if(p_acl_cb->data_len_updating) {
|
||||
// aleady have one cmd
|
||||
// already have one cmd
|
||||
if(p_acl_cb->data_len_waiting) {
|
||||
status = BTM_ILLEGAL_ACTION;
|
||||
} else {
|
||||
@@ -5791,6 +5823,28 @@ void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data)
|
||||
}
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_rpa_timeout(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, rpa_timeout = %d", __func__, p_data->set_rpa_timeout.rpa_timeout);
|
||||
BTM_BleSetRpaTimeout(p_data->set_rpa_timeout.rpa_timeout,p_data->set_rpa_timeout.p_set_rpa_timeout_cback);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_add_dev_to_resolving_list(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s", __func__);
|
||||
BTM_BleAddDevToResolvingList(p_data->add_dev_to_resolving_list.addr,
|
||||
p_data->add_dev_to_resolving_list.addr_type,
|
||||
p_data->add_dev_to_resolving_list.irk,
|
||||
p_data->add_dev_to_resolving_list.p_add_dev_to_resolving_list_callback);
|
||||
}
|
||||
|
||||
void bta_dm_ble_gap_set_privacy_mode(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_API("%s, privacy_mode = %d", __func__, p_data->ble_set_privacy_mode.privacy_mode);
|
||||
BTM_BleSetPrivacyMode(p_data->ble_set_privacy_mode.addr_type, p_data->ble_set_privacy_mode.addr,
|
||||
p_data->ble_set_privacy_mode.privacy_mode, p_data->ble_set_privacy_mode.p_cback);
|
||||
}
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
void bta_dm_ble_gap_dtm_enhance_tx_start(tBTA_DM_MSG *p_data)
|
||||
{
|
||||
@@ -6472,7 +6526,7 @@ static void bta_dm_gatt_disc_result(tBTA_GATT_ID service_id)
|
||||
}
|
||||
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s out of room to accomodate more service ids ble_raw_size = %d ble_raw_used = %d", __FUNCTION__, bta_dm_search_cb.ble_raw_size, bta_dm_search_cb.ble_raw_used );
|
||||
APPL_TRACE_ERROR("%s out of room to accommodate more service ids ble_raw_size = %d ble_raw_used = %d", __FUNCTION__, bta_dm_search_cb.ble_raw_size, bta_dm_search_cb.ble_raw_used );
|
||||
}
|
||||
|
||||
APPL_TRACE_API("%s service_id_uuid_len=%d ", __func__, service_id.uuid.len);
|
||||
|
||||
@@ -166,7 +166,7 @@ void BTA_DisableTestMode(void)
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmSetDeviceName(const char *p_name)
|
||||
void BTA_DmSetDeviceName(const char *p_name, tBT_DEVICE_TYPE name_type)
|
||||
{
|
||||
|
||||
tBTA_DM_API_SET_NAME *p_msg;
|
||||
@@ -176,6 +176,7 @@ void BTA_DmSetDeviceName(const char *p_name)
|
||||
/* truncate the name if needed */
|
||||
BCM_STRNCPY_S((char *)p_msg->name, p_name, BD_NAME_LEN);
|
||||
p_msg->name[BD_NAME_LEN] = '\0';
|
||||
p_msg->name_type = name_type;
|
||||
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
@@ -191,13 +192,14 @@ void BTA_DmSetDeviceName(const char *p_name)
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback)
|
||||
void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback, tBT_DEVICE_TYPE name_type)
|
||||
{
|
||||
tBTA_DM_API_GET_NAME *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_GET_NAME *) osi_malloc(sizeof(tBTA_DM_API_GET_NAME))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_GET_NAME_EVT;
|
||||
p_msg->p_cback = p_cback;
|
||||
p_msg->name_type = name_type;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
@@ -227,6 +229,21 @@ void BTA_DmCfgCoexStatus(UINT8 op, UINT8 type, UINT8 status)
|
||||
}
|
||||
#endif
|
||||
|
||||
void BTA_DmsendVendorHciCmd(UINT16 opcode, UINT8 param_len, UINT8 *p_param_buf, tBTA_SEND_VENDOR_HCI_CMPL_CBACK p_vendor_cmd_complete_cback)
|
||||
{
|
||||
tBTA_DM_API_SEND_VENDOR_HCI_CMD *p_msg;
|
||||
if ((p_msg = (tBTA_DM_API_SEND_VENDOR_HCI_CMD *)osi_malloc(sizeof(tBTA_DM_API_SEND_VENDOR_HCI_CMD) + param_len)) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT;
|
||||
p_msg->opcode = opcode;
|
||||
p_msg->param_len = param_len;
|
||||
p_msg->p_param_buf = (UINT8 *)(p_msg + 1);
|
||||
memcpy(p_msg->p_param_buf, p_param_buf, param_len);
|
||||
p_msg->vendor_hci_cb = p_vendor_cmd_complete_cback;
|
||||
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config)
|
||||
@@ -365,6 +382,31 @@ void BTA_DmSetAclPktTypes(BD_ADDR remote_addr, UINT16 pkt_types, tBTM_CMPL_CB *p
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmSetMinEncKeySize
|
||||
**
|
||||
** Description This function sets the minimal size of encryption key.
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
void BTA_DmSetMinEncKeySize(UINT8 key_size, tBTM_CMPL_CB *p_cb)
|
||||
{
|
||||
tBTA_DM_API_SET_MIN_ENC_KEY_SIZE *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_SET_MIN_ENC_KEY_SIZE *) osi_malloc(sizeof(tBTA_DM_API_SET_MIN_ENC_KEY_SIZE))) != NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_SET_MIN_ENC_KEY_SIZE_EVT;
|
||||
p_msg->key_size = key_size;
|
||||
p_msg->set_min_enc_key_size_cb = p_cb;
|
||||
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /// CLASSIC_BT_INCLUDED == TRUE
|
||||
|
||||
#if (SDP_INCLUDED == TRUE)
|
||||
@@ -940,7 +982,7 @@ void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class, LINK_KEY link_key,
|
||||
**
|
||||
** Function BTA_DmRemoveDevice
|
||||
**
|
||||
** Description This function removes a device fromthe security database list of
|
||||
** Description This function removes a device from the security database list of
|
||||
** peer device. It manages unpairing even while connected.
|
||||
**
|
||||
**
|
||||
@@ -1158,7 +1200,7 @@ void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, int auth_mode
|
||||
** Description Send BLE SMP passkey reply.
|
||||
**
|
||||
** Parameters: bd_addr - BD address of the peer
|
||||
** accept - passkey entry sucessful or declined.
|
||||
** accept - passkey entry successful or declined.
|
||||
** passkey - passkey value, must be a 6 digit number,
|
||||
** can be lead by 0.
|
||||
**
|
||||
@@ -1997,7 +2039,7 @@ void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
|
||||
** p_services: if service is not empty, service discovery will be done.
|
||||
** for all GATT based service condition, put num_uuid, and
|
||||
** p_uuid is the pointer to the list of UUID values.
|
||||
** p_cback: callback functino when search is completed.
|
||||
** p_cback: callback function when search is completed.
|
||||
**
|
||||
**
|
||||
**
|
||||
@@ -2085,7 +2127,7 @@ void BTA_DmBleUpdateConnectionParam(BD_ADDR bd_addr, UINT16 min_int,
|
||||
**
|
||||
** Description Enable/disable privacy on the local device
|
||||
**
|
||||
** Parameters: privacy_enable - enable/disabe privacy on remote device.
|
||||
** Parameters: privacy_enable - enable/disable privacy on remote device.
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
@@ -2137,7 +2179,7 @@ void BTA_DmBleConfigLocalIcon(uint16_t icon)
|
||||
**
|
||||
** Function BTA_BleEnableAdvInstance
|
||||
**
|
||||
** Description This function enable a Multi-ADV instance with the specififed
|
||||
** Description This function enable a Multi-ADV instance with the specified
|
||||
** adv parameters
|
||||
**
|
||||
** Parameters p_params: pointer to the adv parameter structure.
|
||||
@@ -2176,7 +2218,7 @@ void BTA_BleEnableAdvInstance (tBTA_BLE_ADV_PARAMS *p_params,
|
||||
**
|
||||
** Function BTA_BleUpdateAdvInstParam
|
||||
**
|
||||
** Description This function update a Multi-ADV instance with the specififed
|
||||
** Description This function update a Multi-ADV instance with the specified
|
||||
** adv parameters.
|
||||
**
|
||||
** Parameters inst_id: Adv instance to update the parameter.
|
||||
@@ -2207,7 +2249,7 @@ void BTA_BleUpdateAdvInstParam (UINT8 inst_id, tBTA_BLE_ADV_PARAMS *p_params)
|
||||
**
|
||||
** Function BTA_BleCfgAdvInstData
|
||||
**
|
||||
** Description This function configure a Multi-ADV instance with the specififed
|
||||
** Description This function configure a Multi-ADV instance with the specified
|
||||
** adv data or scan response data.
|
||||
**
|
||||
** Parameter inst_id: Adv instance to configure the adv data or scan response.
|
||||
@@ -2637,6 +2679,21 @@ void BTA_DmBleDtmStop(tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback)
|
||||
}
|
||||
}
|
||||
|
||||
void BTA_DmBleSetPrivacyMode(uint8_t addr_type, BD_ADDR addr, uint8_t privacy_mode, tBTA_SET_PRIVACY_MODE_CMPL_CBACK *p_cback)
|
||||
{
|
||||
tBTA_DM_API_SET_PRIVACY_MODE *p_msg;
|
||||
|
||||
if ((p_msg = (tBTA_DM_API_SET_PRIVACY_MODE *)osi_malloc(sizeof(tBTA_DM_API_SET_PRIVACY_MODE)))
|
||||
!= NULL) {
|
||||
p_msg->hdr.event = BTA_DM_API_SET_PRIVACY_MODE_EVT;
|
||||
p_msg->addr_type = addr_type;
|
||||
memcpy(p_msg->addr, addr, sizeof(BD_ADDR));
|
||||
p_msg->privacy_mode = privacy_mode;
|
||||
p_msg->p_cback = p_cback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -2650,7 +2707,7 @@ void BTA_DmBleDtmStop(tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback)
|
||||
**
|
||||
** Parameters: bd_addr - Address of the peer device
|
||||
** transport - transport of the link to be encruypted
|
||||
** p_callback - Pointer to callback function to indicat the
|
||||
** p_callback - Pointer to callback function to indicate the
|
||||
** link encryption status
|
||||
** sec_act - This is the security action to indicate
|
||||
** what kind of BLE security level is required for
|
||||
@@ -2830,7 +2887,7 @@ extern void BTA_DmBleStopAdvertising(void)
|
||||
**
|
||||
** Description This function set the random address for the APP
|
||||
**
|
||||
** Parameters rand_addr: the random address whith should be setting
|
||||
** Parameters rand_addr: the random address with should be setting
|
||||
** p_set_rand_addr_cback: complete callback
|
||||
** Returns void
|
||||
**
|
||||
@@ -2846,7 +2903,68 @@ extern void BTA_DmSetRandAddress(BD_ADDR rand_addr, tBTA_SET_RAND_ADDR_CBACK *p_
|
||||
p_msg->hdr.event = BTA_DM_API_SET_RAND_ADDR_EVT;
|
||||
p_msg->addr_type = BLE_ADDR_RANDOM;
|
||||
p_msg->p_set_rand_addr_cback = p_set_rand_addr_cback;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleSetRpaTimeout
|
||||
**
|
||||
** Description This function sets the Resolvable Private Address (RPA) timeout
|
||||
** for the Bluetooth device. The RPA timeout defines how long an RPA
|
||||
** remains in use before a new one is generated.
|
||||
**
|
||||
** Parameters rpa_timeout: The timeout in seconds within the range of 1s to 1 hour
|
||||
** as defined by the Bluetooth specification. This duration
|
||||
** specifies how long the controller uses an RPA before
|
||||
** generating a new one.
|
||||
** Returns void
|
||||
**
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmBleSetRpaTimeout(uint16_t rpa_timeout,tBTA_SET_RPA_TIMEOUT_CMPL_CBACK *p_set_rpa_timeout_cback)
|
||||
{
|
||||
tBTA_DM_API_SET_RPA_TIMEOUT *p_msg;
|
||||
if ((p_msg = (tBTA_DM_API_SET_RPA_TIMEOUT *) osi_malloc(sizeof(tBTA_DM_API_SET_RPA_TIMEOUT))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_SET_RPA_TIMEOUT));
|
||||
p_msg->hdr.event = BTA_DM_API_SET_RPA_TIMEOUT_EVT;
|
||||
p_msg->rpa_timeout = rpa_timeout; // Assign the RPA timeout value to the message
|
||||
p_msg->p_set_rpa_timeout_cback = p_set_rpa_timeout_cback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleAddDevToResolvingList
|
||||
**
|
||||
** Description This function adds a device to the resolving list of the
|
||||
** Bluetooth controller. The resolving list is used for resolving
|
||||
** the identity of devices using resolvable private addresses (RPAs).
|
||||
**
|
||||
** Parameters addr: Bluetooth device address to be added to the resolving list
|
||||
** addr_type: Type of the address (public or random)
|
||||
** irk: Identity Resolving Key (IRK) of the device
|
||||
** add_dev_to_resolving_list_callback: Callback function to be invoked
|
||||
** upon completion of the operation
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void BTA_DmBleAddDevToResolvingList(BD_ADDR addr,
|
||||
uint8_t addr_type,
|
||||
PEER_IRK irk,
|
||||
tBTA_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK *add_dev_to_resolving_list_callback)
|
||||
{
|
||||
tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST *p_msg;
|
||||
if ((p_msg = (tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST *) osi_malloc(sizeof(tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST));
|
||||
p_msg->hdr.event = BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT;
|
||||
memcpy(p_msg->addr, addr, BD_ADDR_LEN); // Copy the device address to the message
|
||||
p_msg->addr_type = addr_type; // Assign the address type to the message
|
||||
memcpy(p_msg->irk, irk, PEER_IRK_LEN); // Copy the IRK to the message
|
||||
p_msg->p_add_dev_to_resolving_list_callback = add_dev_to_resolving_list_callback;
|
||||
bta_sys_sendmsg(p_msg);
|
||||
}
|
||||
}
|
||||
@@ -2906,7 +3024,6 @@ void BTA_VendorCleanup (void)
|
||||
}
|
||||
#endif
|
||||
|
||||
btm_ble_multi_adv_cleanup();
|
||||
}
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
void BTA_DmBleGapReadPHY(BD_ADDR addr)
|
||||
@@ -2917,7 +3034,7 @@ void BTA_DmBleGapReadPHY(BD_ADDR addr)
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_READ_PHY));
|
||||
p_msg->hdr.event = BTA_DM_API_READ_PHY_EVT;
|
||||
memcpy(p_msg->bd_addr, addr, BD_ADDR_LEN);
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -2929,13 +3046,13 @@ void BTA_DmBleGapSetPreferedDefaultPHY(tBTA_DM_BLE_GAP_PHY_MASK tx_phy_mask,
|
||||
tBTA_DM_BLE_GAP_PHY_MASK rx_phy_mask)
|
||||
{
|
||||
tBTA_DM_API_SET_PER_DEF_PHY *p_msg;
|
||||
APPL_TRACE_API("%s, Set prefered default phy.", __func__);
|
||||
APPL_TRACE_API("%s, Set preferred default phy.", __func__);
|
||||
if ((p_msg = (tBTA_DM_API_SET_PER_DEF_PHY *) osi_malloc(sizeof(tBTA_DM_API_SET_PER_DEF_PHY))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_SET_PER_DEF_PHY));
|
||||
p_msg->hdr.event = BTA_DM_API_SET_PER_DEF_PHY_EVT;
|
||||
p_msg->tx_phy_mask = tx_phy_mask;
|
||||
p_msg->rx_phy_mask = rx_phy_mask;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -2950,7 +3067,7 @@ void BTA_DmBleGapSetPreferedPHY(BD_ADDR addr,
|
||||
UINT16 phy_options)
|
||||
{
|
||||
tBTA_DM_API_SET_PER_PHY *p_msg;
|
||||
APPL_TRACE_API("%s, Set prefered phy.", __func__);
|
||||
APPL_TRACE_API("%s, Set preferred phy.", __func__);
|
||||
if ((p_msg = (tBTA_DM_API_SET_PER_PHY *) osi_malloc(sizeof(tBTA_DM_API_SET_PER_PHY))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_SET_PER_PHY));
|
||||
p_msg->hdr.event = BTA_DM_API_SET_PER_PHY_EVT;
|
||||
@@ -2959,7 +3076,7 @@ void BTA_DmBleGapSetPreferedPHY(BD_ADDR addr,
|
||||
p_msg->tx_phy_mask = tx_phy_mask;
|
||||
p_msg->rx_phy_mask = rx_phy_mask;
|
||||
p_msg->phy_options = phy_options;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -2975,7 +3092,7 @@ void BTA_DmBleGapExtAdvSetRandaddr(UINT16 instance, BD_ADDR addr)
|
||||
p_msg->hdr.event = BTA_DM_API_SET_EXT_ADV_RAND_ADDR_EVT;
|
||||
p_msg->instance = instance;
|
||||
memcpy(&p_msg->rand_addr, addr, BD_ADDR_LEN);
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -2993,7 +3110,7 @@ void BTA_DmBleGapExtAdvSetParams(UINT16 instance,
|
||||
p_msg->hdr.event = BTA_DM_API_SET_EXT_ADV_PARAMS_EVT;
|
||||
p_msg->instance = instance;
|
||||
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_GAP_EXT_ADV_PARAMS));
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3016,7 +3133,7 @@ void BTA_DmBleGapConfigExtAdvDataRaw(BOOLEAN is_scan_rsp, UINT8 instance, UINT16
|
||||
if (data) {
|
||||
memcpy(p_msg->data, data, length);
|
||||
}
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3036,7 +3153,7 @@ void BTA_DmBleGapExtAdvEnable(BOOLEAN enable, UINT8 num, tBTA_DM_BLE_EXT_ADV *ex
|
||||
if (ext_adv) {
|
||||
memcpy(p_msg->ext_adv, ext_adv, sizeof(tBTA_DM_BLE_EXT_ADV)*num);
|
||||
}
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3051,7 +3168,7 @@ void BTA_DmBleGapExtAdvSetRemove(UINT8 instance)
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_EXT_ADV_SET_REMOVE));
|
||||
p_msg->hdr.event = BTA_DM_API_EXT_ADV_SET_REMOVE_EVT;
|
||||
p_msg->instance = instance;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3065,7 +3182,7 @@ void BTA_DmBleGapExtAdvSetClear(void)
|
||||
if ((p_msg = (tBTA_DM_API_BLE_EXT_ADV_SET_CLEAR *) osi_malloc(sizeof(tBTA_DM_API_BLE_EXT_ADV_SET_CLEAR))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_EXT_ADV_SET_CLEAR));
|
||||
p_msg->hdr.event = BTA_DM_API_EXT_ADV_SET_CLEAR_EVT;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3082,7 +3199,7 @@ void BTA_DmBleGapPeriodicAdvSetParams(UINT8 instance,
|
||||
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_SET_PARAMS_EVT;
|
||||
p_msg->instance = instance;
|
||||
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_Periodic_Adv_Params));
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3104,7 +3221,7 @@ void BTA_DmBleGapPeriodicAdvCfgDataRaw(UINT8 instance, UINT16 length,
|
||||
memcpy(p_msg->data, data, length);
|
||||
p_msg->data = length != 0 ? (UINT8 *)(p_msg + 1) : NULL;
|
||||
p_msg->only_update_did = only_update_did;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3121,7 +3238,7 @@ void BTA_DmBleGapPeriodicAdvEnable(UINT8 enable, UINT8 instance)
|
||||
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_ENABLE_EVT;
|
||||
p_msg->instance = instance;
|
||||
p_msg->enable = enable;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3137,7 +3254,7 @@ void BTA_DmBleGapPeriodicAdvCreateSync(tBTA_DM_BLE_Periodic_Sync_Params *params)
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_SYNC));
|
||||
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_SYNC_EVT;
|
||||
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_Periodic_Sync_Params));
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3152,7 +3269,7 @@ void BTA_DmBleGapPeriodicAdvSyncCancel(void)
|
||||
if ((p_msg = (tBTA_DM_API_PERIODIC_ADV_SYNC_CANCEL *) osi_malloc(sizeof(tBTA_DM_API_PERIODIC_ADV_SYNC_CANCEL))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_SYNC_CANCEL));
|
||||
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_SYNC_CANCEL_EVT;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3168,7 +3285,7 @@ void BTA_DmBleGapPeriodicAdvSyncTerm(UINT16 sync_handle)
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_SYNC_TERM));
|
||||
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_SYNC_TERMINATE_EVT;
|
||||
p_msg->sync_handle = sync_handle;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3188,7 +3305,7 @@ void BTA_DmBleGapPeriodicAdvAddDevToList(tBLE_ADDR_TYPE addr_type,
|
||||
p_msg->addr_type = addr_type;
|
||||
p_msg->sid = sid;
|
||||
memcpy(p_msg->addr, addr, sizeof(BD_ADDR));
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3208,7 +3325,7 @@ void BTA_DmBleGapPeriodicAdvRemoveDevFromList(tBLE_ADDR_TYPE addr_type,
|
||||
p_msg->addr_type = addr_type;
|
||||
p_msg->sid = sid;
|
||||
memcpy(p_msg->addr, addr, sizeof(BD_ADDR));
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3223,7 +3340,7 @@ void BTA_DmBleGapPeriodicAdvClearDev(void)
|
||||
if ((p_msg = (tBTA_DM_API_PERIODIC_ADV_DEV_CLEAR *) osi_malloc(sizeof(tBTA_DM_API_PERIODIC_ADV_DEV_CLEAR))) != NULL) {
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_PERIODIC_ADV_DEV_CLEAR));
|
||||
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_CLEAR_DEV_EVT;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3239,7 +3356,7 @@ void BTA_DmBleGapSetExtScanParams(tBTA_DM_BLE_EXT_SCAN_PARAMS *params)
|
||||
memset(p_msg, 0, sizeof(tBTA_DM_API_SET_EXT_SCAN_PARAMS));
|
||||
p_msg->hdr.event = BTA_DM_API_SET_EXT_SCAN_PARAMS_EVT;
|
||||
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_EXT_SCAN_PARAMS));
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3257,7 +3374,7 @@ void BTA_DmBleGapExtScan(BOOLEAN start, UINT32 duration, UINT16 period)
|
||||
p_msg->start = start;
|
||||
p_msg->duration = duration;
|
||||
p_msg->period = period;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3291,7 +3408,7 @@ void BTA_DmBleGapPreferExtConnectParamsSet(BD_ADDR bd_addr,
|
||||
if (phy_coded_conn_params) {
|
||||
memcpy(&p_msg->phy_coded_conn_params, phy_coded_conn_params, sizeof(tBTA_DM_BLE_CONN_PARAMS));
|
||||
}
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3310,7 +3427,7 @@ void BTA_DmBleGapExtConnect(tBLE_ADDR_TYPE own_addr_type, const BD_ADDR peer_add
|
||||
p_msg->hdr.event = BTA_DM_API_EXT_CONN_EVT;
|
||||
p_msg->own_addr_type = own_addr_type;
|
||||
memcpy(p_msg->peer_addr, peer_addr, sizeof(BD_ADDR));
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3363,7 +3480,7 @@ void BTA_DmBleGapPeriodicAdvRecvEnable(UINT16 sync_handle, UINT8 enable)
|
||||
p_msg->hdr.event = BTA_DM_API_PERIODIC_ADV_RECV_ENABLE_EVT;
|
||||
p_msg->sync_handle = sync_handle;
|
||||
p_msg->enable = enable;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3380,7 +3497,7 @@ void BTA_DmBleGapPeriodicAdvSyncTrans(BD_ADDR peer_addr, UINT16 service_data, UI
|
||||
memcpy(p_msg->addr, peer_addr, sizeof(BD_ADDR));
|
||||
p_msg->service_data = service_data;
|
||||
p_msg->sync_handle = sync_handle;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3397,7 +3514,7 @@ void BTA_DmBleGapPeriodicAdvSetInfoTrans(BD_ADDR peer_addr, UINT16 service_data,
|
||||
memcpy(p_msg->addr, peer_addr, sizeof(BD_ADDR));
|
||||
p_msg->service_data = service_data;
|
||||
p_msg->adv_hanlde = adv_handle;
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
@@ -3413,7 +3530,7 @@ void BTA_DmBleGapSetPeriodicAdvSyncTransParams(BD_ADDR peer_addr, tBTA_DM_BLE_PA
|
||||
p_msg->hdr.event = BTA_DM_API_SET_PERIODIC_ADV_SYNC_TRANS_PARAMS_EVT;
|
||||
memcpy(p_msg->addr, peer_addr, sizeof(BD_ADDR));
|
||||
memcpy(&p_msg->params, params, sizeof(tBTA_DM_BLE_PAST_PARAMS));
|
||||
//start sent the msg to the bta system control moudle
|
||||
//start sent the msg to the bta system control module
|
||||
bta_sys_sendmsg(p_msg);
|
||||
} else {
|
||||
APPL_TRACE_ERROR("%s malloc failed", __func__);
|
||||
|
||||
@@ -31,7 +31,9 @@
|
||||
#include "osi/allocator.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef CONFIG_ESP_COEX_ENABLED
|
||||
#include "esp_coexist.h"
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
** Constants and types
|
||||
@@ -65,11 +67,15 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
#if (ESP_COEX_VSC_INCLUDED == TRUE)
|
||||
bta_dm_cfg_coex_status, /* BTA_DM_API_CFG_COEX_ST_EVT */
|
||||
#endif
|
||||
bta_dm_send_vendor_hci, /* BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT */
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
bta_dm_config_eir, /* BTA_DM_API_CONFIG_EIR_EVT */
|
||||
bta_dm_set_page_timeout, /* BTA_DM_API_PAGE_TO_SET_EVT */
|
||||
bta_dm_get_page_timeout, /* BTA_DM_API_PAGE_TO_GET_EVT */
|
||||
bta_dm_set_acl_pkt_types, /* BTA_DM_API_SET_ACL_PKT_TYPES_EVT */
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
bta_dm_set_min_enc_key_size, /* BTA_DM_API_SET_MIN_ENC_KEY_SIZE_EVT */
|
||||
#endif
|
||||
#endif
|
||||
bta_dm_set_afh_channels, /* BTA_DM_API_SET_AFH_CHANNELS_EVT */
|
||||
#if (SDP_INCLUDED == TRUE)
|
||||
@@ -87,7 +93,7 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
bta_dm_pin_reply, /* BTA_DM_API_PIN_REPLY_EVT */
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
#if (BTA_DM_PM_INCLUDED == TRUE)
|
||||
/* power manger events */
|
||||
/* power manager events */
|
||||
bta_dm_pm_btm_status, /* BTA_DM_PM_BTM_STATUS_EVT */
|
||||
bta_dm_pm_timer, /* BTA_DM_PM_TIMER_EVT */
|
||||
#endif /* #if (BTA_DM_PM_INCLUDED == TRUE) */
|
||||
@@ -226,6 +232,9 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
|
||||
bta_dm_ble_gap_dtm_rx_start, /* BTA_DM_API_DTM_RX_START_EVT */
|
||||
bta_dm_ble_gap_dtm_stop, /* BTA_DM_API_DTM_STOP_EVT */
|
||||
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
|
||||
bta_dm_ble_gap_set_rpa_timeout, /* BTA_DM_API_SET_RPA_TIMEOUT_EVT */
|
||||
bta_dm_ble_gap_add_dev_to_resolving_list, /* BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT */
|
||||
bta_dm_ble_gap_set_privacy_mode, /* BTA_DM_API_SET_PRIVACY_MODE_EVT */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -57,11 +57,15 @@ enum {
|
||||
#if (ESP_COEX_VSC_INCLUDED == TRUE)
|
||||
BTA_DM_API_CFG_COEX_ST_EVT,
|
||||
#endif
|
||||
BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT,
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
BTA_DM_API_CONFIG_EIR_EVT,
|
||||
BTA_DM_API_PAGE_TO_SET_EVT,
|
||||
BTA_DM_API_PAGE_TO_GET_EVT,
|
||||
BTA_DM_API_SET_ACL_PKT_TYPES_EVT,
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
BTA_DM_API_SET_MIN_ENC_KEY_SIZE_EVT,
|
||||
#endif
|
||||
#endif
|
||||
BTA_DM_API_SET_AFH_CHANNELS_EVT,
|
||||
#if (SDP_INCLUDED == TRUE)
|
||||
@@ -80,7 +84,7 @@ enum {
|
||||
BTA_DM_API_PIN_REPLY_EVT,
|
||||
#endif ///SMP_INCLUDED == TRUE
|
||||
#if (BTA_DM_PM_INCLUDED == TRUE)
|
||||
/* power manger events */
|
||||
/* power manager events */
|
||||
BTA_DM_PM_BTM_STATUS_EVT,
|
||||
BTA_DM_PM_TIMER_EVT,
|
||||
#endif /* #if (BTA_DM_PM_INCLUDED == TRUE) */
|
||||
@@ -219,6 +223,9 @@ enum {
|
||||
BTA_DM_API_DTM_RX_START_EVT,
|
||||
BTA_DM_API_DTM_STOP_EVT,
|
||||
BTA_DM_API_BLE_CLEAR_ADV_EVT,
|
||||
BTA_DM_API_SET_RPA_TIMEOUT_EVT,
|
||||
BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT,
|
||||
BTA_DM_API_SET_PRIVACY_MODE_EVT,
|
||||
#endif
|
||||
BTA_DM_MAX_EVT
|
||||
};
|
||||
@@ -249,11 +256,13 @@ typedef struct {
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
BD_NAME name; /* max 248 bytes name, plus must be Null terminated */
|
||||
tBT_DEVICE_TYPE name_type; /* name for BLE, name for BT or name for BTDM */
|
||||
} tBTA_DM_API_SET_NAME;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
BT_HDR hdr;
|
||||
tBTA_GET_DEV_NAME_CBACK *p_cback;
|
||||
tBT_DEVICE_TYPE name_type;
|
||||
} tBTA_DM_API_GET_NAME;
|
||||
|
||||
#if (ESP_COEX_VSC_INCLUDED == TRUE)
|
||||
@@ -265,6 +274,14 @@ typedef struct {
|
||||
} tBTA_DM_API_CFG_COEX_STATUS;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 opcode;
|
||||
UINT8 param_len;
|
||||
UINT8 *p_param_buf;
|
||||
tBTA_SEND_VENDOR_HCI_CMPL_CBACK *vendor_hci_cb;
|
||||
}tBTA_DM_API_SEND_VENDOR_HCI_CMD;
|
||||
|
||||
/* data type for BTA_DM_API_CONFIG_EIR_EVT */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
@@ -308,6 +325,15 @@ typedef struct {
|
||||
tBTM_CMPL_CB *set_acl_pkt_types_cb;
|
||||
} tBTA_DM_API_SET_ACL_PKT_TYPES;
|
||||
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
/* data type for BTA_DM_API_SET_MIN_ENC_KEY_SIZE_EVT */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT8 key_size;
|
||||
tBTM_CMPL_CB *set_min_enc_key_size_cb;
|
||||
} tBTA_DM_API_SET_MIN_ENC_KEY_SIZE;
|
||||
#endif
|
||||
|
||||
/* data type for BTA_DM_API_GET_REMOTE_NAME_EVT */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
@@ -660,7 +686,7 @@ typedef struct {
|
||||
tBTA_DM_BLE_SEL_CBACK *p_select_cback;
|
||||
} tBTA_DM_API_BLE_SET_BG_CONN_TYPE;
|
||||
|
||||
/* set prefered BLE connection parameters for a device */
|
||||
/* set preferred BLE connection parameters for a device */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
BD_ADDR peer_bda;
|
||||
@@ -761,6 +787,20 @@ typedef struct {
|
||||
BT_HDR hdr;
|
||||
} tBTA_DM_APT_CLEAR_ADDR;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
UINT16 rpa_timeout;
|
||||
tBTA_SET_RPA_TIMEOUT_CMPL_CBACK *p_set_rpa_timeout_cback;
|
||||
} tBTA_DM_API_SET_RPA_TIMEOUT;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr; // Event header
|
||||
esp_bd_addr_t addr; // Bluetooth device address
|
||||
UINT8 addr_type; // Type of the address
|
||||
UINT8 irk[PEER_IRK_LEN]; // Identity Resolving Key (IRK)
|
||||
tBTA_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK *p_add_dev_to_resolving_list_callback; // Callback function pointer
|
||||
} tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST;
|
||||
|
||||
/* set adv parameter for BLE advertising */
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
@@ -911,6 +951,14 @@ typedef struct {
|
||||
tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback;
|
||||
} tBTA_DM_API_CLEAR_ADV;
|
||||
|
||||
typedef struct {
|
||||
BT_HDR hdr;
|
||||
tBLE_ADDR_TYPE addr_type;
|
||||
BD_ADDR addr;
|
||||
UINT8 privacy_mode;
|
||||
tBTA_SET_PRIVACY_MODE_CMPL_CBACK *p_cback;
|
||||
} tBTA_DM_API_SET_PRIVACY_MODE;
|
||||
|
||||
#endif /* BLE_INCLUDED */
|
||||
|
||||
/* data type for BTA_DM_API_REMOVE_ACL_EVT */
|
||||
@@ -1162,12 +1210,16 @@ typedef union {
|
||||
#if (ESP_COEX_VSC_INCLUDED == TRUE)
|
||||
tBTA_DM_API_CFG_COEX_STATUS cfg_coex_status;
|
||||
#endif
|
||||
tBTA_DM_API_SEND_VENDOR_HCI_CMD vendor_hci_cmd;
|
||||
tBTA_DM_API_CONFIG_EIR config_eir;
|
||||
|
||||
tBTA_DM_API_SET_AFH_CHANNELS set_afh_channels;
|
||||
tBTA_DM_API_PAGE_TO_SET set_page_timeout;
|
||||
tBTA_DM_API_PAGE_TO_GET get_page_timeout;
|
||||
tBTA_DM_API_SET_ACL_PKT_TYPES set_acl_pkt_types;
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
tBTA_DM_API_SET_MIN_ENC_KEY_SIZE set_min_enc_key_size;
|
||||
#endif
|
||||
#if (SDP_INCLUDED == TRUE)
|
||||
tBTA_DM_API_GET_REMOTE_NAME get_rmt_name;
|
||||
#endif
|
||||
@@ -1261,6 +1313,8 @@ typedef union {
|
||||
tBTA_DM_API_BLE_SET_DATA_LENGTH ble_set_data_length;
|
||||
tBTA_DM_APT_SET_DEV_ADDR set_addr;
|
||||
tBTA_DM_APT_CLEAR_ADDR clear_addr;
|
||||
tBTA_DM_API_SET_RPA_TIMEOUT set_rpa_timeout;
|
||||
tBTA_DM_API_ADD_DEV_TO_RESOLVING_LIST add_dev_to_resolving_list;
|
||||
tBTA_DM_API_BLE_MULTI_ADV_ENB ble_multi_adv_enb;
|
||||
tBTA_DM_API_BLE_MULTI_ADV_PARAM ble_multi_adv_param;
|
||||
tBTA_DM_API_BLE_MULTI_ADV_DATA ble_multi_adv_data;
|
||||
@@ -1310,6 +1364,7 @@ typedef union {
|
||||
tBTA_DM_API_BLE_DTM_RX_START dtm_rx_start;
|
||||
tBTA_DM_API_BLE_DTM_STOP dtm_stop;
|
||||
tBTA_DM_API_CLEAR_ADV ble_clear_adv;
|
||||
tBTA_DM_API_SET_PRIVACY_MODE ble_set_privacy_mode;
|
||||
#endif
|
||||
|
||||
tBTA_DM_API_REMOVE_ACL remove_acl;
|
||||
@@ -1444,7 +1499,7 @@ typedef struct {
|
||||
UINT32 role_policy_mask; /* the bits set indicates the modules that wants to remove role switch from the default link policy */
|
||||
UINT16 cur_policy; /* current default link policy */
|
||||
UINT16 rs_event; /* the event waiting for role switch */
|
||||
UINT8 cur_av_count; /* current AV connecions */
|
||||
UINT8 cur_av_count; /* current AV connections */
|
||||
BOOLEAN disable_pair_mode; /* disable pair mode or not */
|
||||
BOOLEAN conn_paired_only; /* allow connectable to paired device only or not */
|
||||
tBTA_DM_API_SEARCH search_msg;
|
||||
@@ -1676,11 +1731,15 @@ extern void bta_dm_get_dev_name (tBTA_DM_MSG *p_data);
|
||||
#if (ESP_COEX_VSC_INCLUDED == TRUE)
|
||||
extern void bta_dm_cfg_coex_status(tBTA_DM_MSG *p_data);
|
||||
#endif
|
||||
extern void bta_dm_send_vendor_hci(tBTA_DM_MSG *p_data);
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
extern void bta_dm_config_eir (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_set_page_timeout (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_get_page_timeout (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_set_acl_pkt_types (tBTA_DM_MSG *p_data);
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
extern void bta_dm_set_min_enc_key_size (tBTA_DM_MSG *p_data);
|
||||
#endif
|
||||
#endif
|
||||
extern void bta_dm_set_afh_channels (tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_read_rmt_name(tBTA_DM_MSG *p_data);
|
||||
@@ -1751,7 +1810,9 @@ extern void bta_dm_ble_gap_dtm_tx_start(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_dtm_rx_start(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_dtm_stop(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data);
|
||||
|
||||
extern void bta_dm_ble_gap_set_rpa_timeout(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_add_dev_to_resolving_list(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_set_privacy_mode(tBTA_DM_MSG *p_data);
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
extern void bta_dm_ble_gap_dtm_enhance_tx_start(tBTA_DM_MSG *p_data);
|
||||
extern void bta_dm_ble_gap_dtm_enhance_rx_start(tBTA_DM_MSG *p_data);
|
||||
|
||||
@@ -722,6 +722,26 @@ extern void bta_hd_exit_suspend_act(tBTA_HD_DATA *p_data)
|
||||
bta_sys_idle(BTA_ID_HD, 1, p_cback->addr);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Function bta_hd_open_failure
|
||||
*
|
||||
* Description
|
||||
*
|
||||
* Returns void
|
||||
*
|
||||
******************************************************************************/
|
||||
extern void bta_hd_open_failure(tBTA_HD_DATA *p_data)
|
||||
{
|
||||
tBTA_HD_CBACK_DATA *p_cback = (tBTA_HD_CBACK_DATA *)p_data;
|
||||
tBTA_HD cback_data = {0};
|
||||
|
||||
bdcpy(cback_data.conn.bda, p_cback->addr);
|
||||
cback_data.conn.status = BTA_HD_ERROR;
|
||||
cback_data.conn.conn_status = BTA_HD_CONN_STATE_DISCONNECTED;
|
||||
bta_hd_cb.p_cback(BTA_HD_OPEN_EVT, &cback_data);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Function bta_hd_cback
|
||||
|
||||
@@ -62,6 +62,7 @@ enum {
|
||||
BTA_HD_VC_UNPLUG_DONE_ACT,
|
||||
BTA_HD_SUSPEND_ACT,
|
||||
BTA_HD_EXIT_SUSPEND_ACT,
|
||||
BTA_HD_OPEN_FAILURE,
|
||||
BTA_HD_NUM_ACTIONS
|
||||
};
|
||||
|
||||
@@ -74,7 +75,7 @@ const tBTA_HD_ACTION bta_hd_action[] = {
|
||||
bta_hd_disconnect_act, bta_hd_add_device_act, bta_hd_remove_device_act, bta_hd_send_report_act,
|
||||
bta_hd_report_error_act, bta_hd_vc_unplug_act, bta_hd_open_act, bta_hd_close_act,
|
||||
bta_hd_intr_data_act, bta_hd_get_report_act, bta_hd_set_report_act, bta_hd_set_protocol_act,
|
||||
bta_hd_vc_unplug_done_act, bta_hd_suspend_act, bta_hd_exit_suspend_act,
|
||||
bta_hd_vc_unplug_done_act, bta_hd_suspend_act, bta_hd_exit_suspend_act, bta_hd_open_failure
|
||||
};
|
||||
|
||||
/* state table information */
|
||||
@@ -118,7 +119,7 @@ const uint8_t bta_hd_st_idle[][BTA_HD_NUM_COLS] = {
|
||||
/* BTA_HD_API_REPORT_ERROR_EVT */ {BTA_HD_IGNORE, BTA_HD_IDLE_ST},
|
||||
/* BTA_HD_API_VC_UNPLUG_EVT */ {BTA_HD_VC_UNPLUG_ACT, BTA_HD_IDLE_ST},
|
||||
/* BTA_HD_INT_OPEN_EVT */ {BTA_HD_OPEN_ACT, BTA_HD_CONN_ST},
|
||||
/* BTA_HD_INT_CLOSE_EVT */ {BTA_HD_IGNORE, BTA_HD_IDLE_ST},
|
||||
/* BTA_HD_INT_CLOSE_EVT */ {BTA_HD_OPEN_FAILURE, BTA_HD_IDLE_ST},
|
||||
/* BTA_HD_INT_INTR_DATA_EVT */ {BTA_HD_IGNORE, BTA_HD_IDLE_ST},
|
||||
/* BTA_HD_INT_GET_REPORT_EVT */ {BTA_HD_IGNORE, BTA_HD_IDLE_ST},
|
||||
/* BTA_HD_INT_SET_REPORT_EVT */ {BTA_HD_IGNORE, BTA_HD_IDLE_ST},
|
||||
|
||||
@@ -164,5 +164,6 @@ extern void bta_hd_set_protocol_act(tBTA_HD_DATA *p_data);
|
||||
extern void bta_hd_vc_unplug_done_act(tBTA_HD_DATA *p_data);
|
||||
extern void bta_hd_suspend_act(tBTA_HD_DATA *p_data);
|
||||
extern void bta_hd_exit_suspend_act(tBTA_HD_DATA *p_data);
|
||||
extern void bta_hd_open_failure(tBTA_HD_DATA *p_data);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -276,7 +276,7 @@ static void bta_hh_di_sdp_cback(UINT16 result)
|
||||
bta_hh_update_di_info(p_cb, di_rec.rec.vendor, di_rec.rec.product, di_rec.rec.version, 0);
|
||||
}
|
||||
|
||||
} else { /* no DI recrod available */
|
||||
} else { /* no DI record available */
|
||||
bta_hh_update_di_info(p_cb, BTA_HH_VENDOR_ID_INVALID, 0, 0, 0);
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ void bta_hh_start_sdp(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
|
||||
return;
|
||||
}
|
||||
/* GetSDPRecord. at one time only one SDP precedure can be active */
|
||||
/* GetSDPRecord. at one time only one SDP procedure can be active */
|
||||
else if (!bta_hh_cb.p_disc_db) {
|
||||
bta_hh_cb.p_disc_db = (tSDP_DISCOVERY_DB *) osi_malloc(p_bta_hh_cfg->sdp_db_size);
|
||||
|
||||
@@ -429,6 +429,7 @@ void bta_hh_sdp_cmpl(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
APPL_TRACE_DEBUG ("bta_hh_sdp_cmpl: HID_HostOpenDev failed: \
|
||||
Status 0x%2X", ret);
|
||||
#endif
|
||||
conn_dat.is_orig = HID_HostConnectOrig(p_cb->hid_handle);
|
||||
/* open fail, remove device from management device list */
|
||||
HID_HostRemoveDev( p_cb->hid_handle);
|
||||
status = BTA_HH_ERR;
|
||||
@@ -452,8 +453,6 @@ void bta_hh_sdp_cmpl(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
HID_HostRemoveDev( p_cb->incoming_hid_handle);
|
||||
}
|
||||
conn_dat.status = status;
|
||||
/* check if host initiate the connection*/
|
||||
conn_dat.is_orig = !p_cb->incoming_conn;
|
||||
(* bta_hh_cb.p_cback)(BTA_HH_OPEN_EVT, (tBTA_HH *)&conn_dat);
|
||||
|
||||
/* move state machine W4_CONN ->IDLE */
|
||||
@@ -523,8 +522,7 @@ void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
|
||||
memset((void *)&conn, 0, sizeof (tBTA_HH_CONN));
|
||||
conn.handle = dev_handle;
|
||||
/* check if host initiate the connection*/
|
||||
conn.is_orig = !p_cb->incoming_conn;
|
||||
conn.is_orig = HID_HostConnectOrig(dev_handle);
|
||||
bdcpy(conn.bda, p_cb->addr);
|
||||
|
||||
/* increase connection number */
|
||||
@@ -596,7 +594,7 @@ void bta_hh_open_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
if (p_cb->app_id != 0) {
|
||||
bta_hh_sm_execute(p_cb, BTA_HH_OPEN_CMPL_EVT, p_data);
|
||||
} else
|
||||
/* app_id == 0 indicates an incoming conenction request arrives without SDP
|
||||
/* app_id == 0 indicates an incoming connection request arrives without SDP
|
||||
performed, do it first */
|
||||
{
|
||||
/* store the handle here in case sdp fails - need to disconnect */
|
||||
@@ -637,7 +635,7 @@ void bta_hh_data_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
**
|
||||
** Function bta_hh_handsk_act
|
||||
**
|
||||
** Description HID Host process a handshake acknoledgement.
|
||||
** Description HID Host process a handshake acknowledgement.
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
@@ -674,7 +672,7 @@ void bta_hh_handsk_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
p_cb->w4_evt = 0;
|
||||
break;
|
||||
|
||||
/* acknoledgement from HID device for SET_ transaction */
|
||||
/* acknowledgement from HID device for SET_ transaction */
|
||||
case BTA_HH_SET_RPT_EVT:
|
||||
case BTA_HH_SET_PROTO_EVT:
|
||||
case BTA_HH_SET_IDLE_EVT :
|
||||
@@ -693,8 +691,7 @@ void bta_hh_handsk_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
case BTA_HH_OPEN_EVT:
|
||||
conn.status = p_data->hid_cback.data ? BTA_HH_ERR_PROTO : BTA_HH_OK;
|
||||
conn.handle = p_cb->hid_handle;
|
||||
/* check if host initiate the connection*/
|
||||
conn.is_orig = !p_cb->incoming_conn;
|
||||
conn.is_orig = HID_HostConnectOrig(p_cb->hid_handle);
|
||||
bdcpy(conn.bda, p_cb->addr);
|
||||
(* bta_hh_cb.p_cback)(p_cb->w4_evt, (tBTA_HH *)&conn);
|
||||
#if BTA_HH_DEBUG
|
||||
@@ -704,12 +701,12 @@ void bta_hh_handsk_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
break;
|
||||
|
||||
default:
|
||||
/* unknow transaction handshake response */
|
||||
/* unknown transaction handshake response */
|
||||
APPL_TRACE_DEBUG("unknown transaction type");
|
||||
break;
|
||||
}
|
||||
|
||||
/* transaction achknoledgement received, inform PM for mode change */
|
||||
/* transaction acknowledgement received, inform PM for mode change */
|
||||
bta_sys_idle(BTA_ID_HH, p_cb->app_id, p_cb->addr);
|
||||
return;
|
||||
}
|
||||
@@ -799,7 +796,7 @@ void bta_hh_open_failure(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
conn_dat.status = (reason == HID_ERR_AUTH_FAILED) ?
|
||||
BTA_HH_ERR_AUTH_FAILED : BTA_HH_ERR;
|
||||
/* check if host initiate the connection*/
|
||||
conn_dat.is_orig = !p_cb->incoming_conn;
|
||||
conn_dat.is_orig = HID_HostConnectOrig(p_cb->hid_handle);
|
||||
bdcpy(conn_dat.bda, p_cb->addr);
|
||||
HID_HostCloseDev(p_cb->hid_handle);
|
||||
|
||||
@@ -844,13 +841,13 @@ void bta_hh_close_act (tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
|
||||
|
||||
/* Check reason for closing */
|
||||
if ((reason & (HID_L2CAP_CONN_FAIL | HID_L2CAP_REQ_FAIL)) || /* Failure to initialize connection (page timeout or l2cap error) */
|
||||
(reason == HID_ERR_AUTH_FAILED) || /* Authenication error (while initiating) */
|
||||
(reason == HID_ERR_AUTH_FAILED) || /* Authentication error (while initiating) */
|
||||
(reason == HID_ERR_L2CAP_FAILED)) { /* Failure creating l2cap connection */
|
||||
/* Failure in opening connection */
|
||||
conn_dat.handle = p_cb->hid_handle;
|
||||
conn_dat.status = (reason == HID_ERR_AUTH_FAILED) ? BTA_HH_ERR_AUTH_FAILED : BTA_HH_ERR;
|
||||
/* check if host initiate the connection*/
|
||||
conn_dat.is_orig = !p_cb->incoming_conn;
|
||||
conn_dat.is_orig = HID_HostConnectOrig(p_cb->hid_handle);
|
||||
bdcpy(conn_dat.bda, p_cb->addr);
|
||||
HID_HostCloseDev(p_cb->hid_handle);
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ void bta_hh_sm_execute(tBTA_HH_DEV_CB *p_cb, UINT16 event, tBTA_HH_DATA *p_data)
|
||||
cback_data.conn.status = BTA_HH_ERR_DB_FULL;
|
||||
cback_data.conn.handle = BTA_HH_INVALID_HANDLE;
|
||||
/* check if host initiate the connection*/
|
||||
cback_data.conn.is_orig = !p_cb->incoming_conn;
|
||||
cback_data.conn.is_orig = TRUE;
|
||||
break;
|
||||
/* DB full, BTA_HhAddDev */
|
||||
case BTA_HH_API_MAINT_DEV_EVT:
|
||||
|
||||
@@ -398,7 +398,7 @@ typedef tBTM_BLE_128SERVICE tBTA_BLE_128SERVICE;
|
||||
typedef tBTM_BLE_32SERVICE tBTA_BLE_32SERVICE;
|
||||
|
||||
typedef struct {
|
||||
tBTA_BLE_INT_RANGE int_range; /* slave prefered conn interval range */
|
||||
tBTA_BLE_INT_RANGE int_range; /* slave preferred conn interval range */
|
||||
tBTA_BLE_MANU *p_manu; /* manufacturer data */
|
||||
tBTA_BLE_SERVICE *p_services; /* 16 bits services */
|
||||
tBTA_BLE_128SERVICE *p_services_128b; /* 128 bits service */
|
||||
@@ -417,6 +417,8 @@ typedef void (tBTA_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_CMPL_CBACK) (tBTA_STATUS st
|
||||
|
||||
typedef void (tBTA_SET_ADV_DATA_CMPL_CBACK) (tBTA_STATUS status);
|
||||
|
||||
typedef tBTM_VSC_CMPL_CB tBTA_SEND_VENDOR_HCI_CMPL_CBACK;
|
||||
|
||||
typedef tBTM_START_ADV_CMPL_CBACK tBTA_START_ADV_CMPL_CBACK;
|
||||
|
||||
typedef tBTM_START_STOP_ADV_CMPL_CBACK tBTA_START_STOP_ADV_CMPL_CBACK;
|
||||
@@ -431,8 +433,16 @@ typedef tBTM_SET_RAND_ADDR_CBACK tBTA_SET_RAND_ADDR_CBACK;
|
||||
|
||||
typedef tBTM_SET_LOCAL_PRIVACY_CBACK tBTA_SET_LOCAL_PRIVACY_CBACK;
|
||||
|
||||
typedef tBTM_SET_RPA_TIMEOUT_CMPL_CBACK tBTA_SET_RPA_TIMEOUT_CMPL_CBACK;
|
||||
|
||||
typedef tBTM_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK tBTA_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK;
|
||||
|
||||
typedef tBTM_SET_PRIVACY_MODE_CMPL_CBACK tBTA_SET_PRIVACY_MODE_CMPL_CBACK;
|
||||
|
||||
typedef tBTM_CMPL_CB tBTA_CMPL_CB;
|
||||
|
||||
typedef tBTM_VSC_CMPL tBTA_VSC_CMPL;
|
||||
|
||||
typedef tBTM_TX_POWER_RESULTS tBTA_TX_POWER_RESULTS;
|
||||
|
||||
typedef tBTM_RSSI_RESULTS tBTA_RSSI_RESULTS;
|
||||
@@ -445,6 +455,10 @@ typedef tBTM_GET_PAGE_TIMEOUT_RESULTS tBTA_GET_PAGE_TIMEOUT_RESULTS;
|
||||
|
||||
typedef tBTM_SET_ACL_PKT_TYPES_RESULTS tBTA_SET_ACL_PKT_TYPES_RESULTS;
|
||||
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
typedef tBTM_SET_MIN_ENC_KEY_SIZE_RESULTS tBTA_SET_MIN_ENC_KEY_SIZE_RESULTS;
|
||||
#endif
|
||||
|
||||
typedef tBTM_REMOTE_DEV_NAME tBTA_REMOTE_DEV_NAME;
|
||||
|
||||
/* advertising channel map */
|
||||
@@ -661,7 +675,7 @@ typedef UINT8 tBTA_SIG_STRENGTH_MASK;
|
||||
// btla-specific --
|
||||
#define BTA_DM_DEV_UNPAIRED_EVT 25 /* BT unpair event */
|
||||
#define BTA_DM_HW_ERROR_EVT 26 /* BT Chip H/W error */
|
||||
#define BTA_DM_LE_FEATURES_READ 27 /* Cotroller specific LE features are read */
|
||||
#define BTA_DM_LE_FEATURES_READ 27 /* Controller specific LE features are read */
|
||||
#define BTA_DM_ENER_INFO_READ 28 /* Energy info read */
|
||||
#define BTA_DM_BLE_DEV_UNPAIRED_EVT 29 /* BLE unpair event */
|
||||
#define BTA_DM_SP_KEY_REQ_EVT 30 /* Simple Pairing Passkey request */
|
||||
@@ -1107,7 +1121,7 @@ typedef struct {
|
||||
#define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */
|
||||
#define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */
|
||||
#define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */
|
||||
#define BTA_DM_DISC_BLE_RES_EVT 3 /* Discovery result for BLE GATT based servoce on a peer device. */
|
||||
#define BTA_DM_DISC_BLE_RES_EVT 3 /* Discovery result for BLE GATT based service on a peer device. */
|
||||
#define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */
|
||||
#define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */
|
||||
#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */
|
||||
@@ -1716,7 +1730,7 @@ extern void BTA_DisableTestMode(void);
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTA_DmSetDeviceName(const char *p_name);
|
||||
extern void BTA_DmSetDeviceName(const char *p_name, tBT_DEVICE_TYPE name_type);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -1728,7 +1742,7 @@ extern void BTA_DmSetDeviceName(const char *p_name);
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback);
|
||||
extern void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback, tBT_DEVICE_TYPE name_type);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -1744,6 +1758,8 @@ extern void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback);
|
||||
extern void BTA_DmCfgCoexStatus(UINT8 op, UINT8 type, UINT8 status);
|
||||
#endif
|
||||
|
||||
extern void BTA_DmsendVendorHciCmd(UINT16 opcode, UINT8 param_len, UINT8 *p_param_buf, tBTA_SEND_VENDOR_HCI_CMPL_CBACK p_vendor_cmd_complete_cback);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmGetRemoteName
|
||||
@@ -1829,6 +1845,20 @@ void BTA_DmGetPageTimeout(tBTM_CMPL_CB *p_cb);
|
||||
*******************************************************************************/
|
||||
void BTA_DmSetAclPktTypes(BD_ADDR remote_addr, UINT16 pkt_types, tBTM_CMPL_CB *p_cb);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmSetMinEncKeySize
|
||||
**
|
||||
** Description This function sets the minimal size of encryption key.
|
||||
**
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
|
||||
void BTA_DmSetMinEncKeySize(UINT8 key_size, tBTM_CMPL_CB *p_cb);
|
||||
#endif
|
||||
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
@@ -1929,7 +1959,7 @@ extern void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID *uuid,
|
||||
**
|
||||
** Function BTA_DmGetCachedRemoteName
|
||||
**
|
||||
** Description Retieve cached remote name if available
|
||||
** Description Retrieve cached remote name if available
|
||||
**
|
||||
** Returns BTA_SUCCESS if cached name was retrieved
|
||||
** BTA_FAILURE if cached name is not available
|
||||
@@ -2280,7 +2310,7 @@ extern void BTA_DmBleSetBgConnType(tBTA_DM_BLE_CONN_TYPE bg_conn_type, tBTA_DM_B
|
||||
** Description Send BLE SMP passkey reply.
|
||||
**
|
||||
** Parameters: bd_addr - BD address of the peer
|
||||
** accept - passkey entry sucessful or declined.
|
||||
** accept - passkey entry successful or declined.
|
||||
** passkey - passkey value, must be a 6 digit number,
|
||||
** can be lead by 0.
|
||||
**
|
||||
@@ -2446,7 +2476,7 @@ extern void BTA_DmSetBleScanFilterParams(tGATT_IF client_if, UINT32 scan_interva
|
||||
**
|
||||
** Parameters: adv_int_min - adv interval minimum
|
||||
** adv_int_max - adv interval max
|
||||
** p_dir_bda - directed adv initator address
|
||||
** p_dir_bda - directed adv initiator address
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
@@ -2472,7 +2502,7 @@ extern void BTA_DmSetBleAdvParamsAll (UINT16 adv_int_min, UINT16 adv_int_max,
|
||||
** services: if service is not empty, service discovery will be done.
|
||||
** for all GATT based service condition, put num_uuid, and
|
||||
** p_uuid is the pointer to the list of UUID values.
|
||||
** p_cback: callback functino when search is completed.
|
||||
** p_cback: callback function when search is completed.
|
||||
**
|
||||
**
|
||||
**
|
||||
@@ -2531,7 +2561,7 @@ extern void BTA_DmDiscoverByTransport(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_
|
||||
**
|
||||
** Parameters: bd_addr - Address of the peer device
|
||||
** transport - transport of the link to be encruypted
|
||||
** p_callback - Pointer to callback function to indicat the
|
||||
** p_callback - Pointer to callback function to indicate the
|
||||
** link encryption status
|
||||
** sec_act - This is the security action to indicate
|
||||
** what knid of BLE security level is required for
|
||||
@@ -2588,7 +2618,11 @@ extern void BTA_DmBleStopAdvertising(void);
|
||||
|
||||
extern void BTA_DmSetRandAddress(BD_ADDR rand_addr, tBTA_SET_RAND_ADDR_CBACK *p_set_rand_addr_cback);
|
||||
extern void BTA_DmClearRandAddress(void);
|
||||
|
||||
extern void BTA_DmBleSetRpaTimeout(uint16_t rpa_timeout,tBTA_SET_RPA_TIMEOUT_CMPL_CBACK *p_set_rpa_timeout_cback);
|
||||
extern void BTA_DmBleAddDevToResolvingList(BD_ADDR addr,
|
||||
uint8_t addr_type,
|
||||
PEER_IRK irk,
|
||||
tBTA_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK *add_dev_to_resolving_list_callback);
|
||||
#endif
|
||||
|
||||
#if BLE_INCLUDED == TRUE
|
||||
@@ -2599,7 +2633,7 @@ extern void BTA_DmClearRandAddress(void);
|
||||
**
|
||||
** Description Enable/disable privacy on the local device
|
||||
**
|
||||
** Parameters: privacy_enable - enable/disabe privacy on remote device.
|
||||
** Parameters: privacy_enable - enable/disable privacy on remote device.
|
||||
** set_local_privacy_cback -callback to be called with result
|
||||
** Returns void
|
||||
**
|
||||
@@ -2626,7 +2660,7 @@ extern void BTA_DmBleConfigLocalIcon(uint16_t icon);
|
||||
** Description Enable/disable privacy on a remote device
|
||||
**
|
||||
** Parameters: bd_addr - BD address of the peer
|
||||
** privacy_enable - enable/disabe privacy on remote device.
|
||||
** privacy_enable - enable/disable privacy on remote device.
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
@@ -2861,6 +2895,8 @@ extern void BTA_DmBleDtmTxStart(uint8_t tx_channel, uint8_t len_of_data, uint8_t
|
||||
extern void BTA_DmBleDtmRxStart(uint8_t rx_channel, tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback);
|
||||
extern void BTA_DmBleDtmStop(tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback);
|
||||
|
||||
extern void BTA_DmBleSetPrivacyMode(uint8_t addr_type, BD_ADDR addr, uint8_t privacy_mode, tBTA_SET_PRIVACY_MODE_CMPL_CBACK *p_cback);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmBleSetStorageParams
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* This is the implementation of the JAVA API for Bluetooth Wireless
|
||||
* Technology (JABWT) as specified by the JSR82 specificiation
|
||||
* Technology (JABWT) as specified by the JSR82 specification
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -118,6 +118,11 @@ void BTA_JvDisable(tBTA_JV_RFCOMM_CBACK *p_cback)
|
||||
|
||||
APPL_TRACE_API( "BTA_JvDisable");
|
||||
bta_sys_deregister(BTA_ID_JV);
|
||||
memset(&bta_jv_cb, 0, sizeof(tBTA_JV_CB));
|
||||
/* set handle to invalid value by default */
|
||||
for (int i = 0; i < BTA_JV_PM_MAX_NUM; i++) {
|
||||
bta_jv_cb.pm_cb[i].handle = BTA_JV_PM_HANDLE_CLEAR;
|
||||
}
|
||||
if ((p_buf = (tBTA_JV_API_DISABLE *) osi_malloc(sizeof(tBTA_JV_API_DISABLE))) != NULL) {
|
||||
p_buf->hdr.event = BTA_JV_API_DISABLE_EVT;
|
||||
p_buf->p_cback = p_cback;
|
||||
@@ -893,7 +898,7 @@ tBTA_JV_STATUS BTA_JvRfcommConfig(BOOLEAN enable_l2cap_ertm)
|
||||
**
|
||||
** Function BTA_JvRfcommConnect
|
||||
**
|
||||
** Description This function makes an RFCOMM conection to a remote BD
|
||||
** Description This function makes an RFCOMM connection to a remote BD
|
||||
** Address.
|
||||
** When the connection is initiated or failed to initiate,
|
||||
** tBTA_JV_RFCOMM_CBACK is called with BTA_JV_RFCOMM_CL_INIT_EVT
|
||||
@@ -1204,7 +1209,7 @@ tBTA_JV_STATUS BTA_JvRfcommFlowControl(UINT32 handle, UINT16 credits_given)
|
||||
** Parameters: handle, JV handle from RFCOMM or L2CAP
|
||||
** app_id: app specific pm ID, can be BTA_JV_PM_ALL, see bta_dm_cfg.c for details
|
||||
** BTA_JV_PM_ID_CLEAR: removes pm management on the handle. init_st is ignored and
|
||||
** BTA_JV_CONN_CLOSE is called implicitely
|
||||
** BTA_JV_CONN_CLOSE is called implicitly
|
||||
** init_st: state after calling this API. typically it should be BTA_JV_CONN_OPEN
|
||||
**
|
||||
** Returns BTA_JV_SUCCESS, if the request is being processed.
|
||||
|
||||
Reference in New Issue
Block a user