Loading system/bta/av/bta_av_act.c +135 −9 Original line number Diff line number Diff line /****************************************************************************** * * Copyright (C) 2004-2012 Broadcom Corporation * Copyright (C) 2004-2016 Broadcom Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -227,6 +227,14 @@ static void bta_av_rc_ctrl_cback(uint8_t handle, uint8_t event, uint16_t result, { msg_event = BTA_AV_AVRC_CLOSE_EVT; } else if (event == AVRC_BROWSE_OPEN_IND_EVT) { msg_event = BTA_AV_AVRC_BROWSE_OPEN_EVT; } else if (event == AVRC_BROWSE_CLOSE_IND_EVT) { msg_event = BTA_AV_AVRC_BROWSE_CLOSE_EVT; } if (msg_event) { tBTA_AV_RC_CONN_CHG *p_msg = Loading Loading @@ -255,7 +263,10 @@ static void bta_av_rc_msg_cback(uint8_t handle, uint8_t label, uint8_t opcode, t APPL_TRACE_DEBUG("%s handle: %u opcode=0x%x", __func__, handle, opcode); /* Determine the size of the buffer we need */ /* Copy avrc packet into BTA message buffer (for sending to BTA state machine) */ /* Get size of payload data (for vendor and passthrough messages only; for browsing * messages, use zero-copy) */ if (opcode == AVRC_OP_VENDOR && p_msg->vendor.p_vendor_data != NULL) { p_data_src = p_msg->vendor.p_vendor_data; data_len = (uint16_t) p_msg->vendor.vendor_len; Loading @@ -267,6 +278,7 @@ static void bta_av_rc_msg_cback(uint8_t handle, uint8_t label, uint8_t opcode, t /* Create a copy of the message */ tBTA_AV_RC_MSG *p_buf = (tBTA_AV_RC_MSG *)osi_malloc(sizeof(tBTA_AV_RC_MSG) + data_len); p_buf->hdr.event = BTA_AV_AVRC_MSG_EVT; p_buf->handle = handle; p_buf->label = label; Loading @@ -276,13 +288,23 @@ static void bta_av_rc_msg_cback(uint8_t handle, uint8_t label, uint8_t opcode, t if (p_data_src != NULL) { uint8_t *p_data_dst = (uint8_t *)(p_buf + 1); memcpy(p_data_dst, p_data_src, data_len); /* Update bta message buffer to point to payload data */ /* (Note AVRC_OP_BROWSING uses zero-copy: p_buf->msg.browse.p_browse_data * already points to original avrc buffer) */ if (opcode == AVRC_OP_VENDOR) p_buf->msg.vendor.p_vendor_data = p_data_dst; else if (opcode == AVRC_OP_PASS_THRU) p_buf->msg.pass.p_pass_data = p_data_dst; } if (opcode == AVRC_OP_BROWSE) { /* set p_pkt to NULL, so avrc would not free the buffer */ p_msg->browse.p_browse_pkt = NULL; } bta_sys_sendmsg(p_buf); } /******************************************************************************* Loading Loading @@ -323,7 +345,8 @@ uint8_t bta_av_rc_create(tBTA_AV_CB *p_cb, uint8_t role, uint8_t shdl, uint8_t l ccb.company_id = p_bta_av_cfg->company_id; ccb.conn = role; /* note: BTA_AV_FEAT_RCTG = AVRC_CT_TARGET, BTA_AV_FEAT_RCCT = AVRC_CT_CONTROL */ ccb.control = p_cb->features & (BTA_AV_FEAT_RCTG | BTA_AV_FEAT_RCCT | AVRC_CT_PASSIVE); ccb.control = p_cb->features & (BTA_AV_FEAT_RCTG | BTA_AV_FEAT_RCCT | BTA_AV_FEAT_METADATA | AVRC_CT_PASSIVE); if (AVRC_Open(&rc_handle, &ccb, bda) != AVRC_SUCCESS) return BTA_AV_RC_HANDLE_NONE; Loading Loading @@ -512,6 +535,14 @@ void bta_av_rc_opened(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) return; } if (p_cb->features & BTA_AV_FEAT_RCTG) { /* listen to browsing channel when the connection is open, * if peer initiated AVRCP connection and local device supports browsing channel */ if ((p_cb->features & BTA_AV_FEAT_BROWSE) && (p_cb->rcb[i].peer_features == 0)) AVRC_OpenBrowse(p_data->rc_conn_chg.handle, AVCT_ACP); } if (p_cb->rcb[i].lidx == (BTA_AV_NUM_LINKS + 1) && shdl != 0) { /* rc is opened on the RC only ACP channel, but is for a specific Loading Loading @@ -572,6 +603,15 @@ void bta_av_rc_opened(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) } (*p_cb->p_cback)(BTA_AV_RC_OPEN_EVT, (tBTA_AV *) &rc_open); /* if local initiated AVRCP connection and both peer and locals device support * browsing channel, open the browsing channel now */ if ((p_cb->features & BTA_AV_FEAT_BROWSE) && (rc_open.peer_features & BTA_AV_FEAT_BROWSE) && ((p_cb->rcb[i].status & BTA_AV_RC_ROLE_MASK) == BTA_AV_RC_ROLE_INT)) { AVRC_OpenBrowse (p_data->rc_conn_chg.handle, AVCT_INT); } } /******************************************************************************* Loading Loading @@ -696,17 +736,20 @@ void bta_av_rc_free_rsp (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) /******************************************************************************* ** ** Function bta_av_rc_meta_req ** Function bta_av_rc_free_browse_msg ** ** Description Send an AVRCP metadata command. ** Description free an AVRCP browse message buffer. ** ** Returns void ** *******************************************************************************/ void bta_av_rc_free_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) void bta_av_rc_free_browse_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) { UNUSED(p_cb); UNUSED(p_data); if (p_data->rc_msg.opcode == AVRC_OP_BROWSE) { osi_free_and_reset((void **)&p_data->rc_msg.msg.browse.p_browse_pkt); } } /******************************************************************************* Loading Loading @@ -778,7 +821,8 @@ tBTA_AV_EVT bta_av_proc_meta_cmd(tAVRC_RESPONSE *p_rc_rsp, tBTA_AV_RC_MSG *p_ms /* reject it */ evt=0; p_vendor->hdr.ctype = BTA_AV_RSP_NOT_IMPL; AVRC_VendorRsp(p_msg->handle, p_msg->label, &p_msg->msg.vendor); p_vendor->vendor_len = 0; p_rc_rsp->rsp.status = AVRC_STS_BAD_PARAM; } else if (!AVRC_IsValidAvcType(pdu, p_vendor->hdr.ctype) ) { Loading Loading @@ -872,6 +916,15 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) rc_rsp.rsp.status = BTA_AV_STS_NO_RSP; #endif if (NULL == p_data) { APPL_TRACE_ERROR("Message from peer with no data in %s", __func__); return; } APPL_TRACE_DEBUG("%s: opcode=%x, ctype=%x", __func__, p_data->rc_msg.opcode, p_data->rc_msg.msg.hdr.ctype); if (p_data->rc_msg.opcode == AVRC_OP_PASS_THRU) { /* if this is a pass thru command */ Loading @@ -893,7 +946,7 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) p_data->rc_msg.msg.pass.p_pass_data, is_inquiry); #endif } #if (AVRC_CTLR_INCLUDED == TRUE) #if (AVRC_CTRL_INCLUDED == TRUE) else if (((p_data->rc_msg.msg.pass.op_id == AVRC_ID_VOL_UP)|| (p_data->rc_msg.msg.pass.op_id == AVRC_ID_VOL_DOWN)) && !strcmp(avrcp_ct_support, "true")) Loading Loading @@ -974,6 +1027,7 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) (p_vendor->company_id == AVRC_CO_METADATA)) { av.meta_msg.p_msg = &p_data->rc_msg.msg; rc_rsp.rsp.status = BTA_AV_STS_NO_RSP; evt = bta_av_proc_meta_cmd (&rc_rsp, &p_data->rc_msg, &ctype); } else Loading Loading @@ -1011,6 +1065,19 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) AVRC_VendorRsp(p_data->rc_msg.handle, p_data->rc_msg.label, &p_data->rc_msg.msg.vendor); } } else if (p_data->rc_msg.opcode == AVRC_OP_BROWSE) { /* set up for callback */ av.meta_msg.rc_handle = p_data->rc_msg.handle; av.meta_msg.company_id = p_vendor->company_id; av.meta_msg.code = p_data->rc_msg.msg.hdr.ctype; av.meta_msg.label = p_data->rc_msg.label; av.meta_msg.p_msg = &p_data->rc_msg.msg; av.meta_msg.p_data = p_data->rc_msg.msg.browse.p_browse_data; av.meta_msg.len = p_data->rc_msg.msg.browse.browse_len; evt = BTA_AV_META_MSG_EVT; } #if (AVRC_METADATA_INCLUDED == TRUE) if (evt == 0 && rc_rsp.rsp.status != BTA_AV_STS_NO_RSP) { Loading @@ -1029,6 +1096,8 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) { av.remote_cmd.rc_handle = p_data->rc_msg.handle; (*p_cb->p_cback)(evt, &av); /* If browsing message, then free the browse message buffer */ bta_av_rc_free_browse_msg(p_cb, p_data); } } Loading Loading @@ -1328,6 +1397,8 @@ void bta_av_conn_chg(tBTA_AV_DATA *p_data) if (bta_av_cb.rcb[i].shdl == index + 1) { bta_av_del_rc(&bta_av_cb.rcb[i]); /* since the connection is already down and info was removed, clean reference */ bta_av_cb.rcb[i].shdl = 0; break; } } Loading Loading @@ -2034,6 +2105,61 @@ void bta_av_rc_closed(tBTA_AV_DATA *p_data) (*p_cb->p_cback)(BTA_AV_RC_CLOSE_EVT, (tBTA_AV *) &rc_close); } /******************************************************************************* ** ** Function bta_av_rc_browse_opened ** ** Description AVRC browsing channel is opened ** ** Returns void ** *******************************************************************************/ void bta_av_rc_browse_opened(tBTA_AV_DATA *p_data) { tBTA_AV_CB *p_cb = &bta_av_cb; tBTA_AV_RC_CONN_CHG *p_msg = (tBTA_AV_RC_CONN_CHG *)p_data; tBTA_AV_RC_BROWSE_OPEN rc_browse_open; APPL_TRACE_DEBUG("bta_av_rc_browse_opened bd_addr:%02x-%02x-%02x-%02x-%02x-%02x", p_msg->peer_addr[0], p_msg->peer_addr[1], p_msg->peer_addr[2], p_msg->peer_addr[3], p_msg->peer_addr[4], p_msg->peer_addr[5]); APPL_TRACE_DEBUG("bta_av_rc_browse_opened rc_handle:%d", p_msg->handle); rc_browse_open.status = BTA_AV_SUCCESS; rc_browse_open.rc_handle = p_msg->handle; bdcpy(rc_browse_open.peer_addr, p_msg->peer_addr); (*p_cb->p_cback)(BTA_AV_RC_BROWSE_OPEN_EVT, (tBTA_AV *)&rc_browse_open); } /******************************************************************************* ** ** Function bta_av_rc_browse_closed ** ** Description AVRC browsing channel is closed ** ** Returns void ** *******************************************************************************/ void bta_av_rc_browse_closed(tBTA_AV_DATA *p_data) { tBTA_AV_CB *p_cb = &bta_av_cb; tBTA_AV_RC_CONN_CHG *p_msg = (tBTA_AV_RC_CONN_CHG *)p_data; tBTA_AV_RC_BROWSE_CLOSE rc_browse_close; APPL_TRACE_DEBUG("bta_av_rc_browse_closed bd_addr:%02x-%02x-%02x-%02x-%02x-%02x", p_msg->peer_addr[0], p_msg->peer_addr[1], p_msg->peer_addr[2], p_msg->peer_addr[3], p_msg->peer_addr[4], p_msg->peer_addr[5]); APPL_TRACE_DEBUG("bta_av_rc_browse_closed rc_handle:%d", p_msg->handle); rc_browse_close.rc_handle = p_msg->handle; bdcpy(rc_browse_close.peer_addr, p_msg->peer_addr); (*p_cb->p_cback)(BTA_AV_RC_BROWSE_CLOSE_EVT, (tBTA_AV *)&rc_browse_close); } /******************************************************************************* ** ** Function bta_av_rc_disc Loading system/bta/av/bta_av_cfg.c +24 −6 Original line number Diff line number Diff line /****************************************************************************** * * Copyright (C) 2005-2012 Broadcom Corporation * Copyright (C) 2005-2016 Broadcom Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -30,6 +30,10 @@ #include "bta_api.h" #include "bta_av_int.h" #ifndef BTA_AV_RC_COMP_ID #define BTA_AV_RC_COMP_ID AVRC_CO_GOOGLE #endif #ifndef BTA_AV_RC_PASS_RSP_CODE #define BTA_AV_RC_PASS_RSP_CODE BTA_AV_RSP_NOT_IMPL #endif Loading @@ -39,13 +43,22 @@ const uint32_t bta_av_meta_caps_co_ids[] = { AVRC_CO_BROADCOM }; /* AVRCP cupported categories */ /* AVRCP supported categories */ #if (AVRC_CTRL_INCLUDED == TRUE) #define BTA_AV_RC_SUPF_CT (AVRC_SUPF_CT_CAT2) #define BTA_AVK_RC_SUPF_CT (AVRC_SUPF_CT_CAT1) #define BTA_AVK_RC_SUPF_TG (AVRC_SUPF_TG_CAT2) #endif /* AVRCP Controller and Targer default name */ #ifndef BTA_AV_RC_CT_NAME #define BTA_AV_RC_CT_NAME "AVRC Controller" #endif #ifndef BTA_AV_RC_TG_NAME #define BTA_AV_RC_TG_NAME "AVRC Target" #endif /* Added to modify ** 1. flush timeout ** 2. Remove Group navigation support in SupportedFeatures Loading @@ -65,7 +78,8 @@ const uint16_t bta_av_audio_flush_to[] = { /* Note: Android doesnt support AVRC_SUPF_TG_GROUP_NAVI */ /* Note: if AVRC_SUPF_TG_GROUP_NAVI is set, bta_av_cfg.avrc_group should be true */ #if (AVRC_METADATA_INCLUDED == TRUE) #define BTA_AV_RC_SUPF_TG (AVRC_SUPF_TG_CAT1) /* TODO: | AVRC_SUPF_TG_APP_SETTINGS) */ #define BTA_AV_RC_SUPF_TG (AVRC_SUPF_TG_CAT1 | AVRC_SUPF_TG_MULTI_PLAYER | \ AVRC_SUPF_TG_BROWSE) /* TODO: | AVRC_SUPF_TG_APP_SETTINGS) */ #else #define BTA_AV_RC_SUPF_TG (AVRC_SUPF_TG_CAT1) #endif Loading @@ -77,6 +91,10 @@ const uint8_t bta_av_meta_caps_evt_ids[] = { AVRC_EVT_PLAY_STATUS_CHANGE, AVRC_EVT_TRACK_CHANGE, AVRC_EVT_PLAY_POS_CHANGED, AVRC_EVT_AVAL_PLAYERS_CHANGE, AVRC_EVT_ADDR_PLAYER_CHANGE, AVRC_EVT_UIDS_CHANGE, AVRC_EVT_NOW_PLAYING_CHANGE, /* TODO: Add support for these events AVRC_EVT_APP_SETTING_CHANGE, */ Loading @@ -103,7 +121,7 @@ const uint8_t bta_avk_meta_caps_evt_ids[] = { /* This configuration to be used when we are Src + TG + CT( only for abs vol) */ const tBTA_AV_CFG bta_av_cfg = { AVRC_CO_BROADCOM, /* AVRCP Company ID */ BTA_AV_RC_COMP_ID, /* AVRCP Company ID */ #if (AVRC_METADATA_INCLUDED == TRUE) 512, /* AVRCP MTU at L2CAP for control channel */ #else Loading @@ -126,8 +144,8 @@ const tBTA_AV_CFG bta_av_cfg = bta_av_meta_caps_evt_ids,/* the the metadata Get Capabilities response for event id */ NULL, /* the action function table for VDP stream */ NULL, /* action function to register VDP */ {0}, /* Default AVRCP controller name */ {0}, /* Default AVRCP target name */ BTA_AV_RC_CT_NAME, /* Default AVRCP controller name */ BTA_AV_RC_TG_NAME /* Default AVRCP target name */ }; /* This configuration to be used when we are Sink + CT + TG( only for abs vol) */ Loading system/bta/av/bta_av_int.h +5 −1 Original line number Diff line number Diff line Loading @@ -97,6 +97,8 @@ enum BTA_AV_SIGNALLING_TIMER_EVT, BTA_AV_SDP_AVRC_DISC_EVT, BTA_AV_AVRC_CLOSE_EVT, BTA_AV_AVRC_BROWSE_OPEN_EVT, BTA_AV_AVRC_BROWSE_CLOSE_EVT, BTA_AV_CONN_CHG_EVT, BTA_AV_DEREG_COMP_EVT, #if (AVDT_REPORTING == TRUE) Loading Loading @@ -651,6 +653,8 @@ extern void bta_av_sig_chg(tBTA_AV_DATA *p_data); extern void bta_av_signalling_timer(tBTA_AV_DATA *p_data); extern void bta_av_rc_disc_done(tBTA_AV_DATA *p_data); extern void bta_av_rc_closed(tBTA_AV_DATA *p_data); extern void bta_av_rc_browse_opened(tBTA_AV_DATA *p_data); extern void bta_av_rc_browse_closed(tBTA_AV_DATA *p_data); extern void bta_av_rc_disc(uint8_t disc); extern void bta_av_conn_chg(tBTA_AV_DATA *p_data); extern void bta_av_dereg_comp(tBTA_AV_DATA *p_data); Loading @@ -665,7 +669,7 @@ extern void bta_av_rc_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern void bta_av_rc_close (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern void bta_av_rc_meta_rsp (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern void bta_av_rc_free_rsp (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern void bta_av_rc_free_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern void bta_av_rc_free_browse_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern tBTA_AV_RCB * bta_av_get_rcb_by_shdl(uint8_t shdl); extern void bta_av_del_rc(tBTA_AV_RCB *p_rcb); Loading system/bta/av/bta_av_main.c +21 −11 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ enum BTA_AV_RC_VENDOR_CMD, BTA_AV_RC_VENDOR_RSP, BTA_AV_RC_FREE_RSP, BTA_AV_RC_FREE_MSG, BTA_AV_RC_FREE_BROWSE_MSG, BTA_AV_RC_META_RSP, BTA_AV_RC_MSG, BTA_AV_RC_CLOSE, Loading @@ -99,7 +99,7 @@ const tBTA_AV_ACTION bta_av_action[] = bta_av_rc_vendor_cmd, bta_av_rc_vendor_rsp, bta_av_rc_free_rsp, bta_av_rc_free_msg, bta_av_rc_free_browse_msg, bta_av_rc_meta_rsp, bta_av_rc_msg, bta_av_rc_close, Loading @@ -122,7 +122,7 @@ static const uint8_t bta_av_st_init[][BTA_AV_NUM_COLS] = /* API_META_RSP_EVT */ {BTA_AV_RC_FREE_RSP, BTA_AV_INIT_ST }, /* API_RC_CLOSE_EVT */ {BTA_AV_IGNORE, BTA_AV_INIT_ST }, /* AVRC_OPEN_EVT */ {BTA_AV_RC_OPENED, BTA_AV_OPEN_ST }, /* AVRC_MSG_EVT */ {BTA_AV_RC_FREE_MSG, BTA_AV_INIT_ST }, /* AVRC_MSG_EVT */ {BTA_AV_RC_FREE_BROWSE_MSG, BTA_AV_INIT_ST }, /* AVRC_NONE_EVT */ {BTA_AV_IGNORE, BTA_AV_INIT_ST }, }; Loading Loading @@ -176,6 +176,8 @@ const tBTA_AV_NSM_ACT bta_av_nsm_act[] = bta_av_signalling_timer, /* BTA_AV_SIGNALLING_TIMER_EVT */ bta_av_rc_disc_done, /* BTA_AV_SDP_AVRC_DISC_EVT */ bta_av_rc_closed, /* BTA_AV_AVRC_CLOSE_EVT */ bta_av_rc_browse_opened,/* BTA_AV_AVRC_BROWSE_OPEN_EVT */ bta_av_rc_browse_closed,/* BTA_AV_AVRC_BROWSE_CLOSE_EVT */ bta_av_conn_chg, /* BTA_AV_CONN_CHG_EVT */ bta_av_dereg_comp, /* BTA_AV_DEREG_COMP_EVT */ #if (AVDT_REPORTING == TRUE) Loading Loading @@ -456,6 +458,12 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data) p_bta_av_cfg = (tBTA_AV_CFG *) &bta_av_cfg; } if (p_bta_av_cfg == NULL) { APPL_TRACE_ERROR("AV configuration is null!"); return; } do { p_scb = bta_av_alloc_scb(registr.chnl); Loading Loading @@ -496,19 +504,19 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data) bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu, (uint8_t)(bta_av_cb.sec_mask & (~BTA_SEC_AUTHORIZE)), BTA_ID_AV); #endif uint16_t profile_version = AVRC_REV_1_0; if (profile_initialized == UUID_SERVCLASS_AUDIO_SOURCE) { bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target", NULL, p_bta_av_cfg->avrc_tg_cat, BTA_ID_AV, (bta_av_cb.features & BTA_AV_FEAT_BROWSE), AVRC_REV_1_3); profile_version = AVRC_REV_1_6; } else if (profile_initialized == UUID_SERVCLASS_AUDIO_SINK) { // Initialize AVRCP1.4 to provide Absolute Volume control. profile_version = AVRC_REV_1_4; } bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target", NULL, p_bta_av_cfg->avrc_tg_cat, BTA_ID_AV, (bta_av_cb.features & BTA_AV_FEAT_BROWSE), AVRC_REV_1_4); } (bta_av_cb.features & BTA_AV_FEAT_BROWSE), profile_version); #endif } Loading Loading @@ -1331,6 +1339,8 @@ char *bta_av_evt_code(uint16_t evt_code) case BTA_AV_SIGNALLING_TIMER_EVT: return "SIGNALLING_TIMER"; case BTA_AV_SDP_AVRC_DISC_EVT: return "SDP_AVRC_DISC"; case BTA_AV_AVRC_CLOSE_EVT: return "AVRC_CLOSE"; case BTA_AV_AVRC_BROWSE_OPEN_EVT: return "AVRC_BROWSE_OPEN"; case BTA_AV_AVRC_BROWSE_CLOSE_EVT: return "AVRC_BROWSE_CLOSE"; case BTA_AV_CONN_CHG_EVT: return "CONN_CHG"; case BTA_AV_DEREG_COMP_EVT: return "DEREG_COMP"; #if (AVDT_REPORTING == TRUE) Loading system/bta/include/bta_av_api.h +52 −33 Original line number Diff line number Diff line Loading @@ -213,24 +213,26 @@ typedef uint8_t tBTA_AV_ERR; #define BTA_AV_PROTECT_RSP_EVT 7 /* content protection response */ #define BTA_AV_RC_OPEN_EVT 8 /* remote control channel open */ #define BTA_AV_RC_CLOSE_EVT 9 /* remote control channel closed */ #define BTA_AV_REMOTE_CMD_EVT 10 /* remote control command */ #define BTA_AV_REMOTE_RSP_EVT 11 /* remote control response */ #define BTA_AV_VENDOR_CMD_EVT 12 /* vendor dependent remote control command */ #define BTA_AV_VENDOR_RSP_EVT 13 /* vendor dependent remote control response */ #define BTA_AV_RECONFIG_EVT 14 /* reconfigure response */ #define BTA_AV_SUSPEND_EVT 15 /* suspend response */ #define BTA_AV_PENDING_EVT 16 /* incoming connection pending: #define BTA_AV_RC_BROWSE_OPEN_EVT 10 /* remote control browse channel open */ #define BTA_AV_RC_BROWSE_CLOSE_EVT 11 /* remote control browse channel closed */ #define BTA_AV_REMOTE_CMD_EVT 12 /* remote control command */ #define BTA_AV_REMOTE_RSP_EVT 13 /* remote control response */ #define BTA_AV_VENDOR_CMD_EVT 14 /* vendor dependent remote control command */ #define BTA_AV_VENDOR_RSP_EVT 15 /* vendor dependent remote control response */ #define BTA_AV_RECONFIG_EVT 16 /* reconfigure response */ #define BTA_AV_SUSPEND_EVT 17 /* suspend response */ #define BTA_AV_PENDING_EVT 18 /* incoming connection pending: * signal channel is open and stream is * not open after * BTA_AV_SIGNALLING_TIMEOUT_MS */ #define BTA_AV_META_MSG_EVT 17 /* metadata messages */ #define BTA_AV_REJECT_EVT 18 /* incoming connection rejected */ #define BTA_AV_RC_FEAT_EVT 19 /* remote control channel peer supported features update */ #define BTA_AV_SINK_MEDIA_CFG_EVT 20 /* command to configure sink codec */ #define BTA_AV_SINK_MEDIA_DATA_EVT 21 /* sending sink data to Media Task */ #define BTA_AV_OFFLOAD_START_RSP_EVT 22 /* a2dp offload start response */ #define BTA_AV_META_MSG_EVT 19 /* metadata messages */ #define BTA_AV_REJECT_EVT 20 /* incoming connection rejected */ #define BTA_AV_RC_FEAT_EVT 21 /* remote control channel peer supported features update */ #define BTA_AV_SINK_MEDIA_CFG_EVT 22 /* command to configure sink codec */ #define BTA_AV_SINK_MEDIA_DATA_EVT 23 /* sending sink data to Media Task */ #define BTA_AV_OFFLOAD_START_RSP_EVT 24 /* a2dp offload start response */ /* Max BTA event */ #define BTA_AV_MAX_EVT 23 #define BTA_AV_MAX_EVT 25 typedef uint8_t tBTA_AV_EVT; Loading Loading @@ -335,6 +337,21 @@ typedef struct BD_ADDR peer_addr; } tBTA_AV_RC_CLOSE; /* data associated with BTA_AV_RC_BROWSE_OPEN_EVT */ typedef struct { uint8_t rc_handle; BD_ADDR peer_addr; tBTA_AV_STATUS status; } tBTA_AV_RC_BROWSE_OPEN; /* data associated with BTA_AV_RC_BROWSE_CLOSE_EVT */ typedef struct { uint8_t rc_handle; BD_ADDR peer_addr; } tBTA_AV_RC_BROWSE_CLOSE; /* data associated with BTA_AV_RC_FEAT_EVT */ typedef struct { Loading Loading @@ -417,6 +434,8 @@ typedef union tBTA_AV_PROTECT_RSP protect_rsp; tBTA_AV_RC_OPEN rc_open; tBTA_AV_RC_CLOSE rc_close; tBTA_AV_RC_BROWSE_OPEN rc_browse_open; tBTA_AV_RC_BROWSE_CLOSE rc_browse_close; tBTA_AV_REMOTE_CMD remote_cmd; tBTA_AV_REMOTE_RSP remote_rsp; tBTA_AV_VENDOR vendor_cmd; Loading Loading
system/bta/av/bta_av_act.c +135 −9 Original line number Diff line number Diff line /****************************************************************************** * * Copyright (C) 2004-2012 Broadcom Corporation * Copyright (C) 2004-2016 Broadcom Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -227,6 +227,14 @@ static void bta_av_rc_ctrl_cback(uint8_t handle, uint8_t event, uint16_t result, { msg_event = BTA_AV_AVRC_CLOSE_EVT; } else if (event == AVRC_BROWSE_OPEN_IND_EVT) { msg_event = BTA_AV_AVRC_BROWSE_OPEN_EVT; } else if (event == AVRC_BROWSE_CLOSE_IND_EVT) { msg_event = BTA_AV_AVRC_BROWSE_CLOSE_EVT; } if (msg_event) { tBTA_AV_RC_CONN_CHG *p_msg = Loading Loading @@ -255,7 +263,10 @@ static void bta_av_rc_msg_cback(uint8_t handle, uint8_t label, uint8_t opcode, t APPL_TRACE_DEBUG("%s handle: %u opcode=0x%x", __func__, handle, opcode); /* Determine the size of the buffer we need */ /* Copy avrc packet into BTA message buffer (for sending to BTA state machine) */ /* Get size of payload data (for vendor and passthrough messages only; for browsing * messages, use zero-copy) */ if (opcode == AVRC_OP_VENDOR && p_msg->vendor.p_vendor_data != NULL) { p_data_src = p_msg->vendor.p_vendor_data; data_len = (uint16_t) p_msg->vendor.vendor_len; Loading @@ -267,6 +278,7 @@ static void bta_av_rc_msg_cback(uint8_t handle, uint8_t label, uint8_t opcode, t /* Create a copy of the message */ tBTA_AV_RC_MSG *p_buf = (tBTA_AV_RC_MSG *)osi_malloc(sizeof(tBTA_AV_RC_MSG) + data_len); p_buf->hdr.event = BTA_AV_AVRC_MSG_EVT; p_buf->handle = handle; p_buf->label = label; Loading @@ -276,13 +288,23 @@ static void bta_av_rc_msg_cback(uint8_t handle, uint8_t label, uint8_t opcode, t if (p_data_src != NULL) { uint8_t *p_data_dst = (uint8_t *)(p_buf + 1); memcpy(p_data_dst, p_data_src, data_len); /* Update bta message buffer to point to payload data */ /* (Note AVRC_OP_BROWSING uses zero-copy: p_buf->msg.browse.p_browse_data * already points to original avrc buffer) */ if (opcode == AVRC_OP_VENDOR) p_buf->msg.vendor.p_vendor_data = p_data_dst; else if (opcode == AVRC_OP_PASS_THRU) p_buf->msg.pass.p_pass_data = p_data_dst; } if (opcode == AVRC_OP_BROWSE) { /* set p_pkt to NULL, so avrc would not free the buffer */ p_msg->browse.p_browse_pkt = NULL; } bta_sys_sendmsg(p_buf); } /******************************************************************************* Loading Loading @@ -323,7 +345,8 @@ uint8_t bta_av_rc_create(tBTA_AV_CB *p_cb, uint8_t role, uint8_t shdl, uint8_t l ccb.company_id = p_bta_av_cfg->company_id; ccb.conn = role; /* note: BTA_AV_FEAT_RCTG = AVRC_CT_TARGET, BTA_AV_FEAT_RCCT = AVRC_CT_CONTROL */ ccb.control = p_cb->features & (BTA_AV_FEAT_RCTG | BTA_AV_FEAT_RCCT | AVRC_CT_PASSIVE); ccb.control = p_cb->features & (BTA_AV_FEAT_RCTG | BTA_AV_FEAT_RCCT | BTA_AV_FEAT_METADATA | AVRC_CT_PASSIVE); if (AVRC_Open(&rc_handle, &ccb, bda) != AVRC_SUCCESS) return BTA_AV_RC_HANDLE_NONE; Loading Loading @@ -512,6 +535,14 @@ void bta_av_rc_opened(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) return; } if (p_cb->features & BTA_AV_FEAT_RCTG) { /* listen to browsing channel when the connection is open, * if peer initiated AVRCP connection and local device supports browsing channel */ if ((p_cb->features & BTA_AV_FEAT_BROWSE) && (p_cb->rcb[i].peer_features == 0)) AVRC_OpenBrowse(p_data->rc_conn_chg.handle, AVCT_ACP); } if (p_cb->rcb[i].lidx == (BTA_AV_NUM_LINKS + 1) && shdl != 0) { /* rc is opened on the RC only ACP channel, but is for a specific Loading Loading @@ -572,6 +603,15 @@ void bta_av_rc_opened(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) } (*p_cb->p_cback)(BTA_AV_RC_OPEN_EVT, (tBTA_AV *) &rc_open); /* if local initiated AVRCP connection and both peer and locals device support * browsing channel, open the browsing channel now */ if ((p_cb->features & BTA_AV_FEAT_BROWSE) && (rc_open.peer_features & BTA_AV_FEAT_BROWSE) && ((p_cb->rcb[i].status & BTA_AV_RC_ROLE_MASK) == BTA_AV_RC_ROLE_INT)) { AVRC_OpenBrowse (p_data->rc_conn_chg.handle, AVCT_INT); } } /******************************************************************************* Loading Loading @@ -696,17 +736,20 @@ void bta_av_rc_free_rsp (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) /******************************************************************************* ** ** Function bta_av_rc_meta_req ** Function bta_av_rc_free_browse_msg ** ** Description Send an AVRCP metadata command. ** Description free an AVRCP browse message buffer. ** ** Returns void ** *******************************************************************************/ void bta_av_rc_free_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) void bta_av_rc_free_browse_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) { UNUSED(p_cb); UNUSED(p_data); if (p_data->rc_msg.opcode == AVRC_OP_BROWSE) { osi_free_and_reset((void **)&p_data->rc_msg.msg.browse.p_browse_pkt); } } /******************************************************************************* Loading Loading @@ -778,7 +821,8 @@ tBTA_AV_EVT bta_av_proc_meta_cmd(tAVRC_RESPONSE *p_rc_rsp, tBTA_AV_RC_MSG *p_ms /* reject it */ evt=0; p_vendor->hdr.ctype = BTA_AV_RSP_NOT_IMPL; AVRC_VendorRsp(p_msg->handle, p_msg->label, &p_msg->msg.vendor); p_vendor->vendor_len = 0; p_rc_rsp->rsp.status = AVRC_STS_BAD_PARAM; } else if (!AVRC_IsValidAvcType(pdu, p_vendor->hdr.ctype) ) { Loading Loading @@ -872,6 +916,15 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) rc_rsp.rsp.status = BTA_AV_STS_NO_RSP; #endif if (NULL == p_data) { APPL_TRACE_ERROR("Message from peer with no data in %s", __func__); return; } APPL_TRACE_DEBUG("%s: opcode=%x, ctype=%x", __func__, p_data->rc_msg.opcode, p_data->rc_msg.msg.hdr.ctype); if (p_data->rc_msg.opcode == AVRC_OP_PASS_THRU) { /* if this is a pass thru command */ Loading @@ -893,7 +946,7 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) p_data->rc_msg.msg.pass.p_pass_data, is_inquiry); #endif } #if (AVRC_CTLR_INCLUDED == TRUE) #if (AVRC_CTRL_INCLUDED == TRUE) else if (((p_data->rc_msg.msg.pass.op_id == AVRC_ID_VOL_UP)|| (p_data->rc_msg.msg.pass.op_id == AVRC_ID_VOL_DOWN)) && !strcmp(avrcp_ct_support, "true")) Loading Loading @@ -974,6 +1027,7 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) (p_vendor->company_id == AVRC_CO_METADATA)) { av.meta_msg.p_msg = &p_data->rc_msg.msg; rc_rsp.rsp.status = BTA_AV_STS_NO_RSP; evt = bta_av_proc_meta_cmd (&rc_rsp, &p_data->rc_msg, &ctype); } else Loading Loading @@ -1011,6 +1065,19 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) AVRC_VendorRsp(p_data->rc_msg.handle, p_data->rc_msg.label, &p_data->rc_msg.msg.vendor); } } else if (p_data->rc_msg.opcode == AVRC_OP_BROWSE) { /* set up for callback */ av.meta_msg.rc_handle = p_data->rc_msg.handle; av.meta_msg.company_id = p_vendor->company_id; av.meta_msg.code = p_data->rc_msg.msg.hdr.ctype; av.meta_msg.label = p_data->rc_msg.label; av.meta_msg.p_msg = &p_data->rc_msg.msg; av.meta_msg.p_data = p_data->rc_msg.msg.browse.p_browse_data; av.meta_msg.len = p_data->rc_msg.msg.browse.browse_len; evt = BTA_AV_META_MSG_EVT; } #if (AVRC_METADATA_INCLUDED == TRUE) if (evt == 0 && rc_rsp.rsp.status != BTA_AV_STS_NO_RSP) { Loading @@ -1029,6 +1096,8 @@ void bta_av_rc_msg(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data) { av.remote_cmd.rc_handle = p_data->rc_msg.handle; (*p_cb->p_cback)(evt, &av); /* If browsing message, then free the browse message buffer */ bta_av_rc_free_browse_msg(p_cb, p_data); } } Loading Loading @@ -1328,6 +1397,8 @@ void bta_av_conn_chg(tBTA_AV_DATA *p_data) if (bta_av_cb.rcb[i].shdl == index + 1) { bta_av_del_rc(&bta_av_cb.rcb[i]); /* since the connection is already down and info was removed, clean reference */ bta_av_cb.rcb[i].shdl = 0; break; } } Loading Loading @@ -2034,6 +2105,61 @@ void bta_av_rc_closed(tBTA_AV_DATA *p_data) (*p_cb->p_cback)(BTA_AV_RC_CLOSE_EVT, (tBTA_AV *) &rc_close); } /******************************************************************************* ** ** Function bta_av_rc_browse_opened ** ** Description AVRC browsing channel is opened ** ** Returns void ** *******************************************************************************/ void bta_av_rc_browse_opened(tBTA_AV_DATA *p_data) { tBTA_AV_CB *p_cb = &bta_av_cb; tBTA_AV_RC_CONN_CHG *p_msg = (tBTA_AV_RC_CONN_CHG *)p_data; tBTA_AV_RC_BROWSE_OPEN rc_browse_open; APPL_TRACE_DEBUG("bta_av_rc_browse_opened bd_addr:%02x-%02x-%02x-%02x-%02x-%02x", p_msg->peer_addr[0], p_msg->peer_addr[1], p_msg->peer_addr[2], p_msg->peer_addr[3], p_msg->peer_addr[4], p_msg->peer_addr[5]); APPL_TRACE_DEBUG("bta_av_rc_browse_opened rc_handle:%d", p_msg->handle); rc_browse_open.status = BTA_AV_SUCCESS; rc_browse_open.rc_handle = p_msg->handle; bdcpy(rc_browse_open.peer_addr, p_msg->peer_addr); (*p_cb->p_cback)(BTA_AV_RC_BROWSE_OPEN_EVT, (tBTA_AV *)&rc_browse_open); } /******************************************************************************* ** ** Function bta_av_rc_browse_closed ** ** Description AVRC browsing channel is closed ** ** Returns void ** *******************************************************************************/ void bta_av_rc_browse_closed(tBTA_AV_DATA *p_data) { tBTA_AV_CB *p_cb = &bta_av_cb; tBTA_AV_RC_CONN_CHG *p_msg = (tBTA_AV_RC_CONN_CHG *)p_data; tBTA_AV_RC_BROWSE_CLOSE rc_browse_close; APPL_TRACE_DEBUG("bta_av_rc_browse_closed bd_addr:%02x-%02x-%02x-%02x-%02x-%02x", p_msg->peer_addr[0], p_msg->peer_addr[1], p_msg->peer_addr[2], p_msg->peer_addr[3], p_msg->peer_addr[4], p_msg->peer_addr[5]); APPL_TRACE_DEBUG("bta_av_rc_browse_closed rc_handle:%d", p_msg->handle); rc_browse_close.rc_handle = p_msg->handle; bdcpy(rc_browse_close.peer_addr, p_msg->peer_addr); (*p_cb->p_cback)(BTA_AV_RC_BROWSE_CLOSE_EVT, (tBTA_AV *)&rc_browse_close); } /******************************************************************************* ** ** Function bta_av_rc_disc Loading
system/bta/av/bta_av_cfg.c +24 −6 Original line number Diff line number Diff line /****************************************************************************** * * Copyright (C) 2005-2012 Broadcom Corporation * Copyright (C) 2005-2016 Broadcom Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -30,6 +30,10 @@ #include "bta_api.h" #include "bta_av_int.h" #ifndef BTA_AV_RC_COMP_ID #define BTA_AV_RC_COMP_ID AVRC_CO_GOOGLE #endif #ifndef BTA_AV_RC_PASS_RSP_CODE #define BTA_AV_RC_PASS_RSP_CODE BTA_AV_RSP_NOT_IMPL #endif Loading @@ -39,13 +43,22 @@ const uint32_t bta_av_meta_caps_co_ids[] = { AVRC_CO_BROADCOM }; /* AVRCP cupported categories */ /* AVRCP supported categories */ #if (AVRC_CTRL_INCLUDED == TRUE) #define BTA_AV_RC_SUPF_CT (AVRC_SUPF_CT_CAT2) #define BTA_AVK_RC_SUPF_CT (AVRC_SUPF_CT_CAT1) #define BTA_AVK_RC_SUPF_TG (AVRC_SUPF_TG_CAT2) #endif /* AVRCP Controller and Targer default name */ #ifndef BTA_AV_RC_CT_NAME #define BTA_AV_RC_CT_NAME "AVRC Controller" #endif #ifndef BTA_AV_RC_TG_NAME #define BTA_AV_RC_TG_NAME "AVRC Target" #endif /* Added to modify ** 1. flush timeout ** 2. Remove Group navigation support in SupportedFeatures Loading @@ -65,7 +78,8 @@ const uint16_t bta_av_audio_flush_to[] = { /* Note: Android doesnt support AVRC_SUPF_TG_GROUP_NAVI */ /* Note: if AVRC_SUPF_TG_GROUP_NAVI is set, bta_av_cfg.avrc_group should be true */ #if (AVRC_METADATA_INCLUDED == TRUE) #define BTA_AV_RC_SUPF_TG (AVRC_SUPF_TG_CAT1) /* TODO: | AVRC_SUPF_TG_APP_SETTINGS) */ #define BTA_AV_RC_SUPF_TG (AVRC_SUPF_TG_CAT1 | AVRC_SUPF_TG_MULTI_PLAYER | \ AVRC_SUPF_TG_BROWSE) /* TODO: | AVRC_SUPF_TG_APP_SETTINGS) */ #else #define BTA_AV_RC_SUPF_TG (AVRC_SUPF_TG_CAT1) #endif Loading @@ -77,6 +91,10 @@ const uint8_t bta_av_meta_caps_evt_ids[] = { AVRC_EVT_PLAY_STATUS_CHANGE, AVRC_EVT_TRACK_CHANGE, AVRC_EVT_PLAY_POS_CHANGED, AVRC_EVT_AVAL_PLAYERS_CHANGE, AVRC_EVT_ADDR_PLAYER_CHANGE, AVRC_EVT_UIDS_CHANGE, AVRC_EVT_NOW_PLAYING_CHANGE, /* TODO: Add support for these events AVRC_EVT_APP_SETTING_CHANGE, */ Loading @@ -103,7 +121,7 @@ const uint8_t bta_avk_meta_caps_evt_ids[] = { /* This configuration to be used when we are Src + TG + CT( only for abs vol) */ const tBTA_AV_CFG bta_av_cfg = { AVRC_CO_BROADCOM, /* AVRCP Company ID */ BTA_AV_RC_COMP_ID, /* AVRCP Company ID */ #if (AVRC_METADATA_INCLUDED == TRUE) 512, /* AVRCP MTU at L2CAP for control channel */ #else Loading @@ -126,8 +144,8 @@ const tBTA_AV_CFG bta_av_cfg = bta_av_meta_caps_evt_ids,/* the the metadata Get Capabilities response for event id */ NULL, /* the action function table for VDP stream */ NULL, /* action function to register VDP */ {0}, /* Default AVRCP controller name */ {0}, /* Default AVRCP target name */ BTA_AV_RC_CT_NAME, /* Default AVRCP controller name */ BTA_AV_RC_TG_NAME /* Default AVRCP target name */ }; /* This configuration to be used when we are Sink + CT + TG( only for abs vol) */ Loading
system/bta/av/bta_av_int.h +5 −1 Original line number Diff line number Diff line Loading @@ -97,6 +97,8 @@ enum BTA_AV_SIGNALLING_TIMER_EVT, BTA_AV_SDP_AVRC_DISC_EVT, BTA_AV_AVRC_CLOSE_EVT, BTA_AV_AVRC_BROWSE_OPEN_EVT, BTA_AV_AVRC_BROWSE_CLOSE_EVT, BTA_AV_CONN_CHG_EVT, BTA_AV_DEREG_COMP_EVT, #if (AVDT_REPORTING == TRUE) Loading Loading @@ -651,6 +653,8 @@ extern void bta_av_sig_chg(tBTA_AV_DATA *p_data); extern void bta_av_signalling_timer(tBTA_AV_DATA *p_data); extern void bta_av_rc_disc_done(tBTA_AV_DATA *p_data); extern void bta_av_rc_closed(tBTA_AV_DATA *p_data); extern void bta_av_rc_browse_opened(tBTA_AV_DATA *p_data); extern void bta_av_rc_browse_closed(tBTA_AV_DATA *p_data); extern void bta_av_rc_disc(uint8_t disc); extern void bta_av_conn_chg(tBTA_AV_DATA *p_data); extern void bta_av_dereg_comp(tBTA_AV_DATA *p_data); Loading @@ -665,7 +669,7 @@ extern void bta_av_rc_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern void bta_av_rc_close (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern void bta_av_rc_meta_rsp (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern void bta_av_rc_free_rsp (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern void bta_av_rc_free_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern void bta_av_rc_free_browse_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data); extern tBTA_AV_RCB * bta_av_get_rcb_by_shdl(uint8_t shdl); extern void bta_av_del_rc(tBTA_AV_RCB *p_rcb); Loading
system/bta/av/bta_av_main.c +21 −11 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ enum BTA_AV_RC_VENDOR_CMD, BTA_AV_RC_VENDOR_RSP, BTA_AV_RC_FREE_RSP, BTA_AV_RC_FREE_MSG, BTA_AV_RC_FREE_BROWSE_MSG, BTA_AV_RC_META_RSP, BTA_AV_RC_MSG, BTA_AV_RC_CLOSE, Loading @@ -99,7 +99,7 @@ const tBTA_AV_ACTION bta_av_action[] = bta_av_rc_vendor_cmd, bta_av_rc_vendor_rsp, bta_av_rc_free_rsp, bta_av_rc_free_msg, bta_av_rc_free_browse_msg, bta_av_rc_meta_rsp, bta_av_rc_msg, bta_av_rc_close, Loading @@ -122,7 +122,7 @@ static const uint8_t bta_av_st_init[][BTA_AV_NUM_COLS] = /* API_META_RSP_EVT */ {BTA_AV_RC_FREE_RSP, BTA_AV_INIT_ST }, /* API_RC_CLOSE_EVT */ {BTA_AV_IGNORE, BTA_AV_INIT_ST }, /* AVRC_OPEN_EVT */ {BTA_AV_RC_OPENED, BTA_AV_OPEN_ST }, /* AVRC_MSG_EVT */ {BTA_AV_RC_FREE_MSG, BTA_AV_INIT_ST }, /* AVRC_MSG_EVT */ {BTA_AV_RC_FREE_BROWSE_MSG, BTA_AV_INIT_ST }, /* AVRC_NONE_EVT */ {BTA_AV_IGNORE, BTA_AV_INIT_ST }, }; Loading Loading @@ -176,6 +176,8 @@ const tBTA_AV_NSM_ACT bta_av_nsm_act[] = bta_av_signalling_timer, /* BTA_AV_SIGNALLING_TIMER_EVT */ bta_av_rc_disc_done, /* BTA_AV_SDP_AVRC_DISC_EVT */ bta_av_rc_closed, /* BTA_AV_AVRC_CLOSE_EVT */ bta_av_rc_browse_opened,/* BTA_AV_AVRC_BROWSE_OPEN_EVT */ bta_av_rc_browse_closed,/* BTA_AV_AVRC_BROWSE_CLOSE_EVT */ bta_av_conn_chg, /* BTA_AV_CONN_CHG_EVT */ bta_av_dereg_comp, /* BTA_AV_DEREG_COMP_EVT */ #if (AVDT_REPORTING == TRUE) Loading Loading @@ -456,6 +458,12 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data) p_bta_av_cfg = (tBTA_AV_CFG *) &bta_av_cfg; } if (p_bta_av_cfg == NULL) { APPL_TRACE_ERROR("AV configuration is null!"); return; } do { p_scb = bta_av_alloc_scb(registr.chnl); Loading Loading @@ -496,19 +504,19 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data) bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu, (uint8_t)(bta_av_cb.sec_mask & (~BTA_SEC_AUTHORIZE)), BTA_ID_AV); #endif uint16_t profile_version = AVRC_REV_1_0; if (profile_initialized == UUID_SERVCLASS_AUDIO_SOURCE) { bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target", NULL, p_bta_av_cfg->avrc_tg_cat, BTA_ID_AV, (bta_av_cb.features & BTA_AV_FEAT_BROWSE), AVRC_REV_1_3); profile_version = AVRC_REV_1_6; } else if (profile_initialized == UUID_SERVCLASS_AUDIO_SINK) { // Initialize AVRCP1.4 to provide Absolute Volume control. profile_version = AVRC_REV_1_4; } bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target", NULL, p_bta_av_cfg->avrc_tg_cat, BTA_ID_AV, (bta_av_cb.features & BTA_AV_FEAT_BROWSE), AVRC_REV_1_4); } (bta_av_cb.features & BTA_AV_FEAT_BROWSE), profile_version); #endif } Loading Loading @@ -1331,6 +1339,8 @@ char *bta_av_evt_code(uint16_t evt_code) case BTA_AV_SIGNALLING_TIMER_EVT: return "SIGNALLING_TIMER"; case BTA_AV_SDP_AVRC_DISC_EVT: return "SDP_AVRC_DISC"; case BTA_AV_AVRC_CLOSE_EVT: return "AVRC_CLOSE"; case BTA_AV_AVRC_BROWSE_OPEN_EVT: return "AVRC_BROWSE_OPEN"; case BTA_AV_AVRC_BROWSE_CLOSE_EVT: return "AVRC_BROWSE_CLOSE"; case BTA_AV_CONN_CHG_EVT: return "CONN_CHG"; case BTA_AV_DEREG_COMP_EVT: return "DEREG_COMP"; #if (AVDT_REPORTING == TRUE) Loading
system/bta/include/bta_av_api.h +52 −33 Original line number Diff line number Diff line Loading @@ -213,24 +213,26 @@ typedef uint8_t tBTA_AV_ERR; #define BTA_AV_PROTECT_RSP_EVT 7 /* content protection response */ #define BTA_AV_RC_OPEN_EVT 8 /* remote control channel open */ #define BTA_AV_RC_CLOSE_EVT 9 /* remote control channel closed */ #define BTA_AV_REMOTE_CMD_EVT 10 /* remote control command */ #define BTA_AV_REMOTE_RSP_EVT 11 /* remote control response */ #define BTA_AV_VENDOR_CMD_EVT 12 /* vendor dependent remote control command */ #define BTA_AV_VENDOR_RSP_EVT 13 /* vendor dependent remote control response */ #define BTA_AV_RECONFIG_EVT 14 /* reconfigure response */ #define BTA_AV_SUSPEND_EVT 15 /* suspend response */ #define BTA_AV_PENDING_EVT 16 /* incoming connection pending: #define BTA_AV_RC_BROWSE_OPEN_EVT 10 /* remote control browse channel open */ #define BTA_AV_RC_BROWSE_CLOSE_EVT 11 /* remote control browse channel closed */ #define BTA_AV_REMOTE_CMD_EVT 12 /* remote control command */ #define BTA_AV_REMOTE_RSP_EVT 13 /* remote control response */ #define BTA_AV_VENDOR_CMD_EVT 14 /* vendor dependent remote control command */ #define BTA_AV_VENDOR_RSP_EVT 15 /* vendor dependent remote control response */ #define BTA_AV_RECONFIG_EVT 16 /* reconfigure response */ #define BTA_AV_SUSPEND_EVT 17 /* suspend response */ #define BTA_AV_PENDING_EVT 18 /* incoming connection pending: * signal channel is open and stream is * not open after * BTA_AV_SIGNALLING_TIMEOUT_MS */ #define BTA_AV_META_MSG_EVT 17 /* metadata messages */ #define BTA_AV_REJECT_EVT 18 /* incoming connection rejected */ #define BTA_AV_RC_FEAT_EVT 19 /* remote control channel peer supported features update */ #define BTA_AV_SINK_MEDIA_CFG_EVT 20 /* command to configure sink codec */ #define BTA_AV_SINK_MEDIA_DATA_EVT 21 /* sending sink data to Media Task */ #define BTA_AV_OFFLOAD_START_RSP_EVT 22 /* a2dp offload start response */ #define BTA_AV_META_MSG_EVT 19 /* metadata messages */ #define BTA_AV_REJECT_EVT 20 /* incoming connection rejected */ #define BTA_AV_RC_FEAT_EVT 21 /* remote control channel peer supported features update */ #define BTA_AV_SINK_MEDIA_CFG_EVT 22 /* command to configure sink codec */ #define BTA_AV_SINK_MEDIA_DATA_EVT 23 /* sending sink data to Media Task */ #define BTA_AV_OFFLOAD_START_RSP_EVT 24 /* a2dp offload start response */ /* Max BTA event */ #define BTA_AV_MAX_EVT 23 #define BTA_AV_MAX_EVT 25 typedef uint8_t tBTA_AV_EVT; Loading Loading @@ -335,6 +337,21 @@ typedef struct BD_ADDR peer_addr; } tBTA_AV_RC_CLOSE; /* data associated with BTA_AV_RC_BROWSE_OPEN_EVT */ typedef struct { uint8_t rc_handle; BD_ADDR peer_addr; tBTA_AV_STATUS status; } tBTA_AV_RC_BROWSE_OPEN; /* data associated with BTA_AV_RC_BROWSE_CLOSE_EVT */ typedef struct { uint8_t rc_handle; BD_ADDR peer_addr; } tBTA_AV_RC_BROWSE_CLOSE; /* data associated with BTA_AV_RC_FEAT_EVT */ typedef struct { Loading Loading @@ -417,6 +434,8 @@ typedef union tBTA_AV_PROTECT_RSP protect_rsp; tBTA_AV_RC_OPEN rc_open; tBTA_AV_RC_CLOSE rc_close; tBTA_AV_RC_BROWSE_OPEN rc_browse_open; tBTA_AV_RC_BROWSE_CLOSE rc_browse_close; tBTA_AV_REMOTE_CMD remote_cmd; tBTA_AV_REMOTE_RSP remote_rsp; tBTA_AV_VENDOR vendor_cmd; Loading