/* Let the incoming connection goes through. */
/* Issue collision for this scb for now. */
/* We will decide what to do when we find incoming connetion later. */
- bta_ag_collision_cback(0, BTA_ID_AG, 0, to_BD_ADDR(p_scb->peer_addr));
+ bta_ag_collision_cback(0, BTA_ID_AG, 0, &p_scb->peer_addr);
return;
}
close.hdr.app_id = p_scb->app_id;
close.bd_addr = p_scb->peer_addr;
- bta_sys_conn_close(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_conn_close(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
/* call close call-out */
bta_ag_co_data_close(close.hdr.handle);
}
if (!num_active_conn) {
- bta_sys_sco_unuse(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_unuse(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
}
}
bta_ag_co_data_open(bta_ag_scb_to_idx(p_scb),
bta_ag_svc_id[p_scb->conn_service]);
- bta_sys_conn_open(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_conn_open(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
bta_ag_cback_open(p_scb, NULL, BTA_AG_SUCCESS);
}
/* run AT command interpreter on data */
- bta_sys_busy(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_busy(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
bta_ag_at_parse(&p_scb->at_cb, buf, len);
if ((p_scb->sco_idx != BTM_INVALID_SCO_INDEX) &&
bta_ag_sco_is_open(p_scb)) {
APPL_TRACE_DEBUG("%s change link policy for SCO", __func__);
- bta_sys_sco_open(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_open(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
} else {
- bta_sys_idle(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_idle(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
}
/* no more data to read, we're done */
if ((p_scb->call_ind != BTA_AG_CALL_INACTIVE) ||
(p_scb->callsetup_ind != BTA_AG_CALLSETUP_NONE)) {
- bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
}
(*bta_ag_cb.p_cback)(BTA_AG_CONN_EVT, (tBTA_AG*)&evt);
APPL_TRACE_DEBUG("bta_ag_ci_rx_data:");
/* send to RFCOMM */
- bta_sys_busy(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_busy(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
PORT_WriteData(p_scb->conn_handle, p_data_area, strlen(p_data_area), &len);
if ((p_scb->sco_idx != BTM_INVALID_SCO_INDEX) && bta_ag_sco_is_open(p_scb)) {
APPL_TRACE_DEBUG("bta_ag_rfc_data, change link policy for SCO");
- bta_sys_sco_open(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_open(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
} else {
- bta_sys_idle(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_idle(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
}
}
case BTA_AG_IN_CALL_RES:
/* tell sys to stop av if any */
- bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
/* if sco already opened or no inband ring send ring now */
if (bta_ag_sco_is_open(p_scb) || !bta_ag_inband_enabled(p_scb) ||
bta_ag_sco_close(p_scb, (tBTA_AG_DATA*)p_result);
} else {
/* if av got suspended by this call, let it resume. */
- bta_sys_sco_unuse(BTA_ID_AG, p_scb->app_id,
- to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_unuse(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
}
break;
case BTA_AG_IN_CALL_RES:
/* tell sys to stop av if any */
- bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
/* store caller id string.
* append type info at the end.
bta_ag_send_call_inds(p_scb, p_result->result);
/* if av got suspended by this call, let it resume. */
- bta_sys_sco_unuse(BTA_ID_AG, p_scb->app_id,
- to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_unuse(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
}
break;
tBTA_AG_DATA* p_data);
extern bool bta_ag_hdl_event(BT_HDR* p_msg);
extern void bta_ag_collision_cback(tBTA_SYS_CONN_STATUS status, uint8_t id,
- uint8_t app_id, BD_ADDR peer_addr);
+ uint8_t app_id,
+ const bt_bdaddr_t* peer_addr);
extern void bta_ag_resume_open(tBTA_AG_SCB* p_scb);
/* SDP functions */
*
******************************************************************************/
void bta_ag_collision_cback(UNUSED_ATTR tBTA_SYS_CONN_STATUS status, uint8_t id,
- UNUSED_ATTR uint8_t app_id, BD_ADDR peer_addr) {
+ UNUSED_ATTR uint8_t app_id,
+ const bt_bdaddr_t* peer_addr) {
uint16_t handle;
tBTA_AG_SCB* p_scb;
/* Check if we have opening scb for the peer device. */
- handle = bta_ag_idx_by_bdaddr(&from_BD_ADDR(peer_addr));
+ handle = bta_ag_idx_by_bdaddr(peer_addr);
p_scb = bta_ag_scb_by_idx(handle);
if (p_scb && (p_scb->state == BTA_AG_OPENING_ST)) {
p_scb->inuse_codec = esco_codec;
/* tell sys to stop av if any */
- bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
/* Send pending commands to create SCO connection to peer */
bta_ag_create_pending_sco(p_scb, bta_ag_cb.sco.is_local);
if ((p_scb->codec_updated || p_scb->codec_fallback) &&
(p_scb->peer_features & BTA_AG_PEER_FEAT_CODEC)) {
/* Change the power mode to Active until SCO open is completed. */
- bta_sys_busy(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_busy(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
/* Send +BCS to the peer */
bta_ag_send_bcs(p_scb, NULL);
UNUSED_ATTR tBTA_AG_DATA* p_data) {
bta_ag_sco_event(p_scb, BTA_AG_SCO_CONN_OPEN_E);
- bta_sys_sco_open(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_open(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
#if (BTM_SCO_HCI_INCLUDED == TRUE)
/* open SCO codec if SCO is routed through transport */
/* Indicate if the closing of audio is because of transfer */
bta_ag_sco_event(p_scb, BTA_AG_SCO_CONN_CLOSE_E);
- bta_sys_sco_close(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_close(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
/* if av got suspended by this call, let it resume. */
/* In case call stays alive regardless of sco, av should not be affected. */
if (((p_scb->call_ind == BTA_AG_CALL_INACTIVE) &&
(p_scb->callsetup_ind == BTA_AG_CALLSETUP_NONE)) ||
(p_scb->post_sco == BTA_AG_POST_SCO_CALL_END)) {
- bta_sys_sco_unuse(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_unuse(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
}
/* call app callback */
bta_ag_cb.sco.state == BTA_AG_SCO_CLOSE_XFER_ST ||
bta_ag_cb.sco.state == BTA_AG_SCO_OPEN_XFER_ST) {
/* tell sys to stop av if any */
- bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
/* When HS initiated SCO, it cannot be WBS. */
#if (BTM_SCO_HCI_INCLUDED == TRUE)
/* Configure the transport being used */
p_scb->wait &= ~BTA_AV_WAIT_ROLE_SW_BITS;
if (p_data->role_res.hci_status != HCI_SUCCESS) {
p_scb->role &= ~BTA_AV_ROLE_START_INT;
- bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt,
- to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
/* start failed because of role switch. */
start.chnl = p_scb->chnl;
start.status = BTA_AV_FAIL_ROLE;
p_scb->sec_mask = p_data->api_open.sec_mask;
p_scb->use_rc = p_data->api_open.use_rc;
- bta_sys_app_open(BTA_ID_AV, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_app_open(BTA_ID_AV, p_scb->app_id, p_scb->peer_addr);
if (p_scb->skip_sdp == true) {
tA2DP_Service a2dp_ser;
num > 1) {
/* if SBC is used by the SNK as INT, discover req is not sent in
* bta_av_config_ind.
- * call disc_res now */
+ * call disc_res now */
/* this is called in A2DP SRC path only, In case of SINK we don't need it
*/
if (local_sep == AVDT_TSEP_SRC)
L2CA_SetTxPriority(p_scb->l2c_cid, L2CAP_CHNL_PRIORITY_MEDIUM);
L2CA_SetChnlFlushability(p_scb->l2c_cid, true);
- bta_sys_conn_open(BTA_ID_AV, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_conn_open(BTA_ID_AV, p_scb->app_id, p_scb->peer_addr);
memset(&p_scb->q_info, 0, sizeof(tBTA_AV_Q_INFO));
p_scb->l2c_bufs = 0;
policy |= HCI_ENABLE_MASTER_SLAVE_SWITCH;
}
- bta_sys_clear_policy(BTA_ID_AV, policy, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_clear_policy(BTA_ID_AV, policy, p_scb->peer_addr);
if ((p_scb->started == false) &&
((p_scb->role & BTA_AV_ROLE_START_INT) == 0)) {
p_scb->role |= BTA_AV_ROLE_START_INT;
- bta_sys_busy(BTA_ID_AV, bta_av_cb.audio_open_cnt,
- to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_busy(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
AVDT_StartReq(&p_scb->avdt_handle, 1);
} else if (p_scb->started) {
APPL_TRACE_ERROR("%s: audio_open_cnt=%d, p_data %p", __func__,
bta_av_cb.audio_open_cnt, p_data);
- bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt,
- to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
if ((bta_av_cb.features & BTA_AV_FEAT_MASTER) == 0 ||
bta_av_cb.audio_open_cnt == 1)
policy |= HCI_ENABLE_MASTER_SLAVE_SWITCH;
- bta_sys_set_policy(BTA_ID_AV, policy, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_set_policy(BTA_ID_AV, policy, p_scb->peer_addr);
if (p_scb->co_started) {
/* TODO(eisenbach): RE-IMPLEMENT USING VSC OR HAL EXTENSION
if (p_data && (p_data->hdr.offset != BTA_AV_RS_NONE)) {
p_scb->wait &= ~BTA_AV_WAIT_ROLE_SW_BITS;
if (p_data->hdr.offset == BTA_AV_RS_FAIL) {
- bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt,
- to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
start.chnl = p_scb->chnl;
start.status = BTA_AV_FAIL_ROLE;
start.hndl = p_scb->hndl;
* first bit of p_scb->wait is cleared hence it ensures bt_av_start_ok is
* not called
* again from bta_av_save_caps.
- */
+ */
p_scb->wait &= ~BTA_AV_WAIT_ACP_CAPS_ON;
}
/* tell role manager to check M/S role */
- bta_sys_conn_open(BTA_ID_AV, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_conn_open(BTA_ID_AV, p_scb->app_id, p_scb->peer_addr);
- bta_sys_busy(BTA_ID_AV, bta_av_cb.audio_open_cnt,
- to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_busy(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
if (p_scb->media_type == AVDT_MEDIA_TYPE_AUDIO) {
/* in normal logic, conns should be bta_av_cb.audio_count - 1,
/* If sink starts stream, disable sniff mode here */
if (!initiator) {
/* If souce is the master role, disable role switch during streaming.
- * Otherwise allow role switch, if source is slave.
- * Because it would not hurt source, if the peer device wants source to be
- * master */
+ * Otherwise allow role switch, if source is slave.
+ * Because it would not hurt source, if the peer device wants source to be
+ * master */
if ((BTM_GetRole(p_scb->peer_addr, &cur_role) == BTM_SUCCESS) &&
(cur_role == BTM_ROLE_MASTER)) {
policy |= HCI_ENABLE_MASTER_SLAVE_SWITCH;
}
- bta_sys_clear_policy(BTA_ID_AV, policy, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_clear_policy(BTA_ID_AV, policy, p_scb->peer_addr);
}
p_scb->role = new_role;
******************************************************************************/
void bta_av_start_failed(tBTA_AV_SCB* p_scb, UNUSED_ATTR tBTA_AV_DATA* p_data) {
if (p_scb->started == false && p_scb->co_started == false) {
- bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt,
- to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
notify_start_failed(p_scb);
}
bta_sys_set_policy(BTA_ID_AV,
(HCI_ENABLE_SNIFF_MODE | HCI_ENABLE_MASTER_SLAVE_SWITCH),
- to_BD_ADDR(p_scb->peer_addr));
+ p_scb->peer_addr);
p_scb->sco_suspend = false;
}
if ((bta_av_cb.features & BTA_AV_FEAT_MASTER) == 0 ||
bta_av_cb.audio_open_cnt == 1)
policy |= HCI_ENABLE_MASTER_SLAVE_SWITCH;
- bta_sys_set_policy(BTA_ID_AV, policy, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_set_policy(BTA_ID_AV, policy, p_scb->peer_addr);
if (bta_av_cb.audio_open_cnt <= 1) {
/* last connection - restore the allow switch flag */
L2CA_SetDesireRole(L2CAP_ROLE_ALLOW_SWITCH);
event = BTA_AV_OPEN_EVT;
p_scb->open_status = BTA_AV_SUCCESS;
- bta_sys_conn_close(BTA_ID_AV, p_scb->app_id, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_conn_close(BTA_ID_AV, p_scb->app_id, p_scb->peer_addr);
bta_av_cleanup(p_scb, p_data);
(*bta_av_cb.p_cback)(event, &data);
} else {
data.close.hndl = p_scb->hndl;
event = BTA_AV_CLOSE_EVT;
- bta_sys_conn_close(BTA_ID_AV, p_scb->app_id,
- to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_conn_close(BTA_ID_AV, p_scb->app_id, p_scb->peer_addr);
bta_av_cleanup(p_scb, p_data);
(*bta_av_cb.p_cback)(event, &data);
}
if (p_scb->started == false) {
/* handle the condition where there is a collision of SUSPEND req from
- *either side
- ** Second SUSPEND req could be rejected. Do not treat this as a failure
- */
+ *either side
+ ** Second SUSPEND req could be rejected. Do not treat this as a failure
+ */
APPL_TRACE_WARNING("%s: already suspended, ignore, err_code %d", __func__,
err_code);
return;
p_scb->cong = false;
}
- bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt,
- to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
if ((bta_av_cb.features & BTA_AV_FEAT_MASTER) == 0 ||
bta_av_cb.audio_open_cnt == 1)
policy |= HCI_ENABLE_MASTER_SLAVE_SWITCH;
- bta_sys_set_policy(BTA_ID_AV, policy, to_BD_ADDR(p_scb->peer_addr));
+ bta_sys_set_policy(BTA_ID_AV, policy, p_scb->peer_addr);
/* in case that we received suspend_ind, we may need to call co_stop here */
if (p_scb->co_started) {
APPL_TRACE_DEBUG("%s: Re-start timer for AVDTP service", __func__);
bta_sys_conn_open(BTA_ID_AV, p_cb->p_scb[xx]->app_id,
- to_BD_ADDR(p_cb->p_scb[xx]->peer_addr));
+ p_cb->p_scb[xx]->peer_addr);
/* Possible collision : need to avoid outgoing processing while the
* timer is running */
p_cb->p_scb[xx]->coll_mask = BTA_AV_COLL_INC_TMR;
p_cb->p_scb[xx]->peer_addr == p_data->str_msg.bd_addr) {
APPL_TRACE_DEBUG("%s: Closing timer for AVDTP service", __func__);
bta_sys_conn_close(BTA_ID_AV, p_cb->p_scb[xx]->app_id,
- to_BD_ADDR(p_cb->p_scb[xx]->peer_addr));
+ p_cb->p_scb[xx]->peer_addr);
}
mask = 1 << (xx + 1);
if (((mask & p_lcb->conn_msk) || bta_av_cb.conn_lcb) &&
static void bta_av_api_to_ssm(tBTA_AV_DATA* p_data);
static void bta_av_sco_chg_cback(tBTA_SYS_CONN_STATUS status, uint8_t id,
- uint8_t app_id, BD_ADDR peer_addr);
+ uint8_t app_id, const bt_bdaddr_t* peer_addr);
static void bta_av_sys_rs_cback(tBTA_SYS_CONN_STATUS status, uint8_t id,
- uint8_t app_id, BD_ADDR peer_addr);
+ uint8_t app_id, const bt_bdaddr_t* peer_addr);
/* action functions */
const tBTA_AV_NSM_ACT bta_av_nsm_act[] = {
if (p_cb->conn_audio == mask) {
if (p_cb->p_scb[i]) {
bta_sys_set_policy(BTA_ID_AV, HCI_ENABLE_MASTER_SLAVE_SWITCH,
- to_BD_ADDR(p_cb->p_scb[i]->peer_addr));
+ p_cb->p_scb[i]->peer_addr);
}
break;
}
*
******************************************************************************/
static void bta_av_sys_rs_cback(UNUSED_ATTR tBTA_SYS_CONN_STATUS status,
- uint8_t id, uint8_t app_id, BD_ADDR peer_addr) {
+ uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t* peer_addr) {
int i;
tBTA_AV_SCB* p_scb = NULL;
uint8_t cur_role;
* role change event */
/* note that more than one SCB (a2dp & vdp) maybe waiting for this event */
p_scb = bta_av_cb.p_scb[i];
- if (p_scb && p_scb->peer_addr == from_BD_ADDR(peer_addr)) {
+ if (p_scb && p_scb->peer_addr == *peer_addr) {
tBTA_AV_ROLE_RES* p_buf =
(tBTA_AV_ROLE_RES*)osi_malloc(sizeof(tBTA_AV_ROLE_RES));
APPL_TRACE_DEBUG("new_role:%d, hci_status:x%x hndl: x%x", id, app_id,
/* restore role switch policy, if role switch failed */
if ((HCI_SUCCESS != app_id) &&
- (BTM_GetRole(from_BD_ADDR(peer_addr), &cur_role) == BTM_SUCCESS) &&
+ (BTM_GetRole(*peer_addr, &cur_role) == BTM_SUCCESS) &&
(cur_role == BTM_ROLE_SLAVE)) {
- bta_sys_set_policy(BTA_ID_AV, HCI_ENABLE_MASTER_SLAVE_SWITCH, peer_addr);
+ bta_sys_set_policy(BTA_ID_AV, HCI_ENABLE_MASTER_SLAVE_SWITCH, *peer_addr);
}
/* if BTA_AvOpen() was called for other device, which caused the role switch
******************************************************************************/
static void bta_av_sco_chg_cback(tBTA_SYS_CONN_STATUS status, uint8_t id,
UNUSED_ATTR uint8_t app_id,
- UNUSED_ATTR BD_ADDR peer_addr) {
+ UNUSED_ATTR const bt_bdaddr_t* peer_addr) {
tBTA_AV_SCB* p_scb;
int i;
tBTA_AV_API_STOP stop;
if (BTM_ROLE_MASTER != role) {
if (bta_av_cb.features & BTA_AV_FEAT_MASTER)
bta_sys_clear_policy(BTA_ID_AV, HCI_ENABLE_MASTER_SLAVE_SWITCH,
- to_BD_ADDR(p_scbi->peer_addr));
+ p_scbi->peer_addr);
if (BTM_CMD_STARTED !=
BTM_SwitchRole(p_scbi->peer_addr, BTM_ROLE_MASTER, NULL)) {
/* can not switch role on SCBI
(bta_av_cb.features & BTA_AV_FEAT_MASTER))) {
if (bta_av_cb.features & BTA_AV_FEAT_MASTER)
bta_sys_clear_policy(BTA_ID_AV, HCI_ENABLE_MASTER_SLAVE_SWITCH,
- to_BD_ADDR(p_scb->peer_addr));
+ p_scb->peer_addr);
if (BTM_CMD_STARTED !=
BTM_SwitchRole(p_scb->peer_addr, BTM_ROLE_MASTER, NULL)) {
* if so, make sure the AV link is master */
bta_dm_check_av(0);
}
- bta_sys_notify_role_chg(to_BD_ADDR(p_data->acl_change.bd_addr),
+ bta_sys_notify_role_chg(p_data->acl_change.bd_addr,
p_data->acl_change.new_role,
p_data->acl_change.hci_status);
conn.role_chg.bd_addr = p_bda;
/* Collision report from Stack: Notify profiles */
if (p_data->acl_change.event == BTM_BL_COLLISION_EVT) {
- bta_sys_notify_collision(to_BD_ADDR(p_bda));
+ bta_sys_notify_collision(p_bda);
return;
}
if (p_clcb->p_rcb) {
/* there is no RM for GATT */
if (p_clcb->transport == BTA_TRANSPORT_BR_EDR)
- bta_sys_conn_open(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda.address);
+ bta_sys_conn_open(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda);
bta_gattc_send_open_cback(p_clcb->p_rcb, BTA_GATT_OK, p_clcb->bda,
p_clcb->bta_conn_id, p_clcb->transport,
cb_data.close.remote_bda = p_clcb->bda;
if (p_clcb->transport == BTA_TRANSPORT_BR_EDR)
- bta_sys_conn_close(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda.address);
+ bta_sys_conn_close(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda);
bta_gattc_clcb_dealloc(p_clcb);
} else {
/* if over BR_EDR, inform PM for mode change */
if (p_clcb->transport == BTA_TRANSPORT_BR_EDR) {
- bta_sys_busy(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda.address);
- bta_sys_idle(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda.address);
+ bta_sys_busy(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda);
+ bta_sys_idle(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda);
}
}
}
/* if over BR_EDR, inform PM for mode change */
if (p_clcb->transport == BTA_TRANSPORT_BR_EDR) {
- bta_sys_busy(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda.address);
- bta_sys_idle(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda.address);
+ bta_sys_busy(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda);
+ bta_sys_idle(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda);
}
bta_gattc_cmpl_sendmsg(conn_id, op, status, p_data);
/* if over BR_EDR, inform PM for mode change */
if (transport == BTA_TRANSPORT_BR_EDR) {
- bta_sys_busy(BTA_ID_GATTS, BTA_ALL_APP_ID, remote_bda.address);
- bta_sys_idle(BTA_ID_GATTS, BTA_ALL_APP_ID, remote_bda.address);
+ bta_sys_busy(BTA_ID_GATTS, BTA_ALL_APP_ID, remote_bda);
+ bta_sys_idle(BTA_ID_GATTS, BTA_ALL_APP_ID, remote_bda);
}
} else {
APPL_TRACE_ERROR("Unknown connection ID: %d fail sending notification",
if (p_rcb && p_rcb->p_cback) {
if (transport == BTA_TRANSPORT_BR_EDR)
- bta_sys_conn_close(BTA_ID_GATTS, BTA_ALL_APP_ID, remote_bda.address);
+ bta_sys_conn_close(BTA_ID_GATTS, BTA_ALL_APP_ID, remote_bda);
(*p_rcb->p_cback)(BTA_GATTS_CLOSE_EVT, (tBTA_GATTS*)&status);
}
if (p_rcb && p_rcb->p_cback) {
/* if over BR_EDR, inform PM for mode change */
if (transport == BTA_TRANSPORT_BR_EDR) {
- bta_sys_busy(BTA_ID_GATTS, BTA_ALL_APP_ID,
- cb_data.req_data.remote_bda.address);
- bta_sys_idle(BTA_ID_GATTS, BTA_ALL_APP_ID,
- cb_data.req_data.remote_bda.address);
+ bta_sys_busy(BTA_ID_GATTS, BTA_ALL_APP_ID, cb_data.req_data.remote_bda);
+ bta_sys_idle(BTA_ID_GATTS, BTA_ALL_APP_ID, cb_data.req_data.remote_bda);
}
cb_data.req_data.conn_id = conn_id;
/* there is no RM for GATT */
if (transport == BTA_TRANSPORT_BR_EDR) {
if (connected)
- bta_sys_conn_open(BTA_ID_GATTS, BTA_ALL_APP_ID, to_BD_ADDR(bdaddr));
+ bta_sys_conn_open(BTA_ID_GATTS, BTA_ALL_APP_ID, bdaddr);
else
- bta_sys_conn_close(BTA_ID_GATTS, BTA_ALL_APP_ID, to_BD_ADDR(bdaddr));
+ bta_sys_conn_close(BTA_ID_GATTS, BTA_ALL_APP_ID, bdaddr);
}
cb_data.conn.conn_id = conn_id;
p_report->data);
/* trigger PM */
- bta_sys_busy(BTA_ID_HD, 1, to_BD_ADDR(bta_hd_cb.bd_addr));
- bta_sys_idle(BTA_ID_HD, 1, to_BD_ADDR(bta_hd_cb.bd_addr));
+ bta_sys_busy(BTA_ID_HD, 1, bta_hd_cb.bd_addr);
+ bta_sys_idle(BTA_ID_HD, 1, bta_hd_cb.bd_addr);
}
/*******************************************************************************
}
/* trigger PM */
- bta_sys_busy(BTA_ID_HD, 1, to_BD_ADDR(bta_hd_cb.bd_addr));
- bta_sys_idle(BTA_ID_HD, 1, to_BD_ADDR(bta_hd_cb.bd_addr));
+ bta_sys_busy(BTA_ID_HD, 1, bta_hd_cb.bd_addr);
+ bta_sys_idle(BTA_ID_HD, 1, bta_hd_cb.bd_addr);
}
/*******************************************************************************
APPL_TRACE_API("%s", __func__);
HID_DevPlugDevice(p_cback->addr);
- bta_sys_conn_open(BTA_ID_HD, 1, to_BD_ADDR(p_cback->addr));
+ bta_sys_conn_open(BTA_ID_HD, 1, p_cback->addr);
cback_data.conn.bda = p_cback->addr;
bta_hd_cb.bd_addr = p_cback->addr;
APPL_TRACE_API("%s", __func__);
- bta_sys_conn_close(BTA_ID_HD, 1, to_BD_ADDR(p_cback->addr));
+ bta_sys_conn_close(BTA_ID_HD, 1, p_cback->addr);
if (bta_hd_cb.vc_unplug) {
bta_hd_cb.vc_unplug = FALSE;
APPL_TRACE_API("%s", __func__);
- bta_sys_conn_close(BTA_ID_HD, 1, to_BD_ADDR(p_cback->addr));
+ bta_sys_conn_close(BTA_ID_HD, 1, p_cback->addr);
HID_DevUnplugDevice(p_cback->addr);
APPL_TRACE_API("%s", __func__);
- bta_sys_idle(BTA_ID_HD, 1, to_BD_ADDR(p_cback->addr));
+ bta_sys_idle(BTA_ID_HD, 1, p_cback->addr);
}
/*******************************************************************************
APPL_TRACE_API("%s", __func__);
- bta_sys_busy(BTA_ID_HD, 1, to_BD_ADDR(p_cback->addr));
- bta_sys_idle(BTA_ID_HD, 1, to_BD_ADDR(p_cback->addr));
+ bta_sys_busy(BTA_ID_HD, 1, p_cback->addr);
+ bta_sys_idle(BTA_ID_HD, 1, p_cback->addr);
}
/*******************************************************************************
/* Let the incoming connection goes through. */
/* Issue collision for now. */
/* We will decide what to do when we find incoming connection later.*/
- bta_hf_client_collision_cback(0, BTA_ID_HS, 0,
- to_BD_ADDR(client_cb->peer_addr));
+ bta_hf_client_collision_cback(0, BTA_ID_HS, 0, &client_cb->peer_addr);
return;
}
return;
}
- bta_sys_conn_open(BTA_ID_HS, 1, to_BD_ADDR(client_cb->peer_addr));
+ bta_sys_conn_open(BTA_ID_HS, 1, client_cb->peer_addr);
/* start SLC procedure */
bta_hf_client_slc_seq(client_cb, false);
bta_hf_client_at_reset(client_cb);
- bta_sys_conn_close(BTA_ID_HS, 1, to_BD_ADDR(client_cb->peer_addr));
+ bta_sys_conn_close(BTA_ID_HS, 1, client_cb->peer_addr);
/* call close cback */
tBTA_HF_CLIENT evt;
/* Make sure SCO is shutdown */
bta_hf_client_sco_shutdown(client_cb);
- bta_sys_sco_unuse(BTA_ID_HS, 1, to_BD_ADDR(client_cb->peer_addr));
+ bta_sys_sco_unuse(BTA_ID_HS, 1, client_cb->peer_addr);
}
/* else close port and deallocate scb */
else {
extern void bta_hf_client_app_callback(uint16_t event, tBTA_HF_CLIENT* data);
extern void bta_hf_client_collision_cback(tBTA_SYS_CONN_STATUS status,
uint8_t id, uint8_t app_id,
- BD_ADDR peer_addr);
+ const bt_bdaddr_t* peer_addr);
extern void bta_hf_client_resume_open(tBTA_HF_CLIENT_CB* client_cb);
extern tBTA_STATUS bta_hf_client_api_enable(tBTA_HF_CLIENT_CBACK* p_cback,
tBTA_SEC sec_mask,
******************************************************************************/
void bta_hf_client_collision_cback(UNUSED_ATTR tBTA_SYS_CONN_STATUS status,
uint8_t id, UNUSED_ATTR uint8_t app_id,
- BD_ADDR peer_addr) {
- tBTA_HF_CLIENT_CB* client_cb =
- bta_hf_client_find_cb_by_bda(from_BD_ADDR(peer_addr));
+ const bt_bdaddr_t* peer_addr) {
+ tBTA_HF_CLIENT_CB* client_cb = bta_hf_client_find_cb_by_bda(*peer_addr);
if (client_cb != NULL && client_cb->state == BTA_HF_CLIENT_OPENING_ST) {
if (id == BTA_ID_SYS) /* ACL collision */
{
}
/* tell sys to stop av if any */
- bta_sys_sco_use(BTA_ID_HS, 1, to_BD_ADDR(client_cb->peer_addr));
+ bta_sys_sco_use(BTA_ID_HS, 1, client_cb->peer_addr);
} else {
hci_status = HCI_ERR_HOST_REJECT_DEVICE;
}
if (is_orig) {
BTM_SetEScoMode(¶ms);
/* tell sys to stop av if any */
- bta_sys_sco_use(BTA_ID_HS, 1, to_BD_ADDR(client_cb->peer_addr));
+ bta_sys_sco_use(BTA_ID_HS, 1, client_cb->peer_addr);
}
status = BTM_CreateSco(&client_cb->peer_addr, is_orig, params.packet_types,
bta_hf_client_sco_event(client_cb, BTA_HF_CLIENT_SCO_CONN_OPEN_E);
- bta_sys_sco_open(BTA_ID_HS, 1, to_BD_ADDR(client_cb->peer_addr));
+ bta_sys_sco_open(BTA_ID_HS, 1, client_cb->peer_addr);
if (client_cb->negotiated_codec == BTM_SCO_CODEC_MSBC) {
bta_hf_client_cback_sco(client_cb, BTA_HF_CLIENT_AUDIO_MSBC_OPEN_EVT);
bta_hf_client_sco_event(client_cb, BTA_HF_CLIENT_SCO_CONN_CLOSE_E);
- bta_sys_sco_close(BTA_ID_HS, 1, to_BD_ADDR(client_cb->peer_addr));
+ bta_sys_sco_close(BTA_ID_HS, 1, client_cb->peer_addr);
- bta_sys_sco_unuse(BTA_ID_HS, 1, to_BD_ADDR(client_cb->peer_addr));
+ bta_sys_sco_unuse(BTA_ID_HS, 1, client_cb->peer_addr);
/* call app callback */
bta_hf_client_cback_sco(client_cb, BTA_HF_CLIENT_AUDIO_CLOSE_EVT);
#endif
{
/* inform role manager */
- bta_sys_conn_open(BTA_ID_HH, p_cb->app_id, to_BD_ADDR(p_cb->addr));
+ bta_sys_conn_open(BTA_ID_HH, p_cb->app_id, p_cb->addr);
}
/* set protocol mode when not default report mode */
if (p_cb->mode != BTA_HH_PROTO_RPT_MODE
}
/* transaction achknoledgement received, inform PM for mode change */
- bta_sys_idle(BTA_ID_HH, p_cb->app_id, to_BD_ADDR(p_cb->addr));
+ bta_sys_idle(BTA_ID_HH, p_cb->app_id, p_cb->addr);
return;
}
/*******************************************************************************
}
/* inform PM for mode change */
- bta_sys_busy(BTA_ID_HH, p_cb->app_id, to_BD_ADDR(p_cb->addr));
- bta_sys_idle(BTA_ID_HH, p_cb->app_id, to_BD_ADDR(p_cb->addr));
+ bta_sys_busy(BTA_ID_HH, p_cb->app_id, p_cb->addr);
+ bta_sys_idle(BTA_ID_HH, p_cb->app_id, p_cb->addr);
(*bta_hh_cb.p_cback)(p_cb->w4_evt, (tBTA_HH*)&hs_data);
/* finaliza device driver */
bta_hh_co_close(p_cb->hid_handle, p_cb->app_id);
/* inform role manager */
- bta_sys_conn_close(BTA_ID_HH, p_cb->app_id, to_BD_ADDR(p_cb->addr));
+ bta_sys_conn_close(BTA_ID_HH, p_cb->app_id, p_cb->addr);
/* update total conn number */
bta_hh_cb.cnt_num--;
/* if not control type transaction, notify PM for energy control */
if (p_data->api_sndcmd.t_type != HID_TRANS_CONTROL) {
/* inform PM for mode change */
- bta_sys_busy(BTA_ID_HH, p_cb->app_id, to_BD_ADDR(p_cb->addr));
- bta_sys_idle(BTA_ID_HH, p_cb->app_id, to_BD_ADDR(p_cb->addr));
+ bta_sys_busy(BTA_ID_HH, p_cb->app_id, p_cb->addr);
+ bta_sys_idle(BTA_ID_HH, p_cb->app_id, p_cb->addr);
} else if (p_data->api_sndcmd.param == BTA_HH_CTRL_SUSPEND) {
- bta_sys_sco_close(BTA_ID_HH, p_cb->app_id, to_BD_ADDR(p_cb->addr));
+ bta_sys_sco_close(BTA_ID_HH, p_cb->app_id, p_cb->addr);
} else if (p_data->api_sndcmd.param == BTA_HH_CTRL_EXIT_SUSPEND) {
- bta_sys_busy(BTA_ID_HH, p_cb->app_id, to_BD_ADDR(p_cb->addr));
+ bta_sys_busy(BTA_ID_HH, p_cb->app_id, p_cb->addr);
}
}
}
#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_cch_close_cmpl");
#endif
- bta_sys_conn_close(BTA_ID_HL, p_acb->app_id, to_BD_ADDR(p_mcb->bd_addr));
+ bta_sys_conn_close(BTA_ID_HL, p_acb->app_id, p_mcb->bd_addr);
if (p_mcb->cch_oper == BTA_HL_CCH_OP_LOCAL_CLOSE &&
p_mcb->force_close_local_cch_opening) {
p_mcb->bd_addr = from_BD_ADDR(p_data->mca_evt.mca_data.connect_ind.bd_addr);
p_mcb->cch_mtu = p_data->mca_evt.mca_data.connect_ind.mtu;
- bta_sys_conn_open(BTA_ID_HL, p_acb->app_id, to_BD_ADDR(p_mcb->bd_addr));
+ bta_sys_conn_open(BTA_ID_HL, p_acb->app_id, p_mcb->bd_addr);
switch (p_mcb->cch_oper) {
case BTA_HL_CCH_OP_LOCAL_OPEN:
bta_hl_build_cch_open_cfm(&evt_data, p_mcb->app_id, p_acb->app_handle,
/* needs to be called if registered with bta pm, otherwise we may run out of
* dm pm slots! */
if (close_conn)
- bta_sys_conn_close(BTA_ID_JV, p_pm_cb->app_id,
- to_BD_ADDR(p_pm_cb->peer_bd_addr));
+ bta_sys_conn_close(BTA_ID_JV, p_pm_cb->app_id, p_pm_cb->peer_bd_addr);
p_pm_cb->state = BTA_JV_PM_FREE_ST;
p_pm_cb->app_id = BTA_JV_PM_ALL;
p_pm_cb->handle = BTA_JV_PM_HANDLE_CLEAR;
switch (state) {
case BTA_JV_CONN_OPEN:
- bta_sys_conn_open(BTA_ID_JV, p_cb->app_id,
- to_BD_ADDR(p_cb->peer_bd_addr));
+ bta_sys_conn_open(BTA_ID_JV, p_cb->app_id, p_cb->peer_bd_addr);
break;
case BTA_JV_CONN_CLOSE:
- bta_sys_conn_close(BTA_ID_JV, p_cb->app_id,
- to_BD_ADDR(p_cb->peer_bd_addr));
+ bta_sys_conn_close(BTA_ID_JV, p_cb->app_id, p_cb->peer_bd_addr);
break;
case BTA_JV_APP_OPEN:
- bta_sys_app_open(BTA_ID_JV, p_cb->app_id, to_BD_ADDR(p_cb->peer_bd_addr));
+ bta_sys_app_open(BTA_ID_JV, p_cb->app_id, p_cb->peer_bd_addr);
break;
case BTA_JV_APP_CLOSE:
- bta_sys_app_close(BTA_ID_JV, p_cb->app_id,
- to_BD_ADDR(p_cb->peer_bd_addr));
+ bta_sys_app_close(BTA_ID_JV, p_cb->app_id, p_cb->peer_bd_addr);
break;
case BTA_JV_SCO_OPEN:
- bta_sys_sco_open(BTA_ID_JV, p_cb->app_id, to_BD_ADDR(p_cb->peer_bd_addr));
+ bta_sys_sco_open(BTA_ID_JV, p_cb->app_id, p_cb->peer_bd_addr);
break;
case BTA_JV_SCO_CLOSE:
- bta_sys_sco_close(BTA_ID_JV, p_cb->app_id,
- to_BD_ADDR(p_cb->peer_bd_addr));
+ bta_sys_sco_close(BTA_ID_JV, p_cb->app_id, p_cb->peer_bd_addr);
break;
case BTA_JV_CONN_IDLE:
p_cb->state = BTA_JV_PM_IDLE_ST;
- bta_sys_idle(BTA_ID_JV, p_cb->app_id, to_BD_ADDR(p_cb->peer_bd_addr));
+ bta_sys_idle(BTA_ID_JV, p_cb->app_id, p_cb->peer_bd_addr);
break;
case BTA_JV_CONN_BUSY:
p_cb->state = BTA_JV_PM_BUSY_ST;
- bta_sys_busy(BTA_ID_JV, p_cb->app_id, to_BD_ADDR(p_cb->peer_bd_addr));
+ bta_sys_busy(BTA_ID_JV, p_cb->app_id, p_cb->peer_bd_addr);
break;
default:
******************************************************************************/
static void bta_pan_pm_conn_busy(tBTA_PAN_SCB* p_scb) {
if ((p_scb != NULL) && (p_scb->state != BTA_PAN_IDLE_ST))
- bta_sys_busy(BTA_ID_PAN, p_scb->app_id, to_BD_ADDR(p_scb->bd_addr));
+ bta_sys_busy(BTA_ID_PAN, p_scb->app_id, p_scb->bd_addr);
}
/*******************************************************************************
******************************************************************************/
static void bta_pan_pm_conn_idle(tBTA_PAN_SCB* p_scb) {
if ((p_scb != NULL) && (p_scb->state != BTA_PAN_IDLE_ST))
- bta_sys_idle(BTA_ID_PAN, p_scb->app_id, to_BD_ADDR(p_scb->bd_addr));
+ bta_sys_idle(BTA_ID_PAN, p_scb->app_id, p_scb->bd_addr);
}
/*******************************************************************************
bta_pan.open.status = BTA_PAN_SUCCESS;
p_scb->pan_flow_enable = true;
p_scb->app_flow_enable = true;
- bta_sys_conn_open(BTA_ID_PAN, p_scb->app_id, to_BD_ADDR(p_scb->bd_addr));
+ bta_sys_conn_open(BTA_ID_PAN, p_scb->app_id, p_scb->bd_addr);
} else {
bta_pan_scb_dealloc(p_scb);
bta_pan.open.status = BTA_PAN_FAIL;
p_scb->app_id = BTA_APP_ID_PAN_MULTI;
}
- bta_sys_conn_open(BTA_ID_PAN, p_scb->app_id, to_BD_ADDR(p_scb->bd_addr));
+ bta_sys_conn_open(BTA_ID_PAN, p_scb->app_id, p_scb->bd_addr);
bta_pan_cb.p_cback(BTA_PAN_OPEN_EVT, &bta_pan);
}
bta_pan.close.handle = p_data->hdr.layer_specific;
- bta_sys_conn_close(BTA_ID_PAN, p_scb->app_id, to_BD_ADDR(p_scb->bd_addr));
+ bta_sys_conn_close(BTA_ID_PAN, p_scb->app_id, p_scb->bd_addr);
/* free all queued up data buffers */
while ((p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_scb->data_queue)) != NULL)
/* conn callback for role / low power manager*/
typedef void(tBTA_SYS_CONN_CBACK)(tBTA_SYS_CONN_STATUS status, uint8_t id,
- uint8_t app_id, BD_ADDR peer_addr);
+ uint8_t app_id, const bt_bdaddr_t* peer_addr);
/* conn callback for role / low power manager*/
typedef void(tBTA_SYS_SSR_CFG_CBACK)(uint8_t id, uint8_t app_id,
extern void bta_sys_policy_register(tBTA_SYS_CONN_CBACK* p_cback);
extern void bta_sys_sco_register(tBTA_SYS_CONN_CBACK* p_cback);
-extern void bta_sys_conn_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
-extern void bta_sys_conn_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
-extern void bta_sys_app_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
-extern void bta_sys_app_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
-extern void bta_sys_sco_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
-extern void bta_sys_sco_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
-extern void bta_sys_sco_use(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
-extern void bta_sys_sco_unuse(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
-extern void bta_sys_idle(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
-extern void bta_sys_busy(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+extern void bta_sys_conn_open(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr);
+extern void bta_sys_conn_close(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr);
+extern void bta_sys_app_open(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr);
+extern void bta_sys_app_close(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr);
+extern void bta_sys_sco_open(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr);
+extern void bta_sys_sco_close(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr);
+extern void bta_sys_sco_use(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr);
+extern void bta_sys_sco_unuse(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr);
+extern void bta_sys_idle(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr);
+extern void bta_sys_busy(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr);
#if (BTM_SSR_INCLUDED == TRUE)
extern void bta_sys_ssr_cfg_register(tBTA_SYS_SSR_CFG_CBACK* p_cback);
#endif
extern void bta_sys_role_chg_register(tBTA_SYS_CONN_CBACK* p_cback);
-extern void bta_sys_notify_role_chg(BD_ADDR_PTR p_bda, uint8_t new_role,
+extern void bta_sys_notify_role_chg(const bt_bdaddr_t& p_bda, uint8_t new_role,
uint8_t hci_status);
extern void bta_sys_collision_register(uint8_t bta_id,
tBTA_SYS_CONN_CBACK* p_cback);
-extern void bta_sys_notify_collision(BD_ADDR_PTR p_bda);
+extern void bta_sys_notify_collision(const bt_bdaddr_t& p_bda);
#if (BTA_EIR_CANNED_UUID_LIST != TRUE)
extern void bta_sys_eir_register(tBTA_SYS_EIR_CBACK* p_cback);
#define bta_sys_remove_uuid(ut)
#endif
-extern void bta_sys_set_policy(uint8_t id, uint8_t policy, BD_ADDR peer_addr);
-extern void bta_sys_clear_policy(uint8_t id, uint8_t policy, BD_ADDR peer_addr);
+extern void bta_sys_set_policy(uint8_t id, uint8_t policy,
+ const bt_bdaddr_t& peer_addr);
+extern void bta_sys_clear_policy(uint8_t id, uint8_t policy,
+ const bt_bdaddr_t& peer_addr);
extern void bta_sys_set_default_policy(uint8_t id, uint8_t policy);
extern void bta_sys_clear_default_policy(uint8_t id, uint8_t policy);
* Returns void
*
******************************************************************************/
-void bta_sys_notify_role_chg(BD_ADDR_PTR p_bda, uint8_t new_role,
+void bta_sys_notify_role_chg(const bt_bdaddr_t& p_bda, uint8_t new_role,
uint8_t hci_status) {
if (bta_sys_cb.p_role_cb) {
- bta_sys_cb.p_role_cb(BTA_SYS_ROLE_CHANGE, new_role, hci_status, p_bda);
+ bta_sys_cb.p_role_cb(BTA_SYS_ROLE_CHANGE, new_role, hci_status, &p_bda);
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_notify_collision(BD_ADDR_PTR p_bda) {
+void bta_sys_notify_collision(const bt_bdaddr_t& p_bda) {
uint8_t index;
for (index = 0; index < MAX_COLLISION_REG; index++) {
if ((bta_sys_cb.colli_reg.id[index] != 0) &&
(bta_sys_cb.colli_reg.p_coll_cback[index] != NULL)) {
- bta_sys_cb.colli_reg.p_coll_cback[index](0, BTA_ID_SYS, 0, p_bda);
+ bta_sys_cb.colli_reg.p_coll_cback[index](0, BTA_ID_SYS, 0, &p_bda);
}
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_conn_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr) {
+void bta_sys_conn_open(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr) {
if (bta_sys_cb.prm_cb) {
- bta_sys_cb.prm_cb(BTA_SYS_CONN_OPEN, id, app_id, peer_addr);
+ bta_sys_cb.prm_cb(BTA_SYS_CONN_OPEN, id, app_id, &peer_addr);
}
if (bta_sys_cb.ppm_cb) {
- bta_sys_cb.ppm_cb(BTA_SYS_CONN_OPEN, id, app_id, peer_addr);
+ bta_sys_cb.ppm_cb(BTA_SYS_CONN_OPEN, id, app_id, &peer_addr);
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_conn_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr) {
+void bta_sys_conn_close(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr) {
if (bta_sys_cb.prm_cb) {
- bta_sys_cb.prm_cb(BTA_SYS_CONN_CLOSE, id, app_id, peer_addr);
+ bta_sys_cb.prm_cb(BTA_SYS_CONN_CLOSE, id, app_id, &peer_addr);
}
if (bta_sys_cb.ppm_cb) {
- bta_sys_cb.ppm_cb(BTA_SYS_CONN_CLOSE, id, app_id, peer_addr);
+ bta_sys_cb.ppm_cb(BTA_SYS_CONN_CLOSE, id, app_id, &peer_addr);
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_app_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr) {
+void bta_sys_app_open(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr) {
if (bta_sys_cb.ppm_cb) {
- bta_sys_cb.ppm_cb(BTA_SYS_APP_OPEN, id, app_id, peer_addr);
+ bta_sys_cb.ppm_cb(BTA_SYS_APP_OPEN, id, app_id, &peer_addr);
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_app_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr) {
+void bta_sys_app_close(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr) {
if (bta_sys_cb.ppm_cb) {
- bta_sys_cb.ppm_cb(BTA_SYS_APP_CLOSE, id, app_id, peer_addr);
+ bta_sys_cb.ppm_cb(BTA_SYS_APP_CLOSE, id, app_id, &peer_addr);
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_sco_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr) {
+void bta_sys_sco_open(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr) {
/* AG triggers p_sco_cb by bta_sys_sco_use. */
if ((id != BTA_ID_AG) && (bta_sys_cb.p_sco_cb)) {
/* without querying BTM_GetNumScoLinks() */
- bta_sys_cb.p_sco_cb(BTA_SYS_SCO_OPEN, 1, app_id, peer_addr);
+ bta_sys_cb.p_sco_cb(BTA_SYS_SCO_OPEN, 1, app_id, &peer_addr);
}
if (bta_sys_cb.ppm_cb) {
- bta_sys_cb.ppm_cb(BTA_SYS_SCO_OPEN, id, app_id, peer_addr);
+ bta_sys_cb.ppm_cb(BTA_SYS_SCO_OPEN, id, app_id, &peer_addr);
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_sco_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr) {
+void bta_sys_sco_close(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr) {
uint8_t num_sco_links;
if ((id != BTA_ID_AG) && (bta_sys_cb.p_sco_cb)) {
num_sco_links = BTM_GetNumScoLinks();
- bta_sys_cb.p_sco_cb(BTA_SYS_SCO_CLOSE, num_sco_links, app_id, peer_addr);
+ bta_sys_cb.p_sco_cb(BTA_SYS_SCO_CLOSE, num_sco_links, app_id, &peer_addr);
}
if (bta_sys_cb.ppm_cb) {
- bta_sys_cb.ppm_cb(BTA_SYS_SCO_CLOSE, id, app_id, peer_addr);
+ bta_sys_cb.ppm_cb(BTA_SYS_SCO_CLOSE, id, app_id, &peer_addr);
}
}
*
******************************************************************************/
void bta_sys_sco_use(UNUSED_ATTR uint8_t id, uint8_t app_id,
- BD_ADDR peer_addr) {
+ const bt_bdaddr_t& peer_addr) {
/* AV streaming need to be suspended before SCO is connected. */
if (bta_sys_cb.p_sco_cb) {
/* without querying BTM_GetNumScoLinks() */
- bta_sys_cb.p_sco_cb(BTA_SYS_SCO_OPEN, 1, app_id, peer_addr);
+ bta_sys_cb.p_sco_cb(BTA_SYS_SCO_OPEN, 1, app_id, &peer_addr);
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_sco_unuse(UNUSED_ATTR uint8_t id, uint8_t app_id,
- BD_ADDR peer_addr) {
- uint8_t num_sco_links;
-
+void bta_sys_sco_unuse(uint8_t id, uint8_t app_id,
+ const bt_bdaddr_t& peer_addr) {
if ((bta_sys_cb.p_sco_cb)) {
- num_sco_links = BTM_GetNumScoLinks();
- bta_sys_cb.p_sco_cb(BTA_SYS_SCO_CLOSE, num_sco_links, app_id, peer_addr);
+ uint8_t num_sco_links = BTM_GetNumScoLinks();
+ bta_sys_cb.p_sco_cb(BTA_SYS_SCO_CLOSE, num_sco_links, app_id, &peer_addr);
}
}
/*******************************************************************************
* Returns void
*
******************************************************************************/
-void bta_sys_set_policy(uint8_t id, uint8_t policy, BD_ADDR peer_addr) {
+void bta_sys_set_policy(uint8_t id, uint8_t policy,
+ const bt_bdaddr_t& peer_addr) {
if (bta_sys_cb.p_policy_cb) {
- bta_sys_cb.p_policy_cb(BTA_SYS_PLCY_SET, id, policy, peer_addr);
+ bta_sys_cb.p_policy_cb(BTA_SYS_PLCY_SET, id, policy, &peer_addr);
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_clear_policy(uint8_t id, uint8_t policy, BD_ADDR peer_addr) {
+void bta_sys_clear_policy(uint8_t id, uint8_t policy,
+ const bt_bdaddr_t& peer_addr) {
if (bta_sys_cb.p_policy_cb) {
- bta_sys_cb.p_policy_cb(BTA_SYS_PLCY_CLR, id, policy, peer_addr);
+ bta_sys_cb.p_policy_cb(BTA_SYS_PLCY_CLR, id, policy, &peer_addr);
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_idle(uint8_t id, uint8_t app_id, BD_ADDR peer_addr) {
+void bta_sys_idle(uint8_t id, uint8_t app_id, const bt_bdaddr_t& peer_addr) {
if (bta_sys_cb.prm_cb) {
- bta_sys_cb.prm_cb(BTA_SYS_CONN_IDLE, id, app_id, peer_addr);
+ bta_sys_cb.prm_cb(BTA_SYS_CONN_IDLE, id, app_id, &peer_addr);
}
if (bta_sys_cb.ppm_cb) {
- bta_sys_cb.ppm_cb(BTA_SYS_CONN_IDLE, id, app_id, peer_addr);
+ bta_sys_cb.ppm_cb(BTA_SYS_CONN_IDLE, id, app_id, &peer_addr);
}
}
* Returns void
*
******************************************************************************/
-void bta_sys_busy(uint8_t id, uint8_t app_id, BD_ADDR peer_addr) {
+void bta_sys_busy(uint8_t id, uint8_t app_id, const bt_bdaddr_t& peer_addr) {
if (bta_sys_cb.prm_cb) {
- bta_sys_cb.prm_cb(BTA_SYS_CONN_BUSY, id, app_id, peer_addr);
+ bta_sys_cb.prm_cb(BTA_SYS_CONN_BUSY, id, app_id, &peer_addr);
}
if (bta_sys_cb.ppm_cb) {
- bta_sys_cb.ppm_cb(BTA_SYS_CONN_BUSY, id, app_id, peer_addr);
+ bta_sys_cb.ppm_cb(BTA_SYS_CONN_BUSY, id, app_id, &peer_addr);
}
}