btif_rc_device_cb_t* p_dev);
#endif
-#if (AVRC_CTRL_INCLUDED == TRUE)
static void handle_avk_rc_metamsg_cmd(tBTA_AV_META_MSG* pmeta_msg);
static void handle_avk_rc_metamsg_rsp(tBTA_AV_META_MSG* pmeta_msg);
static void btif_rc_ctrl_upstreams_rsp_cmd(uint8_t event,
btrc_folder_items_t* btrc_item);
static bt_status_t get_folder_items_cmd(bt_bdaddr_t* bd_addr, uint8_t scope,
uint8_t start_item, uint8_t num_items);
-#endif
static void btif_rc_upstreams_evt(uint16_t event, tAVRC_COMMAND* p_param,
uint8_t ctype, uint8_t label,
}
}
-#if (AVRC_CTRL_INCLUDED == TRUE)
void rc_cleanup_sent_cmd(void* p_data) { BTIF_TRACE_DEBUG("%s: ", __func__); }
void handle_rc_ctrl_features(btif_rc_device_cb_t* p_dev) {
BTIF_TRACE_DEBUG("%s: Update rc features to CTRL: %d", __func__, rc_features);
HAL_CBACK(bt_rc_ctrl_callbacks, getrcfeatures_cb, &rc_addr, rc_features);
}
-#endif
void handle_rc_features(btif_rc_device_cb_t* p_dev) {
bt_bdaddr_t rc_addr;
void handle_rc_browse_connect(tBTA_AV_RC_OPEN* p_rc_open) {
BTIF_TRACE_DEBUG("%s rc_handle %d status %d", __func__, p_rc_open->rc_handle,
p_rc_open->status);
-#if (AVRC_CTRL_INCLUDED == TRUE)
btif_rc_device_cb_t* p_dev =
btif_rc_get_device_by_handle(p_rc_open->rc_handle);
p_dev->br_connected = true;
HAL_CBACK(bt_rc_ctrl_callbacks, connection_state_cb, true, true, &rc_addr);
}
-#endif
}
/***************************************************************************
***************************************************************************/
void handle_rc_connect(tBTA_AV_RC_OPEN* p_rc_open) {
BTIF_TRACE_DEBUG("%s: rc_handle: %d", __func__, p_rc_open->rc_handle);
-#if (AVRC_CTRL_INCLUDED == TRUE)
- bt_bdaddr_t rc_addr;
-#endif
btif_rc_device_cb_t* p_dev = alloc_device();
if (p_dev == NULL) {
handle_rc_features(p_dev);
}
-#if (AVRC_CTRL_INCLUDED == TRUE)
p_dev->rc_playing_uid = RC_INVALID_TRACK_ID;
+ bt_bdaddr_t rc_addr;
bdcpy(rc_addr.address, p_dev->rc_addr);
if (bt_rc_ctrl_callbacks != NULL) {
HAL_CBACK(bt_rc_ctrl_callbacks, connection_state_cb, true, false, &rc_addr);
}
/* report connection state if remote device is AVRCP target */
handle_rc_ctrl_features(p_dev);
-#endif
}
/***************************************************************************
***************************************************************************/
void handle_rc_disconnect(tBTA_AV_RC_CLOSE* p_rc_close) {
btif_rc_device_cb_t* p_dev = NULL;
-#if (AVRC_CTRL_INCLUDED == TRUE)
- bt_bdaddr_t rc_addr;
- tBTA_AV_FEAT features = 0;
-#endif
BTIF_TRACE_DEBUG("%s: rc_handle: %d", __func__, p_rc_close->rc_handle);
p_dev = btif_rc_get_device_by_handle(p_rc_close->rc_handle);
BTIF_TRACE_ERROR("Got disconnect of unknown device");
return;
}
-#if (AVRC_CTRL_INCLUDED == TRUE)
+ bt_bdaddr_t rc_addr;
bdcpy(rc_addr.address, p_dev->rc_addr);
- features = p_dev->rc_features;
/* Clean up AVRCP procedure flags */
memset(&p_dev->rc_app_settings, 0, sizeof(btif_rc_player_app_settings_t));
p_dev->rc_features_processed = false;
list_clear(p_dev->rc_supported_event_list);
p_dev->rc_supported_event_list = NULL;
}
-#endif
/* check if there is another device connected */
if (p_dev->rc_state == BTRC_CONNECTION_STATE_CONNECTED) {
}
memset(p_dev->rc_addr, 0, sizeof(BD_ADDR));
-#if (AVRC_CTRL_INCLUDED == TRUE)
/* report connection state if device is AVRCP target */
if (bt_rc_ctrl_callbacks != NULL) {
HAL_CBACK(bt_rc_ctrl_callbacks, connection_state_cb, false, false,
&rc_addr);
}
-#endif
}
/***************************************************************************
bdcpy(rc_addr.address, p_dev->rc_addr);
-#if (AVRC_CTRL_INCLUDED == TRUE)
if (!(p_dev->rc_features & BTA_AV_FEAT_RCTG)) {
BTIF_TRACE_ERROR("%s: DUT does not support AVRCP controller role",
__func__);
HAL_CBACK(bt_rc_ctrl_callbacks, passthrough_rsp_cb, &rc_addr,
p_remote_rsp->rc_id, p_remote_rsp->key_state);
}
-#else
- BTIF_TRACE_ERROR("%s: AVRCP controller role is not enabled", __func__);
-#endif
}
/***************************************************************************
*
***************************************************************************/
void handle_rc_vendorunique_rsp(tBTA_AV_REMOTE_RSP* p_remote_rsp) {
-#if (AVRC_CTRL_INCLUDED == TRUE)
btif_rc_device_cb_t* p_dev = NULL;
const char* status;
uint8_t vendor_id = 0;
} else {
BTIF_TRACE_ERROR("%s: Remote does not support AVRCP TG role", __func__);
}
-#else
- BTIF_TRACE_ERROR("%s: AVRCP controller role is not enabled", __func__);
-#endif
}
void handle_uid_changed_notification(btif_rc_device_cb_t* p_dev, uint8_t label,
}
} break;
-#if (AVRC_CTRL_INCLUDED == TRUE)
case BTA_AV_REMOTE_RSP_EVT: {
BTIF_TRACE_DEBUG("%s: RSP: rc_id: 0x%x key_state: %d", __func__,
p_data->remote_rsp.rc_id, p_data->remote_rsp.key_state);
}
} break;
-#endif
case BTA_AV_RC_FEAT_EVT: {
BTIF_TRACE_DEBUG("%s: Peer_features: %x", __func__,
p_data->rc_feat.peer_features);
p_dev->rc_features = p_data->rc_feat.peer_features;
handle_rc_features(p_dev);
-#if (AVRC_CTRL_INCLUDED == TRUE)
if ((p_dev->rc_connected) && (bt_rc_ctrl_callbacks != NULL)) {
handle_rc_ctrl_features(p_dev);
}
-#endif
} break;
case BTA_AV_META_MSG_EVT: {
handle_rc_metamsg_cmd(&(p_data->meta_msg));
/* Free the Memory allocated for tAVRC_MSG */
- }
-#if (AVRC_CTRL_INCLUDED == TRUE)
- else if (bt_rc_ctrl_callbacks != NULL) {
+ } else if (bt_rc_ctrl_callbacks != NULL) {
/* This is case of Sink + CT + TG(for abs vol)) */
BTIF_TRACE_DEBUG(
"%s BTA_AV_META_MSG_EVT code:%d label:%d opcode %d ctype %d",
}
break;
}
-
- }
-#endif
- else {
+ } else {
BTIF_TRACE_ERROR("Neither CTRL, nor TG is up, drop meta commands");
}
} break;
}
}
-#if (AVRC_CTRL_INCLUDED == TRUE)
/*******************************************************************************
*
* Function btif_rc_ctrl_upstreams_rsp_cmd
break;
}
}
-#endif
/*******************************************************************************
*
}
#endif
-#if (AVRC_CTRL_INCLUDED == TRUE)
/***************************************************************************
*
* Function iterate_supported_event_list_for_interim_rsp
return;
}
}
-#endif
/***************************************************************************
*
btif_rc_device_cb_t* p_dev) {
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
rc_transaction_t* p_transaction = NULL;
-#if (AVRC_CTRL_INCLUDED == TRUE)
BTIF_TRACE_DEBUG("%s: cap_id: %d", __func__, cap_id);
CHECK_RC_CONNECTED(p_dev);
status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
btif_rc_device_cb_t* p_dev) {
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
rc_transaction_t* p_transaction = NULL;
-#if (AVRC_CTRL_INCLUDED == TRUE)
BTIF_TRACE_DEBUG("%s: ", __func__);
CHECK_RC_CONNECTED(p_dev);
status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
uint8_t attrib_id, btif_rc_device_cb_t* p_dev) {
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
rc_transaction_t* p_transaction = NULL;
-#if (AVRC_CTRL_INCLUDED == TRUE)
BTIF_TRACE_DEBUG("%s: attrib_id: %d", __func__, attrib_id);
CHECK_RC_CONNECTED(p_dev);
status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
rc_transaction_t* p_transaction = NULL;
int count = 0;
-#if (AVRC_CTRL_INCLUDED == TRUE)
BTIF_TRACE_DEBUG("%s: num attrib_id: %d", __func__, num_attrib);
CHECK_RC_CONNECTED(p_dev);
status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
uint8_t start_item,
uint8_t num_items) {
BTIF_TRACE_DEBUG("%s start, end: (%d, %d)", __func__, start_item, num_items);
-#if (AVRC_CTRL_INCLUDED == TRUE)
return get_folder_items_cmd(bd_addr, AVRC_SCOPE_NOW_PLAYING, start_item,
num_items);
-#else
- BTIF_TRACE_ERROR("%s AVRCP controller role is not enabled", __func__);
- return BT_STATUS_FAIL;
-#endif
}
/***************************************************************************
static bt_status_t get_folder_list_cmd(bt_bdaddr_t* bd_addr, uint8_t start_item,
uint8_t num_items) {
BTIF_TRACE_DEBUG("%s start, end: (%d, %d)", __func__, start_item, num_items);
-#if (AVRC_CTRL_INCLUDED == TRUE)
return get_folder_items_cmd(bd_addr, AVRC_SCOPE_FILE_SYSTEM, start_item,
num_items);
-#else
- BTIF_TRACE_ERROR("%s AVRCP controller role is not enabled", __func__);
- return BT_STATUS_FAIL;
-#endif
}
/***************************************************************************
static bt_status_t get_player_list_cmd(bt_bdaddr_t* bd_addr, uint8_t start_item,
uint8_t num_items) {
BTIF_TRACE_DEBUG("%s start, end: (%d, %d)", __func__, start_item, num_items);
-#if (AVRC_CTRL_INCLUDED == TRUE)
return get_folder_items_cmd(bd_addr, AVRC_SCOPE_PLAYER_LIST, start_item,
num_items);
-#else
- BTIF_TRACE_ERROR("%s AVRCP controller role is not enabled", __func__);
- return BT_STATUS_FAIL;
-#endif
}
/***************************************************************************
static bt_status_t change_folder_path_cmd(bt_bdaddr_t* bd_addr,
uint8_t direction, uint8_t* uid) {
BTIF_TRACE_DEBUG("%s direction (%d)", __func__, direction);
-#if (AVRC_CTRL_INCLUDED == TRUE)
btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr);
CHECK_RC_CONNECTED(p_dev);
status = BT_STATUS_FAIL;
}
return (bt_status_t)status;
-#else
- BTIF_TRACE_ERROR("%s AVRCP controller role is not enabled", __func__);
- return BT_STATUS_FAIL;
-#endif
}
/***************************************************************************
**************************************************************************/
static bt_status_t set_browsed_player_cmd(bt_bdaddr_t* bd_addr, uint16_t id) {
BTIF_TRACE_DEBUG("%s id (%d)", __func__, id);
-#if (AVRC_CTRL_INCLUDED == TRUE)
btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr);
CHECK_RC_CONNECTED(p_dev);
CHECK_BR_CONNECTED(p_dev);
status = BT_STATUS_FAIL;
}
return (bt_status_t)status;
-#else
- BTIF_TRACE_ERROR("%s AVRCP controller role is not enabled", __func__);
- return BT_STATUS_FAIL;
-#endif
}
/***************************************************************************
rc_transaction_t* p_transaction = NULL;
int count = 0;
btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr);
-#if (AVRC_CTRL_INCLUDED == TRUE)
BTIF_TRACE_DEBUG("%s: num attrib_id: %d", __func__, num_attrib);
CHECK_RC_CONNECTED(p_dev);
}
osi_free(p_msg);
osi_free_and_reset((void**)&avrc_cmd.set_app_val.p_vals);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
static bt_status_t play_item_cmd(bt_bdaddr_t* bd_addr, uint8_t scope,
uint8_t* uid, uint16_t uid_counter) {
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
-#if (AVRC_CTRL_INCLUDED == TRUE)
rc_transaction_t* p_transaction = NULL;
BTIF_TRACE_DEBUG("%s: scope %d uid_counter %d", __FUNCTION__, scope,
uid_counter);
__FUNCTION__, status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __FUNCTION__);
-#endif
return (bt_status_t)status;
}
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
rc_transaction_t* p_transaction = NULL;
int count = 0;
-#if (AVRC_CTRL_INCLUDED == TRUE)
tAVRC_COMMAND avrc_cmd = {0};
BT_HDR* p_msg = NULL;
bt_status_t tran_status;
status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
rc_transaction_t* p_transaction = NULL;
int count = 0;
-#if (AVRC_CTRL_INCLUDED == TRUE)
tAVRC_COMMAND avrc_cmd = {0};
BT_HDR* p_msg = NULL;
bt_status_t tran_status;
status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
uint32_t event_value,
btif_rc_device_cb_t* p_dev) {
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
-#if (AVRC_CTRL_INCLUDED == TRUE)
tAVRC_COMMAND avrc_cmd = {0};
BT_HDR* p_msg = NULL;
status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
rc_transaction_t* p_transaction = NULL;
int count = 0;
-#if (AVRC_CTRL_INCLUDED == TRUE)
tAVRC_COMMAND avrc_cmd = {0};
BT_HDR* p_msg = NULL;
bt_status_t tran_status;
status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
static bt_status_t get_play_status_cmd(btif_rc_device_cb_t* p_dev) {
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
rc_transaction_t* p_transaction = NULL;
-#if (AVRC_CTRL_INCLUDED == TRUE)
tAVRC_COMMAND avrc_cmd = {0};
BT_HDR* p_msg = NULL;
bt_status_t tran_status;
status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
static bt_status_t set_volume_rsp(bt_bdaddr_t* bd_addr, uint8_t abs_vol,
uint8_t label) {
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
-#if (AVRC_CTRL_INCLUDED == TRUE)
tAVRC_RESPONSE avrc_rsp;
BT_HDR* p_msg = NULL;
btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr);
status);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
tAVRC_RESPONSE avrc_rsp;
BT_HDR* p_msg = NULL;
-#if (AVRC_CTRL_INCLUDED == TRUE)
BTIF_TRACE_DEBUG("%s: rsp_type: %d abs_vol: %d", __func__, rsp_type, abs_vol);
btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr);
}
osi_free(p_msg);
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
uint8_t key_code,
uint8_t key_state) {
tAVRC_STS status = BT_STATUS_UNSUPPORTED;
-#if (AVRC_CTRL_INCLUDED == TRUE)
rc_transaction_t* p_transaction = NULL;
BTIF_TRACE_DEBUG("%s: key-code: %d, key-state: %d", __func__, key_code,
key_state);
status = BT_STATUS_FAIL;
BTIF_TRACE_DEBUG("%s: feature not supported", __func__);
}
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}
btif_rc_device_cb_t* p_dev = NULL;
BTIF_TRACE_ERROR("%s: calling btif_rc_get_device_by_bda", __func__);
p_dev = btif_rc_get_device_by_bda(bd_addr);
-#if (AVRC_CTRL_INCLUDED == TRUE)
CHECK_RC_CONNECTED(p_dev);
status = BT_STATUS_FAIL;
BTIF_TRACE_DEBUG("%s: feature not supported", __func__);
}
-#else
- BTIF_TRACE_DEBUG("%s: feature not enabled", __func__);
-#endif
return (bt_status_t)status;
}