Lines Matching refs:p_dev
93 #define CHECK_RC_CONNECTED(p_dev) \ argument
95 if ((p_dev) == NULL || !(p_dev)->rc_connected) { \
101 #define CHECK_BR_CONNECTED(p_dev) \ argument
103 if ((p_dev) == NULL || !(p_dev)->br_connected) { \
254 void initialize_device(btif_rc_device_cb_t* p_dev);
258 static void send_metamsg_rsp(btif_rc_device_cb_t* p_dev, int index,
261 static void register_volumechange(uint8_t label, btif_rc_device_cb_t* p_dev);
262 static void init_all_transactions(btif_rc_device_cb_t* p_dev);
263 static bt_status_t get_transaction(btif_rc_device_cb_t* p_dev,
265 static void release_transaction(btif_rc_device_cb_t* p_dev, uint8_t label);
266 static rc_transaction_t* get_transaction_by_lbl(btif_rc_device_cb_t* p_dev,
269 btif_rc_device_cb_t* p_dev);
276 btif_rc_device_cb_t* p_dev);
277 static void rc_ctrl_procedure_complete(btif_rc_device_cb_t* p_dev);
279 btif_rc_device_cb_t* p_dev);
304 static bt_status_t get_play_status_cmd(btif_rc_device_cb_t* p_dev);
306 uint8_t* attrs, uint8_t num_attrs, btif_rc_device_cb_t* p_dev);
308 uint8_t* vals, uint8_t num_vals, btif_rc_device_cb_t* p_dev);
311 btif_rc_device_cb_t* p_dev);
314 btif_rc_device_cb_t* p_dev);
317 btif_rc_device_cb_t* p_dev);
321 btif_rc_device_cb_t* p_dev);
323 btif_rc_device_cb_t* p_dev);
325 btif_rc_device_cb_t* p_dev);
327 uint8_t attrib_id, btif_rc_device_cb_t* p_dev);
330 btif_rc_device_cb_t* p_dev);
343 btif_rc_device_cb_t* p_dev);
348 btif_rc_device_cb_t* p_dev);
401 void initialize_device(btif_rc_device_cb_t* p_dev) { in initialize_device() argument
402 if (p_dev == nullptr) return; in initialize_device()
404 p_dev->rc_connected = false; in initialize_device()
405 p_dev->br_connected = false; in initialize_device()
406 p_dev->rc_handle = 0; in initialize_device()
407 p_dev->rc_features = 0; in initialize_device()
408 p_dev->rc_cover_art_psm = 0; in initialize_device()
409 p_dev->rc_state = BTRC_CONNECTION_STATE_DISCONNECTED; in initialize_device()
410 p_dev->rc_addr = RawAddress::kEmpty; in initialize_device()
411 p_dev->rc_pending_play = false; in initialize_device()
413 p_dev->rc_pdu_info[i].ctype = 0; in initialize_device()
414 p_dev->rc_pdu_info[i].label = 0; in initialize_device()
415 p_dev->rc_pdu_info[i].is_rsp_pending = false; in initialize_device()
417 if (p_dev->rc_supported_event_list != nullptr) { in initialize_device()
418 list_clear(p_dev->rc_supported_event_list); in initialize_device()
420 p_dev->rc_supported_event_list = nullptr; in initialize_device()
421 p_dev->rc_volume = MAX_VOLUME; in initialize_device()
422 p_dev->rc_vol_label = MAX_LABEL; in initialize_device()
423 memset(&p_dev->rc_app_settings, 0, sizeof(btif_rc_player_app_settings_t)); in initialize_device()
424 p_dev->rc_play_status_timer = nullptr; in initialize_device()
425 p_dev->rc_features_processed = false; in initialize_device()
426 p_dev->rc_playing_uid = 0; in initialize_device()
427 p_dev->rc_procedure_complete = false; in initialize_device()
431 memset(&p_dev->transaction_set.transaction, 0, in initialize_device()
432 sizeof(p_dev->transaction_set.transaction)); in initialize_device()
433 init_all_transactions(p_dev); in initialize_device()
480 const uint32_t* get_requested_attributes_list(btif_rc_device_cb_t* p_dev) { in get_requested_attributes_list() argument
481 return (p_dev->rc_features & BTA_AV_FEAT_COVER_ARTWORK in get_requested_attributes_list()
486 uint8_t get_requested_attributes_list_size(btif_rc_device_cb_t* p_dev) { in get_requested_attributes_list_size() argument
487 return (p_dev->rc_features & BTA_AV_FEAT_COVER_ARTWORK in get_requested_attributes_list_size()
493 btif_rc_device_cb_t* p_dev) { in fill_pdu_queue() argument
494 p_dev->rc_pdu_info[index].ctype = ctype; in fill_pdu_queue()
495 p_dev->rc_pdu_info[index].label = label; in fill_pdu_queue()
496 p_dev->rc_pdu_info[index].is_rsp_pending = pending; in fill_pdu_queue()
517 void handle_rc_ctrl_features(btif_rc_device_cb_t* p_dev) { in handle_rc_ctrl_features() argument
518 if (!(p_dev->rc_features & BTA_AV_FEAT_RCTG) && in handle_rc_ctrl_features()
519 (!(p_dev->rc_features & BTA_AV_FEAT_RCCT) || in handle_rc_ctrl_features()
520 !(p_dev->rc_features & BTA_AV_FEAT_ADV_CTRL))) { in handle_rc_ctrl_features()
526 if ((p_dev->rc_features & BTA_AV_FEAT_ADV_CTRL) && in handle_rc_ctrl_features()
527 (p_dev->rc_features & BTA_AV_FEAT_RCCT)) { in handle_rc_ctrl_features()
531 if (p_dev->rc_features & BTA_AV_FEAT_METADATA) { in handle_rc_ctrl_features()
535 if ((p_dev->rc_features & BTA_AV_FEAT_VENDOR) && in handle_rc_ctrl_features()
536 (p_dev->rc_features_processed != true)) { in handle_rc_ctrl_features()
541 p_dev->rc_features_processed = true; in handle_rc_ctrl_features()
543 getcapabilities_cmd(AVRC_CAP_COMPANY_ID, p_dev); in handle_rc_ctrl_features()
548 if (p_dev->rc_features & BTA_AV_FEAT_BROWSE) { in handle_rc_ctrl_features()
553 if (p_dev->rc_features & BTA_AV_FEAT_COVER_ARTWORK) { in handle_rc_ctrl_features()
559 p_dev->rc_addr, rc_features)); in handle_rc_ctrl_features()
562 void handle_rc_ctrl_psm(btif_rc_device_cb_t* p_dev) { in handle_rc_ctrl_psm() argument
563 uint16_t cover_art_psm = p_dev->rc_cover_art_psm; in handle_rc_ctrl_psm()
568 p_dev->rc_addr, cover_art_psm)); in handle_rc_ctrl_psm()
571 void handle_rc_features(btif_rc_device_cb_t* p_dev) { in handle_rc_features() argument
585 p_dev->rc_addr.ToString().c_str()); in handle_rc_features()
587 if (interop_match_addr(INTEROP_DISABLE_ABSOLUTE_VOLUME, &p_dev->rc_addr) || in handle_rc_features()
589 (avdtp_source_active_peer_addr != p_dev->rc_addr && in handle_rc_features()
590 avdtp_sink_active_peer_addr != p_dev->rc_addr)) { in handle_rc_features()
591 p_dev->rc_features &= ~BTA_AV_FEAT_ADV_CTRL; in handle_rc_features()
594 if (p_dev->rc_features & BTA_AV_FEAT_BROWSE) { in handle_rc_features()
599 if ((p_dev->rc_features & BTA_AV_FEAT_ADV_CTRL) && in handle_rc_features()
600 (p_dev->rc_features & BTA_AV_FEAT_RCTG)) { in handle_rc_features()
606 if (p_dev->rc_features & BTA_AV_FEAT_METADATA) { in handle_rc_features()
611 HAL_CBACK(bt_rc_callbacks, remote_features_cb, p_dev->rc_addr, rc_features); in handle_rc_features()
616 __func__, p_dev->rc_vol_label); in handle_rc_features()
618 if (p_dev->rc_features & BTA_AV_FEAT_ADV_CTRL && in handle_rc_features()
619 p_dev->rc_features & BTA_AV_FEAT_RCTG) { in handle_rc_features()
622 if (MAX_LABEL == p_dev->rc_vol_label) { in handle_rc_features()
623 status = get_transaction(p_dev, &p_transaction); in handle_rc_features()
625 p_transaction = get_transaction_by_lbl(p_dev, p_dev->rc_vol_label); in handle_rc_features()
629 __func__, p_dev->rc_vol_label); in handle_rc_features()
632 status = get_transaction(p_dev, &p_transaction); in handle_rc_features()
635 p_dev->rc_vol_label = p_transaction->lbl; in handle_rc_features()
636 register_volumechange(p_dev->rc_vol_label, p_dev); in handle_rc_features()
653 btif_rc_device_cb_t* p_dev = in handle_rc_browse_connect() local
656 if (!p_dev) { in handle_rc_browse_connect()
665 p_dev->br_connected = true; in handle_rc_browse_connect()
668 true, p_dev->rc_addr)); in handle_rc_browse_connect()
683 btif_rc_device_cb_t* p_dev = alloc_device(); in handle_rc_connect() local
684 if (p_dev == NULL) { in handle_rc_connect()
692 p_dev->rc_connected = false; in handle_rc_connect()
697 if (p_dev->rc_connected) { in handle_rc_connect()
701 __func__, p_dev->rc_handle, p_rc_open->rc_handle); in handle_rc_connect()
702 if (p_dev->rc_handle != p_rc_open->rc_handle && in handle_rc_connect()
703 p_dev->rc_addr != p_rc_open->peer_addr) { in handle_rc_connect()
709 p_dev->rc_addr = p_rc_open->peer_addr; in handle_rc_connect()
710 p_dev->rc_features = p_rc_open->peer_features; in handle_rc_connect()
712 __func__, p_rc_open->peer_features, p_dev->rc_features); in handle_rc_connect()
713 p_dev->rc_cover_art_psm = p_rc_open->cover_art_psm; in handle_rc_connect()
715 __func__, p_dev->rc_cover_art_psm); in handle_rc_connect()
716 p_dev->rc_vol_label = MAX_LABEL; in handle_rc_connect()
717 p_dev->rc_volume = MAX_VOLUME; in handle_rc_connect()
719 p_dev->rc_connected = true; in handle_rc_connect()
720 p_dev->rc_handle = p_rc_open->rc_handle; in handle_rc_connect()
721 p_dev->rc_state = BTRC_CONNECTION_STATE_CONNECTED; in handle_rc_connect()
724 if (p_dev->rc_features != 0 && bt_rc_callbacks != NULL) { in handle_rc_connect()
725 handle_rc_features(p_dev); in handle_rc_connect()
728 p_dev->rc_playing_uid = RC_INVALID_TRACK_ID; in handle_rc_connect()
732 false, p_dev->rc_addr)); in handle_rc_connect()
735 handle_rc_ctrl_features(p_dev); in handle_rc_connect()
738 handle_rc_ctrl_psm(p_dev); in handle_rc_connect()
750 btif_rc_device_cb_t* p_dev = NULL; in handle_rc_disconnect() local
753 p_dev = btif_rc_get_device_by_handle(p_rc_close->rc_handle); in handle_rc_disconnect()
754 if (p_dev == NULL) { in handle_rc_disconnect()
759 if (p_rc_close->rc_handle != p_dev->rc_handle && in handle_rc_disconnect()
760 p_dev->rc_addr != p_rc_close->peer_addr) { in handle_rc_disconnect()
769 false, p_dev->rc_addr)); in handle_rc_disconnect()
774 initialize_device(p_dev); in handle_rc_disconnect()
792 btif_rc_device_cb_t* p_dev = in handle_rc_passthrough_cmd() local
794 if (p_dev == NULL) { in handle_rc_passthrough_cmd()
810 p_dev->rc_pending_play = true; in handle_rc_passthrough_cmd()
816 if ((p_remote_cmd->rc_id == AVRC_ID_PAUSE) && (p_dev->rc_pending_play)) { in handle_rc_passthrough_cmd()
819 p_dev->rc_pending_play = false; in handle_rc_passthrough_cmd()
833 p_dev->rc_features, p_remote_cmd->rc_id, pressed); in handle_rc_passthrough_cmd()
835 p_dev->rc_addr); in handle_rc_passthrough_cmd()
847 btif_rc_device_cb_t* p_dev = NULL; in handle_rc_passthrough_rsp() local
849 p_dev = btif_rc_get_device_by_handle(p_remote_rsp->rc_handle); in handle_rc_passthrough_rsp()
850 if (p_dev == NULL) { in handle_rc_passthrough_rsp()
857 if (!(p_dev->rc_features & BTA_AV_FEAT_RCTG)) { in handle_rc_passthrough_rsp()
867 release_transaction(p_dev, p_remote_rsp->label); in handle_rc_passthrough_rsp()
871 base::Bind(bt_rc_ctrl_callbacks->passthrough_rsp_cb, p_dev->rc_addr, in handle_rc_passthrough_rsp()
885 btif_rc_device_cb_t* p_dev = NULL; in handle_rc_vendorunique_rsp() local
889 p_dev = btif_rc_get_device_by_handle(p_remote_rsp->rc_handle); in handle_rc_vendorunique_rsp()
890 if (p_dev == NULL) { in handle_rc_vendorunique_rsp()
896 if (p_dev->rc_features & BTA_AV_FEAT_RCTG) { in handle_rc_vendorunique_rsp()
914 release_transaction(p_dev, p_remote_rsp->label); in handle_rc_vendorunique_rsp()
937 btif_rc_device_cb_t* p_dev = NULL; in handle_rc_metamsg_cmd() local
952 p_dev = btif_rc_get_device_by_handle(pmeta_msg->rc_handle); in handle_rc_metamsg_cmd()
953 if (p_dev == NULL) { in handle_rc_metamsg_cmd()
973 transaction = get_transaction_by_lbl(p_dev, pmeta_msg->label); in handle_rc_metamsg_cmd()
975 handle_rc_metamsg_rsp(pmeta_msg, p_dev); in handle_rc_metamsg_cmd()
1010 p_dev->rc_notif[event_id - 1].bNotify = true; in handle_rc_metamsg_cmd()
1011 p_dev->rc_notif[event_id - 1].label = pmeta_msg->label; in handle_rc_metamsg_cmd()
1021 pmeta_msg->code, pmeta_msg->label, p_dev); in handle_rc_metamsg_cmd()
1034 btif_rc_device_cb_t* p_dev = NULL; in btif_rc_handler() local
1083 p_dev = btif_rc_get_device_by_handle(p_data->rc_feat.rc_handle); in btif_rc_handler()
1084 if (p_dev == NULL) { in btif_rc_handler()
1090 p_dev->rc_features = p_data->rc_feat.peer_features; in btif_rc_handler()
1092 handle_rc_features(p_dev); in btif_rc_handler()
1095 if ((p_dev->rc_connected) && (bt_rc_ctrl_callbacks != NULL)) { in btif_rc_handler()
1096 handle_rc_ctrl_features(p_dev); in btif_rc_handler()
1103 p_dev = btif_rc_get_device_by_handle(p_data->rc_cover_art_psm.rc_handle); in btif_rc_handler()
1104 if (p_dev == NULL) { in btif_rc_handler()
1110 p_dev->rc_cover_art_psm = p_data->rc_cover_art_psm.cover_art_psm; in btif_rc_handler()
1111 if ((p_dev->rc_connected) && (bt_rc_ctrl_callbacks != NULL)) { in btif_rc_handler()
1112 handle_rc_ctrl_psm(p_dev); in btif_rc_handler()
1170 btif_rc_device_cb_t* p_dev = get_connected_device(idx); in btif_rc_is_connected_peer() local
1171 if (p_dev != NULL && (p_dev->rc_connected == TRUE) && in btif_rc_is_connected_peer()
1172 peer_addr == p_dev->rc_addr) { in btif_rc_is_connected_peer()
1187 btif_rc_device_cb_t* p_dev = NULL; in btif_rc_get_connected_peer_handle() local
1188 p_dev = btif_rc_get_device_by_bda(peer_addr); in btif_rc_get_connected_peer_handle()
1190 if (p_dev == NULL) { in btif_rc_get_connected_peer_handle()
1194 return p_dev->rc_handle; in btif_rc_get_connected_peer_handle()
1209 btif_rc_device_cb_t* p_dev = NULL; in btif_rc_check_handle_pending_play() local
1210 p_dev = btif_rc_get_device_by_bda(peer_addr); in btif_rc_check_handle_pending_play()
1212 if (p_dev == NULL) { in btif_rc_check_handle_pending_play()
1218 if (p_dev->rc_pending_play) { in btif_rc_check_handle_pending_play()
1224 remote_cmd.rc_handle = p_dev->rc_handle; in btif_rc_check_handle_pending_play()
1243 p_dev->rc_pending_play = false; in btif_rc_check_handle_pending_play()
1309 static void send_metamsg_rsp(btif_rc_device_cb_t* p_dev, int index, in send_metamsg_rsp() argument
1314 if (p_dev == NULL) { in send_metamsg_rsp()
1327 __func__, p_dev->rc_handle, index, label, code, in send_metamsg_rsp()
1330 if (index >= 0 && !p_dev->rc_pdu_info[index].is_rsp_pending) { in send_metamsg_rsp()
1344 (p_dev->rc_connected) && (p_dev->rc_notif[event_id - 1].bNotify); in send_metamsg_rsp()
1347 p_dev->rc_notif[event_id - 1].bNotify = false; in send_metamsg_rsp()
1349 __func__, p_dev->rc_handle, event_id, bNotify); in send_metamsg_rsp()
1355 p_dev->rc_handle, pmetamsg_resp, &p_msg))) { in send_metamsg_rsp()
1358 __func__, p_dev->rc_handle, event_id); in send_metamsg_rsp()
1360 BTA_AvMetaRsp(p_dev->rc_handle, p_dev->rc_notif[event_id - 1].label, in send_metamsg_rsp()
1381 status = AVRC_BldResponse(p_dev->rc_handle, pmetamsg_resp, &p_msg); in send_metamsg_rsp()
1384 BTA_AvMetaRsp(p_dev->rc_handle, label, ctype, p_msg); in send_metamsg_rsp()
1392 p_dev->rc_pdu_info[index].ctype = 0; in send_metamsg_rsp()
1393 p_dev->rc_pdu_info[index].label = 0; in send_metamsg_rsp()
1394 p_dev->rc_pdu_info[index].is_rsp_pending = false; in send_metamsg_rsp()
1495 btif_rc_device_cb_t* p_dev) { in btif_rc_upstreams_evt() argument
1497 __func__, dump_rc_pdu(pavrc_cmd->pdu), p_dev->rc_handle, in btif_rc_upstreams_evt()
1502 fill_pdu_queue(IDX_GET_PLAY_STATUS_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1503 HAL_CBACK(bt_rc_callbacks, get_play_status_cb, p_dev->rc_addr); in btif_rc_upstreams_evt()
1512 send_reject_response(p_dev->rc_handle, label, pavrc_cmd->pdu, in btif_rc_upstreams_evt()
1524 send_reject_response(p_dev->rc_handle, label, pavrc_cmd->pdu, in btif_rc_upstreams_evt()
1528 fill_pdu_queue(IDX_GET_ELEMENT_ATTR_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1530 p_dev->rc_addr); in btif_rc_upstreams_evt()
1538 send_reject_response(p_dev->rc_handle, label, pavrc_cmd->pdu, in btif_rc_upstreams_evt()
1541 p_dev->rc_notif[BTRC_EVT_PLAY_POS_CHANGED - 1].bNotify = false; in btif_rc_upstreams_evt()
1546 pavrc_cmd->reg_notif.param, p_dev->rc_addr); in btif_rc_upstreams_evt()
1551 if (p_dev->rc_connected) { in btif_rc_upstreams_evt()
1557 send_metamsg_rsp(p_dev, -1, label, ctype, &avrc_rsp); in btif_rc_upstreams_evt()
1578 send_reject_response(p_dev->rc_handle, label, pavrc_cmd->pdu, in btif_rc_upstreams_evt()
1590 fill_pdu_queue(IDX_GET_FOLDER_ITEMS_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1594 p_dev->rc_addr); in btif_rc_upstreams_evt()
1598 fill_pdu_queue(IDX_SET_ADDR_PLAYER_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1600 pavrc_cmd->addr_player.player_id, p_dev->rc_addr); in btif_rc_upstreams_evt()
1604 fill_pdu_queue(IDX_SET_BROWSED_PLAYER_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1606 pavrc_cmd->br_player.player_id, p_dev->rc_addr); in btif_rc_upstreams_evt()
1613 if (p_dev->rc_connected == TRUE) { in btif_rc_upstreams_evt()
1620 send_metamsg_rsp(p_dev, -1, label, ctype, &avrc_rsp); in btif_rc_upstreams_evt()
1628 if (p_dev->rc_connected == TRUE) { in btif_rc_upstreams_evt()
1635 send_metamsg_rsp(p_dev, -1, label, ctype, &avrc_rsp); in btif_rc_upstreams_evt()
1640 fill_pdu_queue(IDX_CHG_PATH_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1642 pavrc_cmd->chg_path.folder_uid, p_dev->rc_addr); in btif_rc_upstreams_evt()
1646 fill_pdu_queue(IDX_SEARCH_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1649 pavrc_cmd->search.string.p_str, p_dev->rc_addr); in btif_rc_upstreams_evt()
1661 send_reject_response(p_dev->rc_handle, label, pavrc_cmd->pdu, in btif_rc_upstreams_evt()
1665 fill_pdu_queue(IDX_GET_ITEM_ATTR_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1670 num_attr, item_attrs, p_dev->rc_addr); in btif_rc_upstreams_evt()
1674 fill_pdu_queue(IDX_GET_TOTAL_NUM_OF_ITEMS_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1676 pavrc_cmd->get_num_of_items.scope, p_dev->rc_addr); in btif_rc_upstreams_evt()
1680 fill_pdu_queue(IDX_ADD_TO_NOW_PLAYING_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1683 pavrc_cmd->add_to_play.uid_counter, p_dev->rc_addr); in btif_rc_upstreams_evt()
1687 fill_pdu_queue(IDX_PLAY_ITEM_RSP, ctype, label, true, p_dev); in btif_rc_upstreams_evt()
1690 p_dev->rc_addr); in btif_rc_upstreams_evt()
1694 send_reject_response(p_dev->rc_handle, label, pavrc_cmd->pdu, in btif_rc_upstreams_evt()
1713 btif_rc_device_cb_t* p_dev) { in btif_rc_ctrl_upstreams_rsp_cmd() argument
1715 dump_rc_pdu(pavrc_cmd->pdu), p_dev->rc_handle); in btif_rc_ctrl_upstreams_rsp_cmd()
1720 base::Bind(bt_rc_ctrl_callbacks->setabsvol_cmd_cb, p_dev->rc_addr, in btif_rc_ctrl_upstreams_rsp_cmd()
1728 p_dev->rc_addr, label)); in btif_rc_ctrl_upstreams_rsp_cmd()
1746 btif_rc_device_cb_t* p_dev) { in btif_rc_upstreams_rsp_evt() argument
1748 dump_rc_pdu(pavrc_resp->pdu), p_dev->rc_handle, ctype, in btif_rc_upstreams_rsp_evt()
1754 p_dev->rc_volume = pavrc_resp->reg_notif.param.volume; in btif_rc_upstreams_rsp_evt()
1756 pavrc_resp->reg_notif.param.volume, ctype, p_dev->rc_addr); in btif_rc_upstreams_rsp_evt()
1765 p_dev->rc_volume = pavrc_resp->volume.volume; in btif_rc_upstreams_rsp_evt()
1767 ctype, p_dev->rc_addr); in btif_rc_upstreams_rsp_evt()
1825 static void rc_ctrl_procedure_complete(btif_rc_device_cb_t* p_dev) { in rc_ctrl_procedure_complete() argument
1826 if (p_dev == NULL) { in rc_ctrl_procedure_complete()
1831 if (p_dev->rc_procedure_complete) { in rc_ctrl_procedure_complete()
1834 p_dev->rc_procedure_complete = true; in rc_ctrl_procedure_complete()
1835 const uint32_t* attr_list = get_requested_attributes_list(p_dev); in rc_ctrl_procedure_complete()
1836 const uint8_t attr_list_size = get_requested_attributes_list_size(p_dev); in rc_ctrl_procedure_complete()
1837 get_metadata_attribute_cmd(attr_list_size, attr_list, p_dev); in rc_ctrl_procedure_complete()
1855 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in get_play_status_rsp() local
1858 CHECK_RC_CONNECTED(p_dev); in get_play_status_rsp()
1873 send_metamsg_rsp(p_dev, IDX_GET_PLAY_STATUS_RSP, in get_play_status_rsp()
1874 p_dev->rc_pdu_info[IDX_GET_PLAY_STATUS_RSP].label, in get_play_status_rsp()
1875 p_dev->rc_pdu_info[IDX_GET_PLAY_STATUS_RSP].ctype, in get_play_status_rsp()
1897 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in get_element_attr_rsp() local
1900 CHECK_RC_CONNECTED(p_dev); in get_element_attr_rsp()
1933 send_metamsg_rsp(p_dev, IDX_GET_ELEMENT_ATTR_RSP, in get_element_attr_rsp()
1934 p_dev->rc_pdu_info[IDX_GET_ELEMENT_ATTR_RSP].label, in get_element_attr_rsp()
1935 p_dev->rc_pdu_info[IDX_GET_ELEMENT_ATTR_RSP].ctype, in get_element_attr_rsp()
2055 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in get_folder_items_list_rsp() local
2060 CHECK_RC_CONNECTED(p_dev); in get_folder_items_list_rsp()
2063 if (!p_dev->rc_pdu_info[IDX_GET_FOLDER_ITEMS_RSP].is_rsp_pending) { in get_folder_items_list_rsp()
2157 status = AVRC_BldResponse(p_dev->rc_handle, &avrc_rsp, &p_msg); in get_folder_items_list_rsp()
2174 code = p_dev->rc_pdu_info[IDX_GET_FOLDER_ITEMS_RSP].ctype; in get_folder_items_list_rsp()
2176 BTA_AvMetaRsp(p_dev->rc_handle, in get_folder_items_list_rsp()
2177 p_dev->rc_pdu_info[IDX_GET_FOLDER_ITEMS_RSP].label, ctype, in get_folder_items_list_rsp()
2184 p_dev->rc_handle, p_dev->rc_pdu_info[IDX_GET_FOLDER_ITEMS_RSP].label, in get_folder_items_list_rsp()
2189 p_dev->rc_pdu_info[IDX_GET_FOLDER_ITEMS_RSP].ctype = 0; in get_folder_items_list_rsp()
2190 p_dev->rc_pdu_info[IDX_GET_FOLDER_ITEMS_RSP].label = 0; in get_folder_items_list_rsp()
2191 p_dev->rc_pdu_info[IDX_GET_FOLDER_ITEMS_RSP].is_rsp_pending = false; in get_folder_items_list_rsp()
2211 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in set_addressed_player_rsp() local
2214 CHECK_RC_CONNECTED(p_dev); in set_addressed_player_rsp()
2221 send_metamsg_rsp(p_dev, IDX_SET_ADDR_PLAYER_RSP, in set_addressed_player_rsp()
2222 p_dev->rc_pdu_info[IDX_SET_ADDR_PLAYER_RSP].label, in set_addressed_player_rsp()
2223 p_dev->rc_pdu_info[IDX_SET_ADDR_PLAYER_RSP].ctype, in set_addressed_player_rsp()
2259 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in set_browsed_player_rsp() local
2261 CHECK_RC_CONNECTED(p_dev); in set_browsed_player_rsp()
2274 if (!p_dev->rc_pdu_info[IDX_SET_BROWSED_PLAYER_RSP].is_rsp_pending) { in set_browsed_player_rsp()
2300 status = AVRC_BldResponse(p_dev->rc_handle, &avrc_rsp, &p_msg); in set_browsed_player_rsp()
2315 status = AVRC_BldResponse(p_dev->rc_handle, &avrc_rsp, &p_msg); in set_browsed_player_rsp()
2330 code = p_dev->rc_pdu_info[IDX_SET_BROWSED_PLAYER_RSP].ctype; in set_browsed_player_rsp()
2332 BTA_AvMetaRsp(p_dev->rc_handle, in set_browsed_player_rsp()
2333 p_dev->rc_pdu_info[IDX_SET_BROWSED_PLAYER_RSP].label, ctype, in set_browsed_player_rsp()
2340 p_dev->rc_handle, p_dev->rc_pdu_info[IDX_SET_BROWSED_PLAYER_RSP].label, in set_browsed_player_rsp()
2345 p_dev->rc_pdu_info[IDX_SET_BROWSED_PLAYER_RSP].ctype = 0; in set_browsed_player_rsp()
2346 p_dev->rc_pdu_info[IDX_SET_BROWSED_PLAYER_RSP].label = 0; in set_browsed_player_rsp()
2347 p_dev->rc_pdu_info[IDX_SET_BROWSED_PLAYER_RSP].is_rsp_pending = false; in set_browsed_player_rsp()
2368 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in change_path_rsp() local
2371 CHECK_RC_CONNECTED(p_dev); in change_path_rsp()
2379 send_metamsg_rsp(p_dev, IDX_CHG_PATH_RSP, in change_path_rsp()
2380 p_dev->rc_pdu_info[IDX_CHG_PATH_RSP].label, in change_path_rsp()
2381 p_dev->rc_pdu_info[IDX_CHG_PATH_RSP].ctype, &avrc_rsp); in change_path_rsp()
2401 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in search_rsp() local
2404 CHECK_RC_CONNECTED(p_dev); in search_rsp()
2413 send_metamsg_rsp(p_dev, IDX_SEARCH_RSP, in search_rsp()
2414 p_dev->rc_pdu_info[IDX_SEARCH_RSP].label, in search_rsp()
2415 p_dev->rc_pdu_info[IDX_SEARCH_RSP].ctype, &avrc_rsp); in search_rsp()
2436 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in get_item_attr_rsp() local
2439 CHECK_RC_CONNECTED(p_dev); in get_item_attr_rsp()
2454 send_metamsg_rsp(p_dev, IDX_GET_ITEM_ATTR_RSP, in get_item_attr_rsp()
2455 p_dev->rc_pdu_info[IDX_GET_ITEM_ATTR_RSP].label, in get_item_attr_rsp()
2456 p_dev->rc_pdu_info[IDX_GET_ITEM_ATTR_RSP].ctype, &avrc_rsp); in get_item_attr_rsp()
2476 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in add_to_now_playing_rsp() local
2479 CHECK_RC_CONNECTED(p_dev); in add_to_now_playing_rsp()
2486 send_metamsg_rsp(p_dev, IDX_ADD_TO_NOW_PLAYING_RSP, in add_to_now_playing_rsp()
2487 p_dev->rc_pdu_info[IDX_ADD_TO_NOW_PLAYING_RSP].label, in add_to_now_playing_rsp()
2488 p_dev->rc_pdu_info[IDX_ADD_TO_NOW_PLAYING_RSP].ctype, in add_to_now_playing_rsp()
2508 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in play_item_rsp() local
2511 CHECK_RC_CONNECTED(p_dev); in play_item_rsp()
2518 send_metamsg_rsp(p_dev, IDX_PLAY_ITEM_RSP, in play_item_rsp()
2519 p_dev->rc_pdu_info[IDX_PLAY_ITEM_RSP].label, in play_item_rsp()
2520 p_dev->rc_pdu_info[IDX_PLAY_ITEM_RSP].ctype, &avrc_rsp); in play_item_rsp()
2542 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in get_total_num_of_items_rsp() local
2545 CHECK_RC_CONNECTED(p_dev); in get_total_num_of_items_rsp()
2555 send_metamsg_rsp(p_dev, IDX_GET_TOTAL_NUM_OF_ITEMS_RSP, in get_total_num_of_items_rsp()
2556 p_dev->rc_pdu_info[IDX_GET_TOTAL_NUM_OF_ITEMS_RSP].label, in get_total_num_of_items_rsp()
2557 p_dev->rc_pdu_info[IDX_GET_TOTAL_NUM_OF_ITEMS_RSP].ctype, in get_total_num_of_items_rsp()
2582 btif_rc_device_cb_t* p_dev = &btif_rc_cb.rc_multi_cb[idx]; in set_volume() local
2583 if (!p_dev->rc_connected) continue; in set_volume()
2585 if (p_dev->rc_volume == volume) { in set_volume()
2592 if ((p_dev->rc_volume == volume) || in set_volume()
2593 p_dev->rc_state != in set_volume()
2598 if ((p_dev->rc_features & BTA_AV_FEAT_RCTG) == 0) { in set_volume()
2603 if (!(p_dev->rc_features & BTA_AV_FEAT_ADV_CTRL)) in set_volume()
2624 bt_status_t tran_status = get_transaction(p_dev, &p_transaction); in set_volume()
2637 BTA_AvMetaCmd(p_dev->rc_handle, p_transaction->lbl, AVRC_CMD_CTRL, p_msg); in set_volume()
2653 static void register_volumechange(uint8_t lbl, btif_rc_device_cb_t* p_dev) { in register_volumechange() argument
2669 p_transaction = get_transaction_by_lbl(p_dev, lbl); in register_volumechange()
2671 BTA_AvMetaCmd(p_dev->rc_handle, p_transaction->lbl, AVRC_CMD_NOTIF, in register_volumechange()
2694 btif_rc_device_cb_t* p_dev) { in handle_rc_metamsg_rsp() argument
2716 p_dev->rc_vol_label == pmeta_msg->label) { in handle_rc_metamsg_rsp()
2717 p_dev->rc_vol_label = MAX_LABEL; in handle_rc_metamsg_rsp()
2718 release_transaction(p_dev, p_dev->rc_vol_label); in handle_rc_metamsg_rsp()
2720 release_transaction(p_dev, pmeta_msg->label); in handle_rc_metamsg_rsp()
2727 p_dev->rc_vol_label != pmeta_msg->label) { in handle_rc_metamsg_rsp()
2741 p_dev->rc_features &= ~BTA_AV_FEAT_ADV_CTRL; in handle_rc_metamsg_rsp()
2742 handle_rc_features(p_dev); in handle_rc_metamsg_rsp()
2758 register_volumechange(p_dev->rc_vol_label, p_dev); in handle_rc_metamsg_rsp()
2761 release_transaction(p_dev, pmeta_msg->label); in handle_rc_metamsg_rsp()
2767 pmeta_msg->code, pmeta_msg->label, p_dev); in handle_rc_metamsg_rsp()
2807 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(cntxt->rc_addr); in iterate_supported_event_list_for_timeout() local
2811 list_remove(p_dev->rc_supported_event_list, p_event); in iterate_supported_event_list_for_timeout()
2828 btif_rc_device_cb_t* p_dev) { in rc_notification_interim_timout() argument
2830 if (p_dev == NULL || p_dev->rc_supported_event_list) { in rc_notification_interim_timout()
2839 cntxt.rc_addr = p_dev->rc_addr; in rc_notification_interim_timout()
2841 list_foreach(p_dev->rc_supported_event_list, in rc_notification_interim_timout()
2846 node = list_begin(p_dev->rc_supported_event_list); in rc_notification_interim_timout()
2852 register_for_event_notification(p_event, p_dev); in rc_notification_interim_timout()
2875 btif_rc_device_cb_t* p_dev = NULL; in btif_rc_status_cmd_timeout_handler() local
2879 p_dev = btif_rc_get_device_by_bda(p_context->rc_addr); in btif_rc_status_cmd_timeout_handler()
2880 if (p_dev == NULL) { in btif_rc_status_cmd_timeout_handler()
2884 meta_msg.rc_handle = p_dev->rc_handle; in btif_rc_status_cmd_timeout_handler()
2888 rc_notification_interim_timout(p_context->rc_status_cmd.label, p_dev); in btif_rc_status_cmd_timeout_handler()
2931 release_transaction(p_dev, p_context->rc_status_cmd.label); in btif_rc_status_cmd_timeout_handler()
2964 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(p_context->rc_addr); in btif_rc_control_cmd_timeout_handler() local
2965 if (p_dev == NULL) { in btif_rc_control_cmd_timeout_handler()
2971 meta_msg.rc_handle = p_dev->rc_handle; in btif_rc_control_cmd_timeout_handler()
2979 release_transaction(p_dev, p_context->rc_control_cmd.label); in btif_rc_control_cmd_timeout_handler()
3010 btif_rc_device_cb_t* p_dev) { in register_for_event_notification() argument
3012 bt_status_t status = get_transaction(p_dev, &p_transaction); in register_for_event_notification()
3023 interval_in_seconds, p_dev); in register_for_event_notification()
3027 release_transaction(p_dev, p_transaction->lbl); in register_for_event_notification()
3036 p_context->rc_addr = p_dev->rc_addr; in register_for_event_notification()
3045 btif_rc_device_cb_t* p_dev) { in start_status_command_timer() argument
3049 p_context->rc_addr = p_dev->rc_addr; in start_status_command_timer()
3058 btif_rc_device_cb_t* p_dev) { in start_control_command_timer() argument
3062 p_context->rc_addr = p_dev->rc_addr; in start_control_command_timer()
3072 btif_rc_device_cb_t* p_dev) { in build_and_send_vendor_cmd() argument
3074 bt_status_t tran_status = get_transaction(p_dev, &p_transaction); in build_and_send_vendor_cmd()
3083 BTA_AvVendorCmd(p_dev->rc_handle, p_transaction->lbl, cmd_code, data_start, in build_and_send_vendor_cmd()
3087 start_status_command_timer(avrc_cmd->pdu, p_transaction, p_dev); in build_and_send_vendor_cmd()
3089 start_control_command_timer(avrc_cmd->pdu, p_transaction, p_dev); in build_and_send_vendor_cmd()
3113 btif_rc_device_cb_t* p_dev) { in build_and_send_browsing_cmd() argument
3122 bt_status_t tran_status = get_transaction(p_dev, &p_transaction); in build_and_send_browsing_cmd()
3133 BTA_AvMetaCmd(p_dev->rc_handle, p_transaction->lbl, AVRC_CMD_CTRL, p_msg); in build_and_send_browsing_cmd()
3150 btif_rc_device_cb_t* p_dev = in handle_get_capability_response() local
3164 p_dev->rc_supported_event_list = list_new(osi_free); in handle_get_capability_response()
3179 list_append(p_dev->rc_supported_event_list, p_event); in handle_get_capability_response()
3187 if (list_is_empty(p_dev->rc_supported_event_list)) { in handle_get_capability_response()
3192 (btif_rc_supported_event_t*)list_front(p_dev->rc_supported_event_list); in handle_get_capability_response()
3194 register_for_event_notification(p_event, p_dev); in handle_get_capability_response()
3197 getcapabilities_cmd(AVRC_CAP_EVENTS_SUPPORTED, p_dev); in handle_get_capability_response()
3237 btif_rc_device_cb_t* p_dev = in handle_notification_response() local
3240 if (p_dev == NULL) { in handle_notification_response()
3245 const uint32_t* attr_list = get_requested_attributes_list(p_dev); in handle_notification_response()
3246 const uint8_t attr_list_size = get_requested_attributes_list_size(p_dev); in handle_notification_response()
3255 get_play_status_cmd(p_dev); in handle_notification_response()
3259 p_dev->rc_addr, in handle_notification_response()
3268 BE_STREAM_TO_UINT64(p_dev->rc_playing_uid, p_data); in handle_notification_response()
3269 get_play_status_cmd(p_dev); in handle_notification_response()
3271 p_dev); in handle_notification_response()
3282 p_dev->rc_addr)); in handle_notification_response()
3290 p_dev->rc_addr)); in handle_notification_response()
3297 p_dev->rc_addr, p_rsp->param.addr_player.player_id)); in handle_notification_response()
3301 …jni_thread(FROM_HERE, base::Bind(bt_rc_ctrl_callbacks->play_position_changed_cb, p_dev->rc_addr, 0, in handle_notification_response()
3318 list_foreach(p_dev->rc_supported_event_list, in handle_notification_response()
3322 node = list_begin(p_dev->rc_supported_event_list); in handle_notification_response()
3327 register_for_event_notification(p_event, p_dev); in handle_notification_response()
3334 if (p_event == NULL && !p_dev->rc_app_settings.query_started) { in handle_notification_response()
3338 p_dev->rc_app_settings.query_started = true; in handle_notification_response()
3339 if (p_dev->rc_features & BTA_AV_FEAT_APP_SETTING) { in handle_notification_response()
3340 list_player_app_setting_attrib_cmd(p_dev); in handle_notification_response()
3344 rc_ctrl_procedure_complete(p_dev); in handle_notification_response()
3354 node = list_begin(p_dev->rc_supported_event_list); in handle_notification_response()
3360 register_for_event_notification(p_event, p_dev); in handle_notification_response()
3374 p_dev->rc_addr, in handle_notification_response()
3383 get_metadata_attribute_cmd(attr_list_size, attr_list, p_dev); in handle_notification_response()
3400 p_dev->rc_addr, app_settings)); in handle_notification_response()
3443 btif_rc_device_cb_t* p_dev = in handle_app_attr_response() local
3446 if (p_dev == NULL || p_rsp->status != AVRC_STS_NO_ERROR) { in handle_app_attr_response()
3449 rc_ctrl_procedure_complete(p_dev); in handle_app_attr_response()
3452 p_dev->rc_app_settings.num_attrs = 0; in handle_app_attr_response()
3453 p_dev->rc_app_settings.num_ext_attrs = 0; in handle_app_attr_response()
3459 st_index = p_dev->rc_app_settings.num_ext_attrs; in handle_app_attr_response()
3460 p_dev->rc_app_settings.ext_attrs[st_index].attr_id = p_rsp->attrs[xx]; in handle_app_attr_response()
3461 p_dev->rc_app_settings.num_ext_attrs++; in handle_app_attr_response()
3463 st_index = p_dev->rc_app_settings.num_attrs; in handle_app_attr_response()
3464 p_dev->rc_app_settings.attrs[st_index].attr_id = p_rsp->attrs[xx]; in handle_app_attr_response()
3465 p_dev->rc_app_settings.num_attrs++; in handle_app_attr_response()
3468 p_dev->rc_app_settings.attr_index = 0; in handle_app_attr_response()
3469 p_dev->rc_app_settings.ext_attr_index = 0; in handle_app_attr_response()
3470 p_dev->rc_app_settings.ext_val_index = 0; in handle_app_attr_response()
3472 list_player_app_setting_value_cmd(p_dev->rc_app_settings.attrs[0].attr_id, in handle_app_attr_response()
3473 p_dev); in handle_app_attr_response()
3496 btif_rc_device_cb_t* p_dev = in handle_app_val_response() local
3500 if (p_dev == NULL || p_rsp->status != AVRC_STS_NO_ERROR) { in handle_app_val_response()
3506 p_app_settings = &p_dev->rc_app_settings; in handle_app_val_response()
3518 p_app_settings->attrs[p_app_settings->attr_index].attr_id, p_dev); in handle_app_val_response()
3523 p_app_settings->ext_attrs[attr_index].attr_id, p_dev); in handle_app_val_response()
3528 get_player_app_setting_cmd(p_app_settings->num_attrs, attrs, p_dev); in handle_app_val_response()
3532 p_dev->rc_addr, p_app_settings->num_attrs, in handle_app_val_response()
3547 p_dev); in handle_app_val_response()
3555 p_dev); in handle_app_val_response()
3573 btif_rc_device_cb_t* p_dev = NULL; in handle_app_cur_val_response() local
3581 p_dev = btif_rc_get_device_by_handle(pmeta_msg->rc_handle); in handle_app_cur_val_response()
3582 if (p_dev == NULL) { in handle_app_cur_val_response()
3604 p_dev->rc_addr, app_settings)); in handle_app_cur_val_response()
3609 rc_ctrl_procedure_complete(p_dev); in handle_app_cur_val_response()
3629 btif_rc_device_cb_t* p_dev = in handle_app_attr_txt_response() local
3632 if (p_dev == NULL) { in handle_app_attr_txt_response()
3637 p_app_settings = &p_dev->rc_app_settings; in handle_app_attr_txt_response()
3655 if (p_dev) { in handle_app_attr_txt_response()
3663 p_dev->rc_addr, p_app_settings->num_attrs, in handle_app_attr_txt_response()
3665 get_player_app_setting_cmd(xx, attrs, p_dev); in handle_app_attr_txt_response()
3685 get_player_app_setting_value_text_cmd(vals, xx, p_dev); in handle_app_attr_txt_response()
3704 btif_rc_device_cb_t* p_dev = in handle_app_attr_val_txt_response() local
3707 if (p_dev == NULL) { in handle_app_attr_val_txt_response()
3712 p_app_settings = &p_dev->rc_app_settings; in handle_app_attr_val_txt_response()
3742 p_dev->rc_addr, p_app_settings->num_attrs, in handle_app_attr_val_txt_response()
3745 get_player_app_setting_cmd(xx, attrs, p_dev); in handle_app_attr_val_txt_response()
3769 get_player_app_setting_value_text_cmd(vals, xx, p_dev); in handle_app_attr_val_txt_response()
3782 p_dev->rc_addr, p_app_settings->num_attrs, in handle_app_attr_val_txt_response()
3785 get_player_app_setting_cmd(xx + x, attrs, p_dev); in handle_app_attr_val_txt_response()
3829 btif_rc_device_cb_t* p_dev = in handle_set_app_attr_val_response() local
3832 if (p_dev == NULL) { in handle_set_app_attr_val_response()
3846 p_dev->rc_addr, accepted)); in handle_set_app_attr_val_response()
3860 btif_rc_device_cb_t* p_dev = in handle_get_metadata_attr_response() local
3868 if (p_dev == NULL) { in handle_get_metadata_attr_response()
3885 p_dev->rc_addr, p_rsp->num_attrs, p_attr)); in handle_get_metadata_attr_response()
3891 const uint32_t* attr_list = get_requested_attributes_list(p_dev); in handle_get_metadata_attr_response()
3892 const uint8_t attr_list_size = get_requested_attributes_list_size(p_dev); in handle_get_metadata_attr_response()
3893 get_metadata_attribute_cmd(attr_list_size, attr_list, p_dev); in handle_get_metadata_attr_response()
3912 btif_rc_device_cb_t* p_dev = in handle_get_playstatus_response() local
3915 if (p_dev == NULL) { in handle_get_playstatus_response()
3924 base::Bind(bt_rc_ctrl_callbacks->play_status_changed_cb, p_dev->rc_addr, in handle_get_playstatus_response()
3929 p_dev->rc_addr, p_rsp->song_len, p_rsp->song_pos)); in handle_get_playstatus_response()
3948 btif_rc_device_cb_t* p_dev = in handle_set_addressed_player_response() local
3951 if (p_dev == NULL) { in handle_set_addressed_player_response()
3960 p_dev->rc_addr, p_rsp->status)); in handle_set_addressed_player_response()
3978 btif_rc_device_cb_t* p_dev = in handle_get_folder_items_response() local
4021 base::Bind(bt_rc_ctrl_callbacks->get_folder_items_cb, p_dev->rc_addr, in handle_get_folder_items_response()
4028 (p_dev->rc_features & BTA_AV_FEAT_APP_SETTING)) { in handle_get_folder_items_response()
4029 list_player_app_setting_attrib_cmd(p_dev); in handle_get_folder_items_response()
4043 base::Bind(bt_rc_ctrl_callbacks->get_folder_items_cb, p_dev->rc_addr, in handle_get_folder_items_response()
4258 btif_rc_device_cb_t* p_dev = in handle_change_path_response() local
4261 if (p_dev == NULL) { in handle_change_path_response()
4269 p_dev->rc_addr, p_rsp->num_items)); in handle_change_path_response()
4287 btif_rc_device_cb_t* p_dev = in handle_set_browsed_player_response() local
4290 if (p_dev == NULL) { in handle_set_browsed_player_response()
4298 base::Bind(bt_rc_ctrl_callbacks->set_browsed_player_cb, p_dev->rc_addr, in handle_set_browsed_player_response()
4313 static void clear_cmd_timeout(btif_rc_device_cb_t* p_dev, uint8_t label) { in clear_cmd_timeout() argument
4316 p_txn = get_transaction_by_lbl(p_dev, label); in clear_cmd_timeout()
4339 btif_rc_device_cb_t* p_dev = NULL; in handle_avk_rc_metamsg_rsp() local
4344 p_dev = btif_rc_get_device_by_handle(pmeta_msg->rc_handle); in handle_avk_rc_metamsg_rsp()
4359 clear_cmd_timeout(p_dev, pmeta_msg->label); in handle_avk_rc_metamsg_rsp()
4434 release_transaction(p_dev, pmeta_msg->label); in handle_avk_rc_metamsg_rsp()
4449 btif_rc_device_cb_t* p_dev = NULL; in handle_avk_rc_metamsg_cmd() local
4467 p_dev = btif_rc_get_device_by_handle(pmeta_msg->rc_handle); in handle_avk_rc_metamsg_cmd()
4468 if (p_dev == NULL) { in handle_avk_rc_metamsg_cmd()
4483 p_dev); in handle_avk_rc_metamsg_cmd()
4553 btif_rc_device_cb_t* p_dev) { in getcapabilities_cmd() argument
4555 CHECK_RC_CONNECTED(p_dev); in getcapabilities_cmd()
4563 return build_and_send_vendor_cmd(&avrc_cmd, AVRC_CMD_STATUS, p_dev); in getcapabilities_cmd()
4576 btif_rc_device_cb_t* p_dev) { in list_player_app_setting_attrib_cmd() argument
4578 CHECK_RC_CONNECTED(p_dev); in list_player_app_setting_attrib_cmd()
4585 return build_and_send_vendor_cmd(&avrc_cmd, AVRC_CMD_STATUS, p_dev); in list_player_app_setting_attrib_cmd()
4598 uint8_t attrib_id, btif_rc_device_cb_t* p_dev) { in list_player_app_setting_value_cmd() argument
4600 CHECK_RC_CONNECTED(p_dev); in list_player_app_setting_value_cmd()
4608 return build_and_send_vendor_cmd(&avrc_cmd, AVRC_CMD_STATUS, p_dev); in list_player_app_setting_value_cmd()
4622 btif_rc_device_cb_t* p_dev) { in get_player_app_setting_cmd() argument
4624 CHECK_RC_CONNECTED(p_dev); in get_player_app_setting_cmd()
4636 return build_and_send_vendor_cmd(&avrc_cmd, AVRC_CMD_STATUS, p_dev); in get_player_app_setting_cmd()
4651 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in get_current_metadata_cmd() local
4652 if (p_dev == NULL) { in get_current_metadata_cmd()
4656 const uint32_t* attr_list = get_requested_attributes_list(p_dev); in get_current_metadata_cmd()
4657 const uint8_t attr_list_size = get_requested_attributes_list_size(p_dev); in get_current_metadata_cmd()
4658 return get_metadata_attribute_cmd(attr_list_size, attr_list, p_dev); in get_current_metadata_cmd()
4673 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in get_playback_state_cmd() local
4674 return get_play_status_cmd(p_dev); in get_playback_state_cmd()
4716 btif_rc_device_cb_t* p_dev) { in get_item_attribute_cmd() argument
4724 return build_and_send_browsing_cmd(&avrc_cmd, p_dev); in get_item_attribute_cmd()
4785 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in change_folder_path_cmd() local
4786 CHECK_RC_CONNECTED(p_dev); in change_folder_path_cmd()
4787 CHECK_BR_CONNECTED(p_dev); in change_folder_path_cmd()
4800 return build_and_send_browsing_cmd(&avrc_cmd, p_dev); in change_folder_path_cmd()
4818 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in set_browsed_player_cmd() local
4819 CHECK_RC_CONNECTED(p_dev); in set_browsed_player_cmd()
4820 CHECK_BR_CONNECTED(p_dev); in set_browsed_player_cmd()
4828 return build_and_send_browsing_cmd(&avrc_cmd, p_dev); in set_browsed_player_cmd()
4847 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in set_addressed_player_cmd() local
4848 CHECK_RC_CONNECTED(p_dev); in set_addressed_player_cmd()
4849 CHECK_BR_CONNECTED(p_dev); in set_addressed_player_cmd()
4857 return build_and_send_browsing_cmd(&avrc_cmd, p_dev); in set_addressed_player_cmd()
4880 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in get_folder_items_cmd() local
4882 CHECK_RC_CONNECTED(p_dev); in get_folder_items_cmd()
4883 CHECK_BR_CONNECTED(p_dev); in get_folder_items_cmd()
4897 return build_and_send_browsing_cmd(&avrc_cmd, p_dev); in get_folder_items_cmd()
4914 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in change_player_app_setting() local
4915 CHECK_RC_CONNECTED(p_dev); in change_player_app_setting()
4929 bt_status_t st = build_and_send_vendor_cmd(&avrc_cmd, AVRC_CMD_CTRL, p_dev); in change_player_app_setting()
4946 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in play_item_cmd() local
4947 CHECK_RC_CONNECTED(p_dev); in play_item_cmd()
4948 CHECK_BR_CONNECTED(p_dev); in play_item_cmd()
4958 return build_and_send_vendor_cmd(&avrc_cmd, AVRC_CMD_CTRL, p_dev); in play_item_cmd()
4971 uint8_t* attrs, uint8_t num_attrs, btif_rc_device_cb_t* p_dev) { in get_player_app_setting_attr_text_cmd() argument
4973 CHECK_RC_CONNECTED(p_dev); in get_player_app_setting_attr_text_cmd()
4984 return build_and_send_vendor_cmd(&avrc_cmd, AVRC_CMD_STATUS, p_dev); in get_player_app_setting_attr_text_cmd()
4997 uint8_t* vals, uint8_t num_vals, btif_rc_device_cb_t* p_dev) { in get_player_app_setting_value_text_cmd() argument
4999 CHECK_RC_CONNECTED(p_dev); in get_player_app_setting_value_text_cmd()
5010 return build_and_send_vendor_cmd(&avrc_cmd, AVRC_CMD_STATUS, p_dev); in get_player_app_setting_value_text_cmd()
5024 btif_rc_device_cb_t* p_dev) { in register_notification_cmd() argument
5027 CHECK_RC_CONNECTED(p_dev); in register_notification_cmd()
5043 BTA_AvVendorCmd(p_dev->rc_handle, label, AVRC_CMD_NOTIF, data_start, in register_notification_cmd()
5069 btif_rc_device_cb_t* p_dev) { in get_metadata_attribute_cmd() argument
5074 if (p_dev->br_connected) { in get_metadata_attribute_cmd()
5075 return get_item_attribute_cmd(p_dev->rc_playing_uid, in get_metadata_attribute_cmd()
5077 p_attr_ids, p_dev); in get_metadata_attribute_cmd()
5081 return get_element_attribute_cmd(num_attribute, p_attr_ids, p_dev); in get_metadata_attribute_cmd()
5095 btif_rc_device_cb_t* p_dev) { in get_element_attribute_cmd() argument
5098 CHECK_RC_CONNECTED(p_dev); in get_element_attribute_cmd()
5108 return build_and_send_vendor_cmd(&avrc_cmd, AVRC_CMD_STATUS, p_dev); in get_element_attribute_cmd()
5120 static bt_status_t get_play_status_cmd(btif_rc_device_cb_t* p_dev) { in get_play_status_cmd() argument
5122 CHECK_RC_CONNECTED(p_dev); in get_play_status_cmd()
5129 return build_and_send_vendor_cmd(&avrc_cmd, AVRC_CMD_STATUS, p_dev); in get_play_status_cmd()
5146 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in set_volume_rsp() local
5148 CHECK_RC_CONNECTED(p_dev); in set_volume_rsp()
5156 status = AVRC_BldResponse(p_dev->rc_handle, &avrc_rsp, &p_msg); in set_volume_rsp()
5160 p_dev->rc_vol_label); in set_volume_rsp()
5162 BTA_AvVendorRsp(p_dev->rc_handle, label, AVRC_RSP_ACCEPT, data_start, in set_volume_rsp()
5191 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in volume_change_notification_rsp() local
5193 CHECK_RC_CONNECTED(p_dev); in volume_change_notification_rsp()
5201 status = AVRC_BldResponse(p_dev->rc_handle, &avrc_rsp, &p_msg); in volume_change_notification_rsp()
5206 BTA_AvVendorRsp(p_dev->rc_handle, label, in volume_change_notification_rsp()
5237 btif_rc_device_cb_t* p_dev = btif_rc_get_device_by_bda(bd_addr); in send_groupnavigation_cmd() local
5239 CHECK_RC_CONNECTED(p_dev); in send_groupnavigation_cmd()
5241 if (p_dev->rc_features & BTA_AV_FEAT_RCTG) { in send_groupnavigation_cmd()
5242 bt_status_t tran_status = get_transaction(p_dev, &p_transaction); in send_groupnavigation_cmd()
5249 BTA_AvRemoteVendorUniqueCmd(p_dev->rc_handle, p_transaction->lbl, in send_groupnavigation_cmd()
5278 btif_rc_device_cb_t* p_dev = NULL; in send_passthrough_cmd() local
5280 p_dev = btif_rc_get_device_by_bda(bd_addr); in send_passthrough_cmd()
5282 CHECK_RC_CONNECTED(p_dev); in send_passthrough_cmd()
5287 if (p_dev->rc_features & BTA_AV_FEAT_RCTG) { in send_passthrough_cmd()
5288 bt_status_t tran_status = get_transaction(p_dev, &p_transaction); in send_passthrough_cmd()
5290 BTA_AvRemoteCmd(p_dev->rc_handle, p_transaction->lbl, in send_passthrough_cmd()
5386 static void initialize_transaction(btif_rc_device_cb_t* p_dev, int lbl) { in initialize_transaction() argument
5387 if (p_dev == nullptr) return; in initialize_transaction()
5388 rc_transaction_set_t* transaction_set = &(p_dev->transaction_set); in initialize_transaction()
5392 clear_cmd_timeout(p_dev, lbl); in initialize_transaction()
5408 void init_all_transactions(btif_rc_device_cb_t* p_dev) { in init_all_transactions() argument
5409 if (p_dev == nullptr) return; in init_all_transactions()
5411 initialize_transaction(p_dev, i); in init_all_transactions()
5424 rc_transaction_t* get_transaction_by_lbl(btif_rc_device_cb_t* p_dev, in get_transaction_by_lbl() argument
5426 if (p_dev == nullptr) return nullptr; in get_transaction_by_lbl()
5429 rc_transaction_set_t* transaction_set = &(p_dev->transaction_set); in get_transaction_by_lbl()
5451 static bt_status_t get_transaction(btif_rc_device_cb_t* p_dev, in get_transaction() argument
5453 if (p_dev == NULL) return BT_STATUS_FAIL; in get_transaction()
5454 rc_transaction_set_t* transaction_set = &(p_dev->transaction_set); in get_transaction()
5461 __func__, p_dev->rc_addr.ToString().c_str(), i); in get_transaction()
5468 p_dev->rc_addr.ToString().c_str()); in get_transaction()
5480 void release_transaction(btif_rc_device_cb_t* p_dev, uint8_t lbl) { in release_transaction() argument
5482 p_dev == NULL ? "null" : p_dev->rc_addr.ToString().c_str(), in release_transaction()
5484 rc_transaction_t* transaction = get_transaction_by_lbl(p_dev, lbl); in release_transaction()
5488 initialize_transaction(p_dev, lbl); in release_transaction()