Lines Matching refs:p_rsp
51 static tAVRC_STS avrc_bld_get_capability_rsp(tAVRC_GET_CAPS_RSP* p_rsp, in avrc_bld_get_capability_rsp() argument
60 if (!(AVRC_IS_VALID_CAP_ID(p_rsp->capability_id))) { in avrc_bld_get_capability_rsp()
61 AVRC_TRACE_ERROR("%s bad parameter. p_rsp: %x", __func__, p_rsp); in avrc_bld_get_capability_rsp()
72 UINT8_TO_BE_STREAM(p_data, p_rsp->capability_id); in avrc_bld_get_capability_rsp()
76 *p_count = p_rsp->count; in avrc_bld_get_capability_rsp()
81 *p_count += p_rsp->count; in avrc_bld_get_capability_rsp()
84 if (p_rsp->capability_id == AVRC_CAP_COMPANY_ID) { in avrc_bld_get_capability_rsp()
85 p_company_id = p_rsp->param.company_id; in avrc_bld_get_capability_rsp()
86 for (xx = 0; xx < p_rsp->count; xx++) { in avrc_bld_get_capability_rsp()
89 len += p_rsp->count * 3; in avrc_bld_get_capability_rsp()
91 p_event_id = p_rsp->param.event_id; in avrc_bld_get_capability_rsp()
93 for (xx = 0; xx < p_rsp->count; xx++) { in avrc_bld_get_capability_rsp()
120 tAVRC_LIST_APP_ATTR_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_list_app_settings_attr_rsp() argument
140 for (xx = 0; xx < p_rsp->num_attr; xx++) { in avrc_bld_list_app_settings_attr_rsp()
141 if (AVRC_IsValidPlayerAttr(p_rsp->attrs[xx])) { in avrc_bld_list_app_settings_attr_rsp()
143 UINT8_TO_BE_STREAM(p_data, p_rsp->attrs[xx]); in avrc_bld_list_app_settings_attr_rsp()
166 tAVRC_LIST_APP_VALUES_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_list_app_settings_values_rsp() argument
181 *p_num = p_rsp->num_val; in avrc_bld_list_app_settings_values_rsp()
185 *p_num += p_rsp->num_val; in avrc_bld_list_app_settings_values_rsp()
188 for (xx = 0; xx < p_rsp->num_val; xx++) { in avrc_bld_list_app_settings_values_rsp()
189 UINT8_TO_BE_STREAM(p_data, p_rsp->vals[xx]); in avrc_bld_list_app_settings_values_rsp()
210 tAVRC_GET_CUR_APP_VALUE_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_get_cur_app_setting_value_rsp() argument
215 if (!p_rsp->p_vals) { in avrc_bld_get_cur_app_setting_value_rsp()
235 for (xx = 0; xx < p_rsp->num_val; xx++) { in avrc_bld_get_cur_app_setting_value_rsp()
236 if (avrc_is_valid_player_attrib_value(p_rsp->p_vals[xx].attr_id, in avrc_bld_get_cur_app_setting_value_rsp()
237 p_rsp->p_vals[xx].attr_val)) { in avrc_bld_get_cur_app_setting_value_rsp()
239 UINT8_TO_BE_STREAM(p_data, p_rsp->p_vals[xx].attr_id); in avrc_bld_get_cur_app_setting_value_rsp()
240 UINT8_TO_BE_STREAM(p_data, p_rsp->p_vals[xx].attr_val); in avrc_bld_get_cur_app_setting_value_rsp()
262 UNUSED_ATTR tAVRC_RSP* p_rsp, UNUSED_ATTR BT_HDR* p_pkt) { in avrc_bld_set_app_setting_value_rsp() argument
280 tAVRC_GET_APP_ATTR_TXT_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_app_setting_text_rsp() argument
287 if (!p_rsp->p_attrs) { in avrc_bld_app_setting_text_rsp()
311 for (xx = 0; xx < p_rsp->num_attr; xx++) { in avrc_bld_app_setting_text_rsp()
312 if (len_left < (p_rsp->p_attrs[xx].str_len + 4)) { in avrc_bld_app_setting_text_rsp()
314 p_rsp->p_attrs[xx].str_len, len_left); in avrc_bld_app_setting_text_rsp()
315 p_rsp->num_attr = num_added; in avrc_bld_app_setting_text_rsp()
319 if (!p_rsp->p_attrs[xx].str_len || !p_rsp->p_attrs[xx].p_str) { in avrc_bld_app_setting_text_rsp()
323 UINT8_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].attr_id); in avrc_bld_app_setting_text_rsp()
324 UINT16_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].charset_id); in avrc_bld_app_setting_text_rsp()
325 UINT8_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].str_len); in avrc_bld_app_setting_text_rsp()
326 ARRAY_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].p_str, in avrc_bld_app_setting_text_rsp()
327 p_rsp->p_attrs[xx].str_len); in avrc_bld_app_setting_text_rsp()
350 tAVRC_GET_APP_ATTR_TXT_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_get_app_setting_attr_text_rsp() argument
352 return avrc_bld_app_setting_text_rsp(p_rsp, p_pkt); in avrc_bld_get_app_setting_attr_text_rsp()
367 tAVRC_GET_APP_ATTR_TXT_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_get_app_setting_value_text_rsp() argument
369 return avrc_bld_app_setting_text_rsp(p_rsp, p_pkt); in avrc_bld_get_app_setting_value_text_rsp()
383 static tAVRC_STS avrc_bld_inform_charset_rsp(UNUSED_ATTR tAVRC_RSP* p_rsp, in avrc_bld_inform_charset_rsp() argument
402 UNUSED_ATTR tAVRC_RSP* p_rsp, UNUSED_ATTR BT_HDR* p_pkt) { in avrc_bld_inform_battery_status_rsp() argument
465 static tAVRC_STS avrc_bld_get_elem_attrs_rsp(tAVRC_GET_ATTRS_RSP* p_rsp, in avrc_bld_get_elem_attrs_rsp() argument
468 if (!p_rsp->p_attrs) { in avrc_bld_get_elem_attrs_rsp()
505 avrc_build_attribute_entries(p_rsp->num_attrs, p_rsp->p_attrs, in avrc_bld_get_elem_attrs_rsp()
525 static tAVRC_STS avrc_bld_get_play_status_rsp(tAVRC_GET_PLAY_STATUS_RSP* p_rsp, in avrc_bld_get_play_status_rsp() argument
535 UINT32_TO_BE_STREAM(p_data, p_rsp->song_len); in avrc_bld_get_play_status_rsp()
536 UINT32_TO_BE_STREAM(p_data, p_rsp->song_pos); in avrc_bld_get_play_status_rsp()
537 UINT8_TO_BE_STREAM(p_data, p_rsp->play_status); in avrc_bld_get_play_status_rsp()
553 static tAVRC_STS avrc_bld_notify_rsp(tAVRC_REG_NOTIF_RSP* p_rsp, in avrc_bld_notify_rsp() argument
561 AVRC_TRACE_API("%s event_id %d", __func__, p_rsp->event_id); in avrc_bld_notify_rsp()
567 UINT8_TO_BE_STREAM(p_data, p_rsp->event_id); in avrc_bld_notify_rsp()
568 switch (p_rsp->event_id) { in avrc_bld_notify_rsp()
571 if ((p_rsp->param.play_status <= AVRC_PLAYSTATE_REV_SEEK) || in avrc_bld_notify_rsp()
572 (p_rsp->param.play_status == AVRC_PLAYSTATE_ERROR)) { in avrc_bld_notify_rsp()
573 UINT8_TO_BE_STREAM(p_data, p_rsp->param.play_status); in avrc_bld_notify_rsp()
582 ARRAY_TO_BE_STREAM(p_data, p_rsp->param.track, AVRC_UID_SIZE); in avrc_bld_notify_rsp()
594 UINT32_TO_BE_STREAM(p_data, p_rsp->param.play_pos); in avrc_bld_notify_rsp()
599 if (AVRC_IS_VALID_BATTERY_STATUS(p_rsp->param.battery_status)) { in avrc_bld_notify_rsp()
600 UINT8_TO_BE_STREAM(p_data, p_rsp->param.battery_status); in avrc_bld_notify_rsp()
609 if (AVRC_IS_VALID_SYSTEM_STATUS(p_rsp->param.system_status)) { in avrc_bld_notify_rsp()
610 UINT8_TO_BE_STREAM(p_data, p_rsp->param.system_status); in avrc_bld_notify_rsp()
619 if (p_rsp->param.player_setting.num_attr > AVRC_MAX_APP_SETTINGS) in avrc_bld_notify_rsp()
620 p_rsp->param.player_setting.num_attr = AVRC_MAX_APP_SETTINGS; in avrc_bld_notify_rsp()
622 if (p_rsp->param.player_setting.num_attr > 0) { in avrc_bld_notify_rsp()
623 UINT8_TO_BE_STREAM(p_data, p_rsp->param.player_setting.num_attr); in avrc_bld_notify_rsp()
625 for (xx = 0; xx < p_rsp->param.player_setting.num_attr; xx++) { in avrc_bld_notify_rsp()
627 p_rsp->param.player_setting.attr_id[xx], in avrc_bld_notify_rsp()
628 p_rsp->param.player_setting.attr_value[xx])) { in avrc_bld_notify_rsp()
629 UINT8_TO_BE_STREAM(p_data, p_rsp->param.player_setting.attr_id[xx]); in avrc_bld_notify_rsp()
631 p_rsp->param.player_setting.attr_value[xx]); in avrc_bld_notify_rsp()
646 UINT8_TO_BE_STREAM(p_data, (AVRC_MAX_VOLUME & p_rsp->param.volume)); in avrc_bld_notify_rsp()
650 UINT16_TO_BE_STREAM(p_data, p_rsp->param.addr_player.player_id); in avrc_bld_notify_rsp()
651 UINT16_TO_BE_STREAM(p_data, p_rsp->param.addr_player.uid_counter); in avrc_bld_notify_rsp()
656 UINT16_TO_BE_STREAM(p_data, p_rsp->param.uid_counter); /* uid counter */ in avrc_bld_notify_rsp()
682 static tAVRC_STS avrc_bld_next_rsp(tAVRC_NEXT_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_next_rsp() argument
687 UINT8_TO_BE_STREAM(p_data, p_rsp->target_pdu); in avrc_bld_next_rsp()
689 AVRC_TRACE_API("%s: target_pdu: 0x%02x", __func__, p_rsp->target_pdu); in avrc_bld_next_rsp()
747 static tAVRC_STS avrc_bld_rejected_rsp(tAVRC_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_rejected_rsp() argument
750 uint8_t opcode = p_rsp->opcode; in avrc_bld_rejected_rsp()
752 AVRC_TRACE_API("%s: status=%d, pdu:x%x, opcode=%x", __func__, p_rsp->status, in avrc_bld_rejected_rsp()
753 p_rsp->pdu, opcode); in avrc_bld_rejected_rsp()
769 UINT8_TO_BE_STREAM(p_data, p_rsp->status); in avrc_bld_rejected_rsp()
788 static tAVRC_STS avrc_bld_ctrl_status_rsp(tAVRC_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_ctrl_status_rsp() argument
797 UINT8_TO_BE_STREAM(p_data, p_rsp->status); in avrc_bld_ctrl_status_rsp()
812 static tAVRC_STS avrc_bld_set_addr_player_rsp(tAVRC_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_set_addr_player_rsp() argument
814 return avrc_bld_ctrl_status_rsp(p_rsp, p_pkt); in avrc_bld_set_addr_player_rsp()
829 static tAVRC_STS avrc_bld_set_browsed_player_rsp(tAVRC_SET_BR_PLAYER_RSP* p_rsp, in avrc_bld_set_browsed_player_rsp() argument
834 tAVRC_NAME* p_folders = p_rsp->p_folders; in avrc_bld_set_browsed_player_rsp()
860 UINT8_TO_BE_STREAM(p_data, p_rsp->status); in avrc_bld_set_browsed_player_rsp()
861 UINT16_TO_BE_STREAM(p_data, p_rsp->uid_counter); in avrc_bld_set_browsed_player_rsp()
862 UINT32_TO_BE_STREAM(p_data, p_rsp->num_items); in avrc_bld_set_browsed_player_rsp()
863 UINT16_TO_BE_STREAM(p_data, p_rsp->charset_id); in avrc_bld_set_browsed_player_rsp()
875 (xx < p_rsp->folder_depth) && (len_left > (p_folders[xx].str_len + 2)); in avrc_bld_set_browsed_player_rsp()
904 static tAVRC_STS avrc_bld_get_folder_items_rsp(tAVRC_GET_ITEMS_RSP* p_rsp, in avrc_bld_get_folder_items_rsp() argument
915 tAVRC_ITEM* p_item_list = p_rsp->p_item_list; in avrc_bld_get_folder_items_rsp()
941 UINT8_TO_BE_STREAM(p_data, p_rsp->status); in avrc_bld_get_folder_items_rsp()
942 UINT16_TO_BE_STREAM(p_data, p_rsp->uid_counter); in avrc_bld_get_folder_items_rsp()
956 xx < p_rsp->item_count && len_left > AVRC_MIN_LEN_GET_FOLDER_ITEMS_RSP && in avrc_bld_get_folder_items_rsp()
1094 static tAVRC_STS avrc_bld_change_path_rsp(tAVRC_CHG_PATH_RSP* p_rsp, in avrc_bld_change_path_rsp() argument
1103 UINT8_TO_BE_STREAM(p_data, p_rsp->status); in avrc_bld_change_path_rsp()
1104 UINT32_TO_BE_STREAM(p_data, p_rsp->num_items); in avrc_bld_change_path_rsp()
1124 static tAVRC_STS avrc_bld_get_item_attrs_rsp(tAVRC_GET_ATTRS_RSP* p_rsp, in avrc_bld_get_item_attrs_rsp() argument
1127 if (!p_rsp->p_attrs) { in avrc_bld_get_item_attrs_rsp()
1162 *p_status = p_rsp->status; in avrc_bld_get_item_attrs_rsp()
1163 if (p_rsp->status != AVRC_STS_NO_ERROR) { in avrc_bld_get_item_attrs_rsp()
1177 avrc_build_attribute_entries(p_rsp->num_attrs, p_rsp->p_attrs, in avrc_bld_get_item_attrs_rsp()
1200 static tAVRC_STS avrc_bld_get_num_of_item_rsp(tAVRC_GET_NUM_OF_ITEMS_RSP* p_rsp, in avrc_bld_get_num_of_item_rsp() argument
1209 if (p_rsp->status == AVRC_STS_NO_ERROR) { in avrc_bld_get_num_of_item_rsp()
1212 UINT8_TO_BE_STREAM(p_data, p_rsp->status); in avrc_bld_get_num_of_item_rsp()
1213 UINT16_TO_BE_STREAM(p_data, p_rsp->uid_counter); in avrc_bld_get_num_of_item_rsp()
1214 UINT32_TO_BE_STREAM(p_data, p_rsp->num_items); in avrc_bld_get_num_of_item_rsp()
1220 UINT8_TO_BE_STREAM(p_data, p_rsp->status); in avrc_bld_get_num_of_item_rsp()
1222 return p_rsp->status; in avrc_bld_get_num_of_item_rsp()
1238 static tAVRC_STS avrc_bld_search_rsp(tAVRC_SEARCH_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_search_rsp() argument
1248 UINT8_TO_BE_STREAM(p_data, p_rsp->status); in avrc_bld_search_rsp()
1249 UINT16_TO_BE_STREAM(p_data, p_rsp->uid_counter); in avrc_bld_search_rsp()
1250 UINT32_TO_BE_STREAM(p_data, p_rsp->num_items); in avrc_bld_search_rsp()
1265 static tAVRC_STS avrc_bld_play_item_rsp(tAVRC_RSP* p_rsp, BT_HDR* p_pkt) { in avrc_bld_play_item_rsp() argument
1267 return avrc_bld_ctrl_status_rsp(p_rsp, p_pkt); in avrc_bld_play_item_rsp()
1280 static tAVRC_STS avrc_bld_add_to_now_playing_rsp(tAVRC_RSP* p_rsp, in avrc_bld_add_to_now_playing_rsp() argument
1283 return avrc_bld_ctrl_status_rsp(p_rsp, p_pkt); in avrc_bld_add_to_now_playing_rsp()
1296 static BT_HDR* avrc_bld_init_rsp_buffer(tAVRC_RESPONSE* p_rsp) { in avrc_bld_init_rsp_buffer() argument
1299 uint8_t opcode = avrc_opcode_from_pdu(p_rsp->pdu); in avrc_bld_init_rsp_buffer()
1301 AVRC_TRACE_API("%s: pdu=%x, opcode=%x/%x", __func__, p_rsp->pdu, opcode, in avrc_bld_init_rsp_buffer()
1302 p_rsp->rsp.opcode); in avrc_bld_init_rsp_buffer()
1303 if (opcode != p_rsp->rsp.opcode && p_rsp->rsp.status != AVRC_STS_NO_ERROR && in avrc_bld_init_rsp_buffer()
1304 avrc_is_valid_opcode(p_rsp->rsp.opcode)) { in avrc_bld_init_rsp_buffer()
1305 opcode = p_rsp->rsp.opcode; in avrc_bld_init_rsp_buffer()
1335 if (opcode != AVRC_OP_PASS_THRU) *p_data++ = p_rsp->pdu; in avrc_bld_init_rsp_buffer()
1349 p_rsp->rsp.opcode = opcode; in avrc_bld_init_rsp_buffer()
1365 tAVRC_STS AVRC_BldResponse(uint8_t handle, tAVRC_RESPONSE* p_rsp, in AVRC_BldResponse() argument
1373 if (!p_rsp || !pp_pkt) { in AVRC_BldResponse()
1375 __func__, p_rsp, pp_pkt); in AVRC_BldResponse()
1380 *pp_pkt = avrc_bld_init_rsp_buffer(p_rsp); in AVRC_BldResponse()
1397 AVRC_TRACE_API("%s pdu=%x status=%x", __func__, p_rsp->rsp.pdu, in AVRC_BldResponse()
1398 p_rsp->rsp.status); in AVRC_BldResponse()
1399 if (p_rsp->rsp.status != AVRC_STS_NO_ERROR) { in AVRC_BldResponse()
1400 return (avrc_bld_rejected_rsp(&p_rsp->rsp, p_pkt)); in AVRC_BldResponse()
1403 switch (p_rsp->pdu) { in AVRC_BldResponse()
1406 status = avrc_bld_group_navigation_rsp(p_rsp->pdu, p_pkt); in AVRC_BldResponse()
1410 status = avrc_bld_get_capability_rsp(&p_rsp->get_caps, p_pkt); in AVRC_BldResponse()
1415 avrc_bld_list_app_settings_attr_rsp(&p_rsp->list_app_attr, p_pkt); in AVRC_BldResponse()
1420 avrc_bld_list_app_settings_values_rsp(&p_rsp->list_app_values, p_pkt); in AVRC_BldResponse()
1424 status = avrc_bld_get_cur_app_setting_value_rsp(&p_rsp->get_cur_app_val, in AVRC_BldResponse()
1429 status = avrc_bld_set_app_setting_value_rsp(&p_rsp->set_app_val, p_pkt); in AVRC_BldResponse()
1433 status = avrc_bld_get_app_setting_attr_text_rsp(&p_rsp->get_app_attr_txt, in AVRC_BldResponse()
1438 status = avrc_bld_get_app_setting_value_text_rsp(&p_rsp->get_app_val_txt, in AVRC_BldResponse()
1443 status = avrc_bld_inform_charset_rsp(&p_rsp->inform_charset, p_pkt); in AVRC_BldResponse()
1447 status = avrc_bld_inform_battery_status_rsp(&p_rsp->inform_battery_status, in AVRC_BldResponse()
1452 status = avrc_bld_get_elem_attrs_rsp(&p_rsp->get_attrs, p_pkt); in AVRC_BldResponse()
1456 status = avrc_bld_get_play_status_rsp(&p_rsp->get_play_status, p_pkt); in AVRC_BldResponse()
1460 status = avrc_bld_notify_rsp(&p_rsp->reg_notif, p_pkt); in AVRC_BldResponse()
1464 status = avrc_bld_next_rsp(&p_rsp->continu, p_pkt); in AVRC_BldResponse()
1468 status = avrc_bld_next_rsp(&p_rsp->abort, p_pkt); in AVRC_BldResponse()
1472 status = avrc_bld_set_addr_player_rsp(&p_rsp->addr_player, p_pkt); in AVRC_BldResponse()
1476 status = avrc_bld_play_item_rsp(&p_rsp->play_item, p_pkt); in AVRC_BldResponse()
1480 status = avrc_bld_set_absolute_volume_rsp(p_rsp->volume.volume, p_pkt); in AVRC_BldResponse()
1484 status = avrc_bld_add_to_now_playing_rsp(&p_rsp->add_to_play, p_pkt); in AVRC_BldResponse()
1488 status = avrc_bld_set_browsed_player_rsp(&p_rsp->br_player, p_pkt); in AVRC_BldResponse()
1492 status = avrc_bld_get_folder_items_rsp(&p_rsp->get_items, p_pkt); in AVRC_BldResponse()
1496 status = avrc_bld_change_path_rsp(&p_rsp->chg_path, p_pkt); in AVRC_BldResponse()
1500 status = avrc_bld_get_item_attrs_rsp(&p_rsp->get_attrs, p_pkt); in AVRC_BldResponse()
1504 status = avrc_bld_get_num_of_item_rsp(&p_rsp->get_num_of_items, p_pkt); in AVRC_BldResponse()
1508 status = avrc_bld_search_rsp(&p_rsp->search, p_pkt); in AVRC_BldResponse()