system/bt
リビジョン | 6562ba76661ef9099fabda00830fe055296fa8c6 (tree) |
---|---|
日時 | 2018-11-13 03:10:55 |
作者 | Marie Janssen <jamuraa@goog...> |
コミッター | Kevin Haggerty |
AVRCP: unify Get{Element,Item}Attributes response.
GetElementAttributes response and GetItemAttributes response share the
same format and require the same checks for length.
Test: play media on carkit, see media. especially with long items.
Bug: 32407250
Bug: 30571638
Change-Id: I8623e7d662f7a39112b7527b6f5ab63c5e32379c
@@ -352,7 +352,7 @@ static void handle_app_cur_val_response (tBTA_AV_META_MSG *pmeta_msg, tAVRC_GET_ | ||
352 | 352 | static void handle_app_attr_txt_response (tBTA_AV_META_MSG *pmeta_msg, tAVRC_GET_APP_ATTR_TXT_RSP *p_rsp); |
353 | 353 | static void handle_app_attr_val_txt_response (tBTA_AV_META_MSG *pmeta_msg, tAVRC_GET_APP_ATTR_TXT_RSP *p_rsp); |
354 | 354 | static void handle_get_playstatus_response (tBTA_AV_META_MSG *pmeta_msg, tAVRC_GET_PLAY_STATUS_RSP *p_rsp); |
355 | -static void handle_get_elem_attr_response (tBTA_AV_META_MSG *pmeta_msg, tAVRC_GET_ELEM_ATTRS_RSP *p_rsp); | |
355 | +static void handle_get_elem_attr_response (tBTA_AV_META_MSG *pmeta_msg, tAVRC_GET_ATTRS_RSP* p_rsp); | |
356 | 356 | static void handle_set_app_attr_val_response (tBTA_AV_META_MSG *pmeta_msg, tAVRC_RSP *p_rsp); |
357 | 357 | static bt_status_t get_play_status_cmd(void); |
358 | 358 | static bt_status_t get_player_app_setting_value_text_cmd (UINT8 *vals, UINT8 num_vals); |
@@ -3131,10 +3131,10 @@ static bt_status_t get_element_attr_rsp(uint8_t num_attr, btrc_element_attr_val_ | ||
3131 | 3131 | } |
3132 | 3132 | avrc_rsp.get_play_status.status = AVRC_STS_NO_ERROR; |
3133 | 3133 | } |
3134 | - avrc_rsp.get_elem_attrs.num_attr = num_attr; | |
3135 | - avrc_rsp.get_elem_attrs.p_attrs = element_attrs; | |
3136 | - avrc_rsp.get_elem_attrs.pdu = AVRC_PDU_GET_ELEMENT_ATTR; | |
3137 | - avrc_rsp.get_elem_attrs.opcode = opcode_from_pdu(AVRC_PDU_GET_ELEMENT_ATTR); | |
3134 | + avrc_rsp.get_attrs.num_attrs = num_attr; | |
3135 | + avrc_rsp.get_attrs.p_attrs = element_attrs; | |
3136 | + avrc_rsp.get_attrs.pdu = AVRC_PDU_GET_ELEMENT_ATTR; | |
3137 | + avrc_rsp.get_attrs.opcode = opcode_from_pdu(AVRC_PDU_GET_ELEMENT_ATTR); | |
3138 | 3138 | /* Send the response */ |
3139 | 3139 | SEND_METAMSG_RSP(IDX_GET_ELEMENT_ATTR_RSP, &avrc_rsp, rc_index); |
3140 | 3140 | return BT_STATUS_SUCCESS; |
@@ -3597,8 +3597,8 @@ static bt_status_t get_itemattr_rsp(uint8_t num_attr, btrc_element_attr_val_t *p | ||
3597 | 3597 | } |
3598 | 3598 | avrc_rsp.get_attrs.status = AVRC_STS_NO_ERROR; |
3599 | 3599 | } |
3600 | - avrc_rsp.get_attrs.attr_count = num_attr; | |
3601 | - avrc_rsp.get_attrs.p_attr_list = element_attrs; | |
3600 | + avrc_rsp.get_attrs.num_attrs = num_attr; | |
3601 | + avrc_rsp.get_attrs.p_attrs = element_attrs; | |
3602 | 3602 | avrc_rsp.get_attrs.pdu = AVRC_PDU_GET_ITEM_ATTRIBUTES; |
3603 | 3603 | avrc_rsp.get_attrs.opcode = opcode_from_pdu(AVRC_PDU_GET_ITEM_ATTRIBUTES); |
3604 | 3604 | /* Send the response */ |
@@ -4036,8 +4036,8 @@ static void btif_rc_status_cmd_timeout_handler(UNUSED_ATTR uint16_t event, | ||
4036 | 4036 | break; |
4037 | 4037 | |
4038 | 4038 | case AVRC_PDU_GET_ELEMENT_ATTR: |
4039 | - avrc_response.get_elem_attrs.status = BTIF_RC_STS_TIMEOUT; | |
4040 | - handle_get_elem_attr_response(&meta_msg, &avrc_response.get_elem_attrs); | |
4039 | + avrc_response.get_attrs.status = BTIF_RC_STS_TIMEOUT; | |
4040 | + handle_get_elem_attr_response(&meta_msg, &avrc_response.get_attrs); | |
4041 | 4041 | break; |
4042 | 4042 | |
4043 | 4043 | case AVRC_PDU_GET_PLAY_STATUS: |
@@ -4974,17 +4974,17 @@ static void handle_set_app_attr_val_response (tBTA_AV_META_MSG *pmeta_msg, tAVRC | ||
4974 | 4974 | ** |
4975 | 4975 | ***************************************************************************/ |
4976 | 4976 | static void handle_get_elem_attr_response (tBTA_AV_META_MSG *pmeta_msg, |
4977 | - tAVRC_GET_ELEM_ATTRS_RSP *p_rsp) | |
4977 | + tAVRC_GET_ATTRS_RSP* p_rsp) | |
4978 | 4978 | { |
4979 | 4979 | if (p_rsp->status == AVRC_STS_NO_ERROR) { |
4980 | 4980 | bt_bdaddr_t rc_addr; |
4981 | - size_t buf_size = p_rsp->num_attr * sizeof(btrc_element_attr_val_t); | |
4981 | + size_t buf_size = p_rsp->num_attrs * sizeof(btrc_element_attr_val_t); | |
4982 | 4982 | btrc_element_attr_val_t *p_attr = |
4983 | 4983 | (btrc_element_attr_val_t *)osi_calloc(buf_size); |
4984 | 4984 | |
4985 | 4985 | bdcpy(rc_addr.address, btif_rc_cb[0].rc_addr); |
4986 | 4986 | |
4987 | - for (int i = 0; i < p_rsp->num_attr; i++) { | |
4987 | + for (int i = 0; i < p_rsp->num_attrs; i++) { | |
4988 | 4988 | p_attr[i].attr_id = p_rsp->p_attrs[i].attr_id; |
4989 | 4989 | /* Todo. Legth limit check to include null */ |
4990 | 4990 | if (p_rsp->p_attrs[i].name.str_len && |
@@ -4995,7 +4995,7 @@ static void handle_get_elem_attr_response (tBTA_AV_META_MSG *pmeta_msg, | ||
4995 | 4995 | } |
4996 | 4996 | } |
4997 | 4997 | HAL_CBACK(bt_rc_ctrl_callbacks, track_changed_cb, |
4998 | - &rc_addr, p_rsp->num_attr, p_attr); | |
4998 | + &rc_addr, p_rsp->num_attrs, p_attr); | |
4999 | 4999 | osi_free(p_attr); |
5000 | 5000 | } else if (p_rsp->status == BTIF_RC_STS_TIMEOUT) { |
5001 | 5001 | /* Retry for timeout case, this covers error handling |
@@ -5138,7 +5138,7 @@ static void handle_avk_rc_metamsg_rsp(tBTA_AV_META_MSG *pmeta_msg) | ||
5138 | 5138 | break; |
5139 | 5139 | |
5140 | 5140 | case AVRC_PDU_GET_ELEMENT_ATTR: |
5141 | - handle_get_elem_attr_response(pmeta_msg, &avrc_response.get_elem_attrs); | |
5141 | + handle_get_elem_attr_response(pmeta_msg, &avrc_response.get_attrs); | |
5142 | 5142 | break; |
5143 | 5143 | |
5144 | 5144 | case AVRC_PDU_GET_PLAY_STATUS: |
@@ -445,71 +445,6 @@ static tAVRC_STS avrc_bld_inform_battery_status_rsp (tAVRC_RSP *p_rsp, BT_HDR *p | ||
445 | 445 | |
446 | 446 | /******************************************************************************* |
447 | 447 | ** |
448 | -** Function avrc_bld_get_elem_attrs_rsp | |
449 | -** | |
450 | -** Description This function builds the Get Element Attributes | |
451 | -** response. | |
452 | -** | |
453 | -** Returns AVRC_STS_NO_ERROR, if the response is built successfully | |
454 | -** Otherwise, the error code. | |
455 | -** | |
456 | -*******************************************************************************/ | |
457 | -static tAVRC_STS avrc_bld_get_elem_attrs_rsp (tAVRC_GET_ELEM_ATTRS_RSP *p_rsp, BT_HDR *p_pkt) | |
458 | -{ | |
459 | - UINT8 *p_data, *p_start, *p_len, *p_count; | |
460 | - UINT16 len; | |
461 | - UINT8 xx; | |
462 | - | |
463 | - AVRC_TRACE_API("%s", __func__); | |
464 | - if (!p_rsp->p_attrs) | |
465 | - { | |
466 | - AVRC_TRACE_ERROR("%s NULL parameter", __func__); | |
467 | - return AVRC_STS_BAD_PARAM; | |
468 | - } | |
469 | - | |
470 | - /* get the existing length, if any, and also the num attributes */ | |
471 | - p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; | |
472 | - p_data = p_len = p_start + 2; /* pdu + rsvd */ | |
473 | - | |
474 | - BE_STREAM_TO_UINT16(len, p_data); | |
475 | - p_count = p_data; | |
476 | - | |
477 | - if (len == 0) | |
478 | - { | |
479 | - *p_count = 0; | |
480 | - p_data++; | |
481 | - } | |
482 | - else | |
483 | - { | |
484 | - p_data = p_start + p_pkt->len; | |
485 | - } | |
486 | - | |
487 | - for (xx=0; xx<p_rsp->num_attr; xx++) | |
488 | - { | |
489 | - if (!AVRC_IS_VALID_MEDIA_ATTRIBUTE(p_rsp->p_attrs[xx].attr_id)) | |
490 | - { | |
491 | - AVRC_TRACE_ERROR("%s invalid attr id[%d]: %d", | |
492 | - __func__, xx, p_rsp->p_attrs[xx].attr_id); | |
493 | - continue; | |
494 | - } | |
495 | - if ( !p_rsp->p_attrs[xx].name.p_str ) | |
496 | - { | |
497 | - p_rsp->p_attrs[xx].name.str_len = 0; | |
498 | - } | |
499 | - UINT32_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].attr_id); | |
500 | - UINT16_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].name.charset_id); | |
501 | - UINT16_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].name.str_len); | |
502 | - ARRAY_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].name.p_str, p_rsp->p_attrs[xx].name.str_len); | |
503 | - (*p_count)++; | |
504 | - } | |
505 | - len = p_data - p_count; | |
506 | - UINT16_TO_BE_STREAM(p_len, len); | |
507 | - p_pkt->len = (p_data - p_start); | |
508 | - return AVRC_STS_NO_ERROR; | |
509 | -} | |
510 | - | |
511 | -/******************************************************************************* | |
512 | -** | |
513 | 448 | ** Function avrc_bld_get_play_status_rsp |
514 | 449 | ** |
515 | 450 | ** Description This function builds the Get Play Status |
@@ -982,56 +917,97 @@ static tAVRC_STS avrc_bld_set_browse_player_rsp (tAVRC_SET_BR_PLAYER_RSP *p_rsp, | ||
982 | 917 | |
983 | 918 | /******************************************************************************* |
984 | 919 | ** |
985 | -** Function avrc_bld_get_item_attrs_rsp | |
920 | +** Function avrc_bld_get_attrs_rsp | |
986 | 921 | ** |
987 | -** Description This function builds the Get Item Attributes | |
988 | -** response. | |
922 | +** Description This function builds the Get Item Attributes or | |
923 | +** Get Element Attributes response, | |
924 | +** | |
925 | +** The Get Item Attributes message goes through the | |
926 | +** Browsing channel (already specified in the |p_pkt|) | |
989 | 927 | ** |
990 | 928 | ** Returns AVRC_STS_NO_ERROR, if the response is built successfully |
929 | +** AVRC_STS_INTERNAL_ERR, if the given buffer does not have enough room | |
991 | 930 | ** Otherwise, the error code. |
992 | 931 | ** |
993 | 932 | *******************************************************************************/ |
994 | -static tAVRC_STS avrc_bld_get_item_attrs_rsp (tAVRC_GET_ATTRS_RSP *p_rsp, BT_HDR *p_pkt) | |
933 | +static tAVRC_STS avrc_bld_get_attrs_rsp (tAVRC_GET_ATTRS_RSP *p_rsp, BT_HDR *p_pkt) | |
995 | 934 | { |
996 | - UINT8 *p_data, *p_start; | |
997 | - UINT16 param_len; | |
998 | - UINT8 xx; | |
999 | - | |
1000 | - AVRC_TRACE_API("avrc_bld_get_item_attrs_rsp"); | |
1001 | - if (!p_rsp->p_attr_list) | |
935 | + uint8_t *p_data, *p_start; | |
936 | + uint8_t *p_len; | |
937 | + uint16_t len_left; | |
938 | + uint8_t *p_num; | |
939 | + uint16_t mtu; | |
940 | + AVRC_TRACE_API("%s", __func__); | |
941 | + /* calculate the buffer size needed and validate the parameters */ | |
942 | + if (!p_rsp || !p_rsp->p_attrs) | |
1002 | 943 | { |
1003 | - AVRC_TRACE_ERROR("avrc_bld_get_item_attrs_rsp NULL parameter"); | |
944 | + AVRC_TRACE_ERROR("NULL p_attrs"); | |
1004 | 945 | return AVRC_STS_BAD_PARAM; |
1005 | 946 | } |
1006 | - | |
947 | + /* check the length before adding the attr to the message */ | |
948 | + uint16_t len = 2; | |
949 | + for (uint8_t xx = 0; xx < p_rsp->num_attrs; xx++) | |
950 | + { | |
951 | + if(p_rsp->p_attrs[xx].name.p_str == 0 || | |
952 | + !AVRC_IS_VALID_MEDIA_ATTRIBUTE(p_rsp->p_attrs[xx].attr_id)) | |
953 | + { | |
954 | + AVRC_TRACE_ERROR("[%d] NULL p_attrs str or bad attr_id:%d", xx, | |
955 | + p_rsp->p_attrs[xx].attr_id); | |
956 | + return AVRC_STS_BAD_PARAM; | |
957 | + } | |
958 | + len += (p_rsp->p_attrs[xx].name.str_len + 8); | |
959 | + } | |
960 | + len_left = BT_DEFAULT_BUFFER_SIZE - BT_HDR_SIZE; | |
961 | + p_data = (uint8_t *)(p_pkt + 1); | |
962 | + BE_STREAM_TO_UINT16 (mtu, p_data); | |
963 | + if (len_left > mtu) | |
964 | + { | |
965 | + len_left = mtu; | |
966 | + } | |
967 | + len_left = len_left - p_pkt->offset - p_pkt->len; | |
968 | + AVRC_TRACE_DEBUG("len_left:%d, mtu:%d len needed:%d", len_left, mtu, len); | |
969 | + if (len_left < 11) /* 11 is 4/attr_id + 2/charset_id + 2/str_len + 3/1st timer/attr cnt & len */ | |
970 | + { | |
971 | + return AVRC_STS_INTERNAL_ERR; | |
972 | + } | |
973 | + if (len > len_left) | |
974 | + { | |
975 | + AVRC_TRACE_ERROR("The buffer does not have enough room to hold the given data."); | |
976 | + } | |
1007 | 977 | /* get the existing length, if any, and also the num attributes */ |
1008 | - p_start = (UINT8 *)(p_pkt + 1) + p_pkt->offset; | |
1009 | - p_data = p_start; | |
1010 | - UINT8_TO_BE_STREAM(p_data, p_rsp->pdu); | |
1011 | - | |
1012 | - param_len = 2; /* for status and num_attr*/ | |
1013 | - for(xx = 0; xx < p_rsp->attr_count; xx++) | |
978 | + p_start = (uint8_t *)(p_pkt + 1) + p_pkt->offset; | |
979 | + p_data = p_len = p_start + 1; /* pdu */ | |
980 | + /* the existing len */ | |
981 | + BE_STREAM_TO_UINT16(len, p_data); | |
982 | + p_num = p_data + 1; | |
983 | + if (len == 0) | |
1014 | 984 | { |
1015 | - /* 8 for attr_id, char_set_id, attr_value_len */ | |
1016 | - param_len = param_len + 8 + p_rsp->p_attr_list[xx].name.str_len; | |
985 | + /* first time initialize the attribute count */ | |
986 | + UINT8_TO_BE_STREAM(p_data, p_rsp->status); | |
987 | + *p_num = 0; | |
988 | + p_data++; | |
989 | + len = 2; | |
990 | + len_left -= 3; | |
1017 | 991 | } |
1018 | - AVRC_TRACE_API(" param_len = %d ", param_len); | |
1019 | - UINT16_TO_BE_STREAM(p_data, param_len); | |
1020 | - UINT8_TO_BE_STREAM(p_data, p_rsp->status); | |
1021 | - UINT8_TO_BE_STREAM(p_data, p_rsp->attr_count); | |
1022 | - | |
1023 | - for (xx=0; xx < p_rsp->attr_count; xx++) | |
992 | + else | |
1024 | 993 | { |
1025 | - if ( !p_rsp->p_attr_list[xx].name.p_str ) | |
1026 | - { | |
1027 | - p_rsp->p_attr_list[xx].name.str_len = 0; | |
1028 | - } | |
1029 | - UINT32_TO_BE_STREAM(p_data, p_rsp->p_attr_list[xx].attr_id); | |
1030 | - UINT16_TO_BE_STREAM(p_data, p_rsp->p_attr_list[xx].name.charset_id); | |
1031 | - UINT16_TO_BE_STREAM(p_data, p_rsp->p_attr_list[xx].name.str_len); | |
1032 | - ARRAY_TO_BE_STREAM(p_data, p_rsp->p_attr_list[xx].name.p_str, \ | |
1033 | - p_rsp->p_attr_list[xx].name.str_len); | |
994 | + p_data = p_start + p_pkt->len; | |
995 | + } | |
996 | + for (uint8_t xx = 0; (xx < p_rsp->num_attrs) && (len_left > 9); xx++) | |
997 | + { | |
998 | + (*p_num)++; | |
999 | + UINT32_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].attr_id); | |
1000 | + UINT16_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].name.charset_id); | |
1001 | + UINT16_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].name.str_len); | |
1002 | + len_left -= 8; | |
1003 | + if (p_rsp->p_attrs[xx].name.str_len > len_left) | |
1004 | + p_rsp->p_attrs[xx].name.str_len = len_left; | |
1005 | + ARRAY_TO_BE_STREAM(p_data, p_rsp->p_attrs[xx].name.p_str, | |
1006 | + p_rsp->p_attrs[xx].name.str_len); | |
1007 | + len_left -= p_rsp->p_attrs[xx].name.str_len; | |
1008 | + len += (p_rsp->p_attrs[xx].name.str_len + 8); | |
1034 | 1009 | } |
1010 | + UINT16_TO_BE_STREAM(p_len, len); | |
1035 | 1011 | p_pkt->len = (p_data - p_start); |
1036 | 1012 | return AVRC_STS_NO_ERROR; |
1037 | 1013 | } |
@@ -1270,7 +1246,8 @@ tAVRC_STS AVRC_BldResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR **pp_pkt | ||
1270 | 1246 | break; |
1271 | 1247 | |
1272 | 1248 | case AVRC_PDU_GET_ELEMENT_ATTR: |
1273 | - status = avrc_bld_get_elem_attrs_rsp(&p_rsp->get_elem_attrs, p_pkt); | |
1249 | + case AVRC_PDU_GET_ITEM_ATTRIBUTES: | |
1250 | + status = avrc_bld_get_attrs_rsp(&p_rsp->get_attrs, p_pkt); | |
1274 | 1251 | break; |
1275 | 1252 | |
1276 | 1253 | case AVRC_PDU_GET_PLAY_STATUS: |
@@ -1281,15 +1258,15 @@ tAVRC_STS AVRC_BldResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR **pp_pkt | ||
1281 | 1258 | status = avrc_bld_notify_rsp(&p_rsp->reg_notif, p_pkt); |
1282 | 1259 | break; |
1283 | 1260 | |
1284 | - case AVRC_PDU_REQUEST_CONTINUATION_RSP: /* 0x40 */ | |
1261 | + case AVRC_PDU_REQUEST_CONTINUATION_RSP: | |
1285 | 1262 | status = avrc_bld_next_rsp(&p_rsp->continu, p_pkt); |
1286 | 1263 | break; |
1287 | 1264 | |
1288 | - case AVRC_PDU_ABORT_CONTINUATION_RSP: /* 0x41 */ | |
1265 | + case AVRC_PDU_ABORT_CONTINUATION_RSP: | |
1289 | 1266 | status = avrc_bld_next_rsp(&p_rsp->abort, p_pkt); |
1290 | 1267 | break; |
1291 | 1268 | |
1292 | - case AVRC_PDU_SET_ADDRESSED_PLAYER: /*PDU 0x60*/ | |
1269 | + case AVRC_PDU_SET_ADDRESSED_PLAYER: | |
1293 | 1270 | status = avrc_bld_set_address_player_rsp(&p_rsp->addr_player, p_pkt); |
1294 | 1271 | break; |
1295 | 1272 |
@@ -1402,10 +1379,6 @@ tAVRC_STS AVRC_BldBrowseResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR ** | ||
1402 | 1379 | status = avrc_bld_change_path_rsp(&p_rsp->chg_path, p_pkt); |
1403 | 1380 | break; |
1404 | 1381 | |
1405 | - case AVRC_PDU_GET_ITEM_ATTRIBUTES: | |
1406 | - status = avrc_bld_get_item_attrs_rsp(&p_rsp->get_attrs, p_pkt); | |
1407 | - break; | |
1408 | - | |
1409 | 1382 | case AVRC_PDU_GET_TOTAL_NUMBER_OF_ITEMS: |
1410 | 1383 | status = avrc_bld_tot_num_items_rsp(&p_rsp->get_tot_items, p_pkt); |
1411 | 1384 | break; |
@@ -468,12 +468,12 @@ static tAVRC_STS avrc_ctrl_pars_vendor_rsp( | ||
468 | 468 | |
469 | 469 | if (len <= 0) |
470 | 470 | { |
471 | - p_result->get_elem_attrs.num_attr = 0; | |
471 | + p_result->get_attrs.num_attrs = 0; | |
472 | 472 | break; |
473 | 473 | } |
474 | 474 | min_len += 1; |
475 | 475 | BE_STREAM_TO_UINT8(num_attrs, p); |
476 | - p_result->get_elem_attrs.num_attr = num_attrs; | |
476 | + p_result->get_attrs.num_attrs = num_attrs; | |
477 | 477 | if (num_attrs) |
478 | 478 | { |
479 | 479 | tAVRC_ATTR_ENTRY *p_attrs = |
@@ -515,7 +515,7 @@ static tAVRC_STS avrc_ctrl_pars_vendor_rsp( | ||
515 | 515 | p_attrs[i].name.p_str = NULL; |
516 | 516 | } |
517 | 517 | } |
518 | - p_result->get_elem_attrs.p_attrs = p_attrs; | |
518 | + p_result->get_attrs.p_attrs = p_attrs; | |
519 | 519 | } |
520 | 520 | } |
521 | 521 | break; |
@@ -1263,16 +1263,6 @@ typedef struct | ||
1263 | 1263 | tAVRC_APP_SETTING_TEXT *p_attrs; |
1264 | 1264 | } tAVRC_GET_APP_ATTR_TXT_RSP; |
1265 | 1265 | |
1266 | -/* GetElemAttrs */ | |
1267 | -typedef struct | |
1268 | -{ | |
1269 | - UINT8 pdu; | |
1270 | - tAVRC_STS status; | |
1271 | - UINT8 opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ | |
1272 | - UINT8 num_attr; | |
1273 | - tAVRC_ATTR_ENTRY *p_attrs; | |
1274 | -} tAVRC_GET_ELEM_ATTRS_RSP; | |
1275 | - | |
1276 | 1266 | /* GetPlayStatus */ |
1277 | 1267 | typedef struct |
1278 | 1268 | { |
@@ -1369,14 +1359,14 @@ typedef struct | ||
1369 | 1359 | UINT32 num_items; |
1370 | 1360 | } tAVRC_CHG_PATH_RSP; |
1371 | 1361 | |
1372 | -/* GetItemAttrs */ | |
1362 | +/* GetItemAttrs, GetElemAttrs */ | |
1373 | 1363 | typedef struct |
1374 | 1364 | { |
1375 | 1365 | UINT8 pdu; |
1376 | 1366 | tAVRC_STS status; |
1377 | 1367 | UINT8 opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ |
1378 | - UINT8 attr_count; | |
1379 | - tAVRC_ATTR_ENTRY *p_attr_list; | |
1368 | + uint8_t num_attrs; | |
1369 | + tAVRC_ATTR_ENTRY *p_attrs; | |
1380 | 1370 | } tAVRC_GET_ATTRS_RSP; |
1381 | 1371 | |
1382 | 1372 | /* Search */ |
@@ -1419,7 +1409,6 @@ typedef union | ||
1419 | 1409 | tAVRC_GET_APP_ATTR_TXT_RSP get_app_val_txt; /* GetAppValueTxt */ |
1420 | 1410 | tAVRC_RSP inform_charset; /* InformCharset */ |
1421 | 1411 | tAVRC_RSP inform_battery_status; /* InformBatteryStatus */ |
1422 | - tAVRC_GET_ELEM_ATTRS_RSP get_elem_attrs; /* GetElemAttrs */ | |
1423 | 1412 | tAVRC_GET_PLAY_STATUS_RSP get_play_status; /* GetPlayStatus */ |
1424 | 1413 | tAVRC_REG_NOTIF_RSP reg_notif; /* RegNotify */ |
1425 | 1414 | tAVRC_RSP continu; /* Continue */ |
@@ -1430,7 +1419,7 @@ typedef union | ||
1430 | 1419 | tAVRC_SET_BR_PLAYER_RSP br_player; /* SetBrowsedPlayer */ |
1431 | 1420 | tAVRC_GET_ITEMS_RSP get_items; /* GetFolderItems */ |
1432 | 1421 | tAVRC_CHG_PATH_RSP chg_path; /* ChangePath */ |
1433 | - tAVRC_GET_ATTRS_RSP get_attrs; /* GetItemAttrs */ | |
1422 | + tAVRC_GET_ATTRS_RSP get_attrs; /* GetItemAttrs, GetElemAttrs */ | |
1434 | 1423 | tAVRC_SEARCH_RSP search; /* Search */ |
1435 | 1424 | tAVRC_RSP play_item; /* PlayItem */ |
1436 | 1425 | tAVRC_RSP add_to_play; /* AddToNowPlaying */ |