avrc_defs.h revision ee96a3c60fca590d38025925c072d264e06493c4
1/****************************************************************************** 2 * 3 * Copyright (C) 2006-2016 Broadcom Corporation 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at: 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ******************************************************************************/ 18 19/****************************************************************************** 20 * 21 * AVRCP definition and data types 22 * 23 ******************************************************************************/ 24#ifndef _AVRC_DEFS_H 25#define _AVRC_DEFS_H 26 27#include "stack/include/bt_types.h" 28 29/***************************************************************************** 30 * constants 31 ****************************************************************************/ 32 33/* Profile revision numbers */ 34#define AVRC_REV_1_0 0x0100 35#define AVRC_REV_1_3 0x0103 36#define AVRC_REV_1_4 0x0104 37#define AVRC_REV_1_5 0x0105 38#define AVRC_REV_1_6 0x0106 39 40#define AVRC_PACKET_LEN 512 /* Per the spec, you must support 512 byte RC packets */ 41 42#define AVRC_MIN_CONTROL_MTU 48 /* Per the spec, minimum MTU for the control channel */ 43#define AVRC_MIN_BROWSE_MTU 335 /* Per the spec, minimum MTU for the browsing channel */ 44 45#define AVRC_META_PDU_OFFSET 4 46#define AVRC_SUB_TYPE_LEN 4 47#define AVRC_UID_SIZE 8 48#define AVRC_FEATURE_MASK_SIZE 16 49 50/* command type codes */ 51#define AVRC_CMD_CTRL 0 /* Instruct a target to perform an operation */ 52#define AVRC_CMD_STATUS 1 /* Check a device's current status */ 53#define AVRC_CMD_SPEC_INQ 2 /* Check whether a target supports a particular 54 control command; all operands are included */ 55#define AVRC_CMD_NOTIF 3 /* Used for receiving notification of a change in a device's state */ 56#define AVRC_CMD_GEN_INQ 4 /* Check whether a target supports a particular 57 control command; operands are not included */ 58 59/* response type codes */ 60#define AVRC_RSP_NOT_IMPL 8 /* The target does not implement the command specified 61 by the opcode and operand, 62 or doesn't implement the specified subunit */ 63#define AVRC_RSP_ACCEPT 9 /* The target executed or is executing the command */ 64#define AVRC_RSP_REJ 10 /* The target implements the command specified by the 65 opcode but cannot respond because the current state 66 of the target doesn't allow it */ 67#define AVRC_RSP_IN_TRANS 11 /* The target implements the status command but it is 68 in a state of transition; the status command may 69 be retried at a future time */ 70#define AVRC_RSP_IMPL_STBL 12 /* For specific inquiry or general inquiy commands, 71 the target implements the command; for status 72 commands, the target returns stable and includes 73 the status results */ 74#define AVRC_RSP_CHANGED 13 /* The response frame contains a notification that the 75 target device's state has changed */ 76#define AVRC_RSP_INTERIM 15 /* For control commands, the target has accepted the 77 request but cannot return information within 100 78 milliseconds; for notify commands, the target accepted 79 the command, and will notify the controller of a change 80 of target state at a future time */ 81 82/* subunit type */ 83#define AVRC_SUB_MONITOR 0x00 /* Monitor */ 84#define AVRC_SUB_AUDIO 0x01 /* Audio */ 85#define AVRC_SUB_PRINTER 0x02 /* Printer */ 86#define AVRC_SUB_DISC 0x03 /* Disc */ 87#define AVRC_SUB_TAPE 0x04 /* Tape recorder/player */ 88#define AVRC_SUB_TUNER 0x05 /* Tuner */ 89#define AVRC_SUB_CA 0x06 /* CA */ 90#define AVRC_SUB_CAMERA 0x07 /* Camera */ 91#define AVRC_SUB_PANEL 0x09 /* Panel */ 92#define AVRC_SUB_BB 0x0A /* Bulletin Board */ 93#define AVRC_SUB_CAM_STOR 0x0B /* Camera Storage */ 94#define AVRC_SUB_VENDOR 0x1C /* Vendor unique */ 95#define AVRC_SUB_EXT 0x1E /* Subunit type extended to next byte */ 96#define AVRC_SUB_UNIT 0x1F /* Unit */ 97 98/* opcodes - defined by 1394ta */ 99#define AVRC_OP_UNIT_INFO 0x30 /* Report unit information */ 100#define AVRC_OP_SUB_INFO 0x31 /* Report subunit information */ 101#define AVRC_OP_VENDOR 0x00 /* Vendor-dependent commands */ 102#define AVRC_OP_PASS_THRU 0x7C /* panel subunit opcode */ 103/* opcodes 80-9F and E0-FF are not used by 1394ta.Sneak one for the browsing channel */ 104#define AVRC_OP_BROWSE 0xFF /* Browsing */ 105#define AVRC_OP_INVALID 0xFE /* invalid one */ 106 107/* Company ID's 108*/ 109#define AVRC_CO_BLUETOOTH_SIG 0x00FFFFFF 110#define AVRC_CO_WIDCOMM 0x00000361 111#define AVRC_CO_BROADCOM 0x00001018 112#define AVRC_CO_GOOGLE 0x00DAA119 113#define AVRC_CO_METADATA 0x00001958 /* Unique COMPANY ID for Metadata messages */ 114 115/* State flag for Passthrough commands 116*/ 117#define AVRC_STATE_PRESS 0 118#define AVRC_STATE_RELEASE 1 119 120/* Operation ID list for Passthrough commands 121*/ 122#define AVRC_ID_SELECT 0x00 /* select */ 123#define AVRC_ID_UP 0x01 /* up */ 124#define AVRC_ID_DOWN 0x02 /* down */ 125#define AVRC_ID_LEFT 0x03 /* left */ 126#define AVRC_ID_RIGHT 0x04 /* right */ 127#define AVRC_ID_RIGHT_UP 0x05 /* right-up */ 128#define AVRC_ID_RIGHT_DOWN 0x06 /* right-down */ 129#define AVRC_ID_LEFT_UP 0x07 /* left-up */ 130#define AVRC_ID_LEFT_DOWN 0x08 /* left-down */ 131#define AVRC_ID_ROOT_MENU 0x09 /* root menu */ 132#define AVRC_ID_SETUP_MENU 0x0A /* setup menu */ 133#define AVRC_ID_CONT_MENU 0x0B /* contents menu */ 134#define AVRC_ID_FAV_MENU 0x0C /* favorite menu */ 135#define AVRC_ID_EXIT 0x0D /* exit */ 136#define AVRC_ID_0 0x20 /* 0 */ 137#define AVRC_ID_1 0x21 /* 1 */ 138#define AVRC_ID_2 0x22 /* 2 */ 139#define AVRC_ID_3 0x23 /* 3 */ 140#define AVRC_ID_4 0x24 /* 4 */ 141#define AVRC_ID_5 0x25 /* 5 */ 142#define AVRC_ID_6 0x26 /* 6 */ 143#define AVRC_ID_7 0x27 /* 7 */ 144#define AVRC_ID_8 0x28 /* 8 */ 145#define AVRC_ID_9 0x29 /* 9 */ 146#define AVRC_ID_DOT 0x2A /* dot */ 147#define AVRC_ID_ENTER 0x2B /* enter */ 148#define AVRC_ID_CLEAR 0x2C /* clear */ 149#define AVRC_ID_CHAN_UP 0x30 /* channel up */ 150#define AVRC_ID_CHAN_DOWN 0x31 /* channel down */ 151#define AVRC_ID_PREV_CHAN 0x32 /* previous channel */ 152#define AVRC_ID_SOUND_SEL 0x33 /* sound select */ 153#define AVRC_ID_INPUT_SEL 0x34 /* input select */ 154#define AVRC_ID_DISP_INFO 0x35 /* display information */ 155#define AVRC_ID_HELP 0x36 /* help */ 156#define AVRC_ID_PAGE_UP 0x37 /* page up */ 157#define AVRC_ID_PAGE_DOWN 0x38 /* page down */ 158#define AVRC_ID_POWER 0x40 /* power */ 159#define AVRC_ID_VOL_UP 0x41 /* volume up */ 160#define AVRC_ID_VOL_DOWN 0x42 /* volume down */ 161#define AVRC_ID_MUTE 0x43 /* mute */ 162#define AVRC_ID_PLAY 0x44 /* play */ 163#define AVRC_ID_STOP 0x45 /* stop */ 164#define AVRC_ID_PAUSE 0x46 /* pause */ 165#define AVRC_ID_RECORD 0x47 /* record */ 166#define AVRC_ID_REWIND 0x48 /* rewind */ 167#define AVRC_ID_FAST_FOR 0x49 /* fast forward */ 168#define AVRC_ID_EJECT 0x4A /* eject */ 169#define AVRC_ID_FORWARD 0x4B /* forward */ 170#define AVRC_ID_BACKWARD 0x4C /* backward */ 171#define AVRC_ID_ANGLE 0x50 /* angle */ 172#define AVRC_ID_SUBPICT 0x51 /* subpicture */ 173#define AVRC_ID_F1 0x71 /* F1 */ 174#define AVRC_ID_F2 0x72 /* F2 */ 175#define AVRC_ID_F3 0x73 /* F3 */ 176#define AVRC_ID_F4 0x74 /* F4 */ 177#define AVRC_ID_F5 0x75 /* F5 */ 178#define AVRC_ID_VENDOR 0x7E /* vendor unique */ 179#define AVRC_KEYPRESSED_RELEASE 0x80 180 181/***************************************************************************** 182 * Metadata transfer definitions 183 ****************************************************************************/ 184 185/* Define the Metadata Packet types 186*/ 187#define AVRC_PKT_SINGLE 0 188#define AVRC_PKT_START 1 189#define AVRC_PKT_CONTINUE 2 190#define AVRC_PKT_END 3 191#define AVRC_PKT_TYPE_MASK 3 192 193/* Define the PDUs carried in the vendor dependant data 194*/ 195#define AVRC_PDU_GET_CAPABILITIES 0x10 196#define AVRC_PDU_LIST_PLAYER_APP_ATTR 0x11 197#define AVRC_PDU_LIST_PLAYER_APP_VALUES 0x12 198#define AVRC_PDU_GET_CUR_PLAYER_APP_VALUE 0x13 199#define AVRC_PDU_SET_PLAYER_APP_VALUE 0x14 200#define AVRC_PDU_GET_PLAYER_APP_ATTR_TEXT 0x15 201#define AVRC_PDU_GET_PLAYER_APP_VALUE_TEXT 0x16 202#define AVRC_PDU_INFORM_DISPLAY_CHARSET 0x17 203#define AVRC_PDU_INFORM_BATTERY_STAT_OF_CT 0x18 204#define AVRC_PDU_GET_ELEMENT_ATTR 0x20 205#define AVRC_PDU_GET_PLAY_STATUS 0x30 206#define AVRC_PDU_REGISTER_NOTIFICATION 0x31 207#define AVRC_PDU_REQUEST_CONTINUATION_RSP 0x40 208#define AVRC_PDU_ABORT_CONTINUATION_RSP 0x41 209/* added in 1.4 */ 210#define AVRC_PDU_SET_ABSOLUTE_VOLUME 0x50 211#define AVRC_PDU_SET_ADDRESSED_PLAYER 0x60 212#define AVRC_PDU_SET_BROWSED_PLAYER 0x70 213#define AVRC_PDU_GET_FOLDER_ITEMS 0x71 214#define AVRC_PDU_CHANGE_PATH 0x72 215#define AVRC_PDU_GET_ITEM_ATTRIBUTES 0x73 216#define AVRC_PDU_PLAY_ITEM 0x74 217#define AVRC_PDU_GET_TOTAL_NUM_OF_ITEMS 0x75 /* Added in post 1.5 */ 218#define AVRC_PDU_SEARCH 0x80 219#define AVRC_PDU_ADD_TO_NOW_PLAYING 0x90 220#define AVRC_PDU_GENERAL_REJECT 0xA0 221 222/* Define the vendor unique id carried in the pass through data 223*/ 224#define AVRC_PDU_NEXT_GROUP 0x00 225#define AVRC_PDU_PREV_GROUP 0x01 226/* the only pass through vendor unique commands defined by AVRC is the group navigation commands 227 * The len for vendor unique data is 5 */ 228#define AVRC_PASS_THRU_GROUP_LEN 5 229 230#define AVRC_PDU_INVALID 0xff 231/* 6.15.3 error status code for general reject */ 232#define AVRC_STS_BAD_CMD 0x00 /* Invalid command, sent if TG received a PDU that it did not understand. */ 233#define AVRC_STS_BAD_PARAM 0x01 /* Invalid parameter, sent if the TG received a PDU with a parameter ID that it did not understand. Sent if there is only one parameter ID in the PDU. */ 234#define AVRC_STS_NOT_FOUND 0x02 /* Specified parameter not found., sent if the parameter ID is understood, but content is wrong or corrupted. */ 235#define AVRC_STS_INTERNAL_ERR 0x03 /* Internal Error, sent if there are error conditions not covered by a more specific error code. */ 236#define AVRC_STS_NO_ERROR 0x04 /* Operation completed without error. This is the status that should be returned if the operation was successful. */ 237#define AVRC_STS_UID_CHANGED 0x05 /* UID Changed - The UIDs on the device have changed */ 238/* #define AVRC_STS_GEN_ERROR 0x06 Unknown Error - this is changed to "reserved" */ 239#define AVRC_STS_BAD_DIR 0x07 /* Invalid Direction - The Direction parameter is invalid - Change Path*/ 240#define AVRC_STS_NOT_DIR 0x08 /* Not a Directory - The UID provided does not refer to a folder item Change Path*/ 241#define AVRC_STS_NOT_EXIST 0x09 /* Does Not Exist - The UID provided does not refer to any item Change Path, PlayItem, AddToNowPlaying, GetItemAttributes*/ 242#define AVRC_STS_BAD_SCOPE 0x0a /* Invalid Scope - The scope parameter is invalid GetFolderItems, PlayItem, AddToNowPlayer, GetItemAttributes, */ 243#define AVRC_STS_BAD_RANGE 0x0b /* Range Out of Bounds - The start of range provided is not valid GetFolderItems*/ 244#define AVRC_STS_UID_IS_DIR 0x0c /* UID is a Directory - The UID provided refers to a directory, which cannot be handled by this media player PlayItem, AddToNowPlaying */ 245#define AVRC_STS_IN_USE 0x0d /* Media in Use - The media is not able to be used for this operation at this time PlayItem, AddToNowPlaying */ 246#define AVRC_STS_NOW_LIST_FULL 0x0e /* Now Playing List Full - No more items can be added to the Now Playing List AddToNowPlaying*/ 247#define AVRC_STS_SEARCH_NOT_SUP 0x0f /* Search Not Supported - The Browsed Media Player does not support search Search */ 248#define AVRC_STS_SEARCH_BUSY 0x10 /* Search in Progress - A search operation is already in progress Search*/ 249#define AVRC_STS_BAD_PLAYER_ID 0x11 /* Invalid Player Id - The specified Player Id does not refer to a valid player SetAddressedPlayer, SetBrowsedPlayer*/ 250#define AVRC_STS_PLAYER_N_BR 0x12 /* Player Not Browsable - The Player Id supplied refers to a Media Player which does not support browsing. SetBrowsedPlayer */ 251#define AVRC_STS_PLAYER_N_ADDR 0x13 /* Player Not Addressed. The Player Id supplied refers to a player which is not currently addressed, and the command is not able to be performed if the player is not set as addressed. Search, SetBrowsedPlayer*/ 252#define AVRC_STS_BAD_SEARCH_RES 0x14 /* No valid Search Results - The Search result list does not contain valid entries, e.g. after being invalidated due to change of browsed player GetFolderItems */ 253#define AVRC_STS_NO_AVAL_PLAYER 0x15 /* No available players ALL */ 254#define AVRC_STS_ADDR_PLAYER_CHG 0x16 /* Addressed Player Changed - Register Notification */ 255typedef uint8_t tAVRC_STS; 256 257/* Define the Capability IDs 258*/ 259#define AVRC_CAP_COMPANY_ID 0x02 260#define AVRC_CAP_EVENTS_SUPPORTED 0x03 261#define AVRC_COMPANY_ID_LEN 3 262#define AVRC_CAPABILITY_OFFSET 2 263 264/* Define the Player Application Settings IDs 265*/ 266#define AVRC_PLAYER_SETTING_EQUALIZER 0x01 267#define AVRC_PLAYER_SETTING_REPEAT 0x02 268#define AVRC_PLAYER_SETTING_SHUFFLE 0x03 269#define AVRC_PLAYER_SETTING_SCAN 0x04 270#define AVRC_PLAYER_SETTING_LOW_MENU_EXT 0x80 271#define AVRC_PLAYER_SETTING_HIGH_MENU_EXT 0xff 272 273/* Define the possible values of the Player Application Settings 274*/ 275#define AVRC_PLAYER_VAL_OFF 0x01 276#define AVRC_PLAYER_VAL_ON 0x02 277#define AVRC_PLAYER_VAL_SINGLE_REPEAT 0x02 278#define AVRC_PLAYER_VAL_ALL_REPEAT 0x03 279#define AVRC_PLAYER_VAL_GROUP_REPEAT 0x04 280#define AVRC_PLAYER_VAL_ALL_SHUFFLE 0x02 281#define AVRC_PLAYER_VAL_GROUP_SHUFFLE 0x03 282#define AVRC_PLAYER_VAL_ALL_SCAN 0x02 283#define AVRC_PLAYER_VAL_GROUP_SCAN 0x03 284 285/* Define the possible values of Battery Status PDU 286*/ 287#define AVRC_BATTERY_STATUS_NORMAL 0x00 288#define AVRC_BATTERY_STATUS_WARNING 0x01 289#define AVRC_BATTERY_STATUS_CRITICAL 0x02 290#define AVRC_BATTERY_STATUS_EXTERNAL 0x03 291#define AVRC_BATTERY_STATUS_FULL_CHARGE 0x04 292typedef uint8_t tAVRC_BATTERY_STATUS; 293 294/* Define character set */ 295#define AVRC_CHAR_SET_SIZE 2 296 297/* Define the Media Attribute IDs 298*/ 299#define AVRC_MEDIA_ATTR_ID_TITLE 0x00000001 300#define AVRC_MEDIA_ATTR_ID_ARTIST 0x00000002 301#define AVRC_MEDIA_ATTR_ID_ALBUM 0x00000003 302#define AVRC_MEDIA_ATTR_ID_TRACK_NUM 0x00000004 303#define AVRC_MEDIA_ATTR_ID_NUM_TRACKS 0x00000005 304#define AVRC_MEDIA_ATTR_ID_GENRE 0x00000006 305#define AVRC_MEDIA_ATTR_ID_PLAYING_TIME 0x00000007 /* in miliseconds */ 306#define AVRC_MAX_NUM_MEDIA_ATTR_ID 7 307 308/* Define the possible values of play state 309*/ 310#define AVRC_PLAYSTATE_RESP_MSG_SIZE 9 311#define AVRC_PLAYSTATE_STOPPED 0x00 /* Stopped */ 312#define AVRC_PLAYSTATE_PLAYING 0x01 /* Playing */ 313#define AVRC_PLAYSTATE_PAUSED 0x02 /* Paused */ 314#define AVRC_PLAYSTATE_FWD_SEEK 0x03 /* Fwd Seek*/ 315#define AVRC_PLAYSTATE_REV_SEEK 0x04 /* Rev Seek*/ 316#define AVRC_PLAYSTATE_ERROR 0xFF /* Error */ 317typedef uint8_t tAVRC_PLAYSTATE; 318 319/* Define the events that can be registered for notifications 320*/ 321#define AVRC_EVT_PLAY_STATUS_CHANGE 0x01 322#define AVRC_EVT_TRACK_CHANGE 0x02 323#define AVRC_EVT_TRACK_REACHED_END 0x03 324#define AVRC_EVT_TRACK_REACHED_START 0x04 325#define AVRC_EVT_PLAY_POS_CHANGED 0x05 326#define AVRC_EVT_BATTERY_STATUS_CHANGE 0x06 327#define AVRC_EVT_SYSTEM_STATUS_CHANGE 0x07 328#define AVRC_EVT_APP_SETTING_CHANGE 0x08 329/* added in AVRCP 1.4 */ 330#define AVRC_EVT_NOW_PLAYING_CHANGE 0x09 331#define AVRC_EVT_AVAL_PLAYERS_CHANGE 0x0a 332#define AVRC_EVT_ADDR_PLAYER_CHANGE 0x0b 333#define AVRC_EVT_UIDS_CHANGE 0x0c 334#define AVRC_EVT_VOLUME_CHANGE 0x0d 335 336/* the number of events that can be registered for notifications */ 337#define AVRC_NUM_NOTIF_EVENTS 0x0d 338 339#define AVRC_EVT_MSG_LEN_1 0x01 340#define AVRC_EVT_MSG_LEN_2 0x02 341#define AVRC_EVT_MSG_LEN_5 0x05 342#define AVRC_EVT_MSG_LEN_9 0x09 343 344#define AVRC_MAX_VOLUME 0x7F 345 346/* Define the possible values of system status 347*/ 348#define AVRC_SYSTEMSTATE_PWR_ON 0x00 349#define AVRC_SYSTEMSTATE_PWR_OFF 0x01 350#define AVRC_SYSTEMSTATE_PWR_UNPLUGGED 0x02 351typedef uint8_t tAVRC_SYSTEMSTATE; 352 353/* the frequently used character set ids */ 354#define AVRC_CHARSET_ID_ASCII ((uint16_t) 0x0003) /* ASCII */ 355#define AVRC_CHARSET_ID_UTF8 ((uint16_t) 0x006a) /* UTF-8 */ 356#define AVRC_CHARSET_ID_UTF16 ((uint16_t) 0x03f7) /* 1015 */ 357#define AVRC_CHARSET_ID_UTF32 ((uint16_t) 0x03f9) /* 1017 */ 358 359/***************************************************************************** 360 * Advanced Control 361 ****************************************************************************/ 362#define AVRC_ITEM_PLAYER 0x01 363#define AVRC_ITEM_FOLDER 0x02 364#define AVRC_ITEM_MEDIA 0x03 365 366#define AVRC_SCOPE_PLAYER_LIST 0x00 /* Media Player Item - Contains all available media players */ 367#define AVRC_SCOPE_FILE_SYSTEM 0x01 /* Folder Item, Media Element Item 368 - The virtual filesystem containing the media content of the browsed player */ 369#define AVRC_SCOPE_SEARCH 0x02 /* Media Element Item The results of a search operation on the browsed player */ 370#define AVRC_SCOPE_NOW_PLAYING 0x03 /* Media Element Item The Now Playing list (or queue) of the addressed player */ 371 372#define AVRC_FOLDER_ITEM_COUNT_NONE 0xFF 373 374/* folder type */ 375#define AVRC_FOLDER_TYPE_MIXED 0x00 376#define AVRC_FOLDER_TYPE_TITLES 0x01 377#define AVRC_FOLDER_TYPE_ALNUMS 0x02 378#define AVRC_FOLDER_TYPE_ARTISTS 0x03 379#define AVRC_FOLDER_TYPE_GENRES 0x04 380#define AVRC_FOLDER_TYPE_PLAYLISTS 0x05 381#define AVRC_FOLDER_TYPE_YEARS 0x06 382 383/* major player type */ 384#define AVRC_MJ_TYPE_AUDIO 0x01 /* Audio */ 385#define AVRC_MJ_TYPE_VIDEO 0x02 /* Video */ 386#define AVRC_MJ_TYPE_BC_AUDIO 0x04 /* Broadcasting Audio */ 387#define AVRC_MJ_TYPE_BC_VIDEO 0x08 /* Broadcasting Video */ 388#define AVRC_MJ_TYPE_INVALID 0xF0 389 390/* player sub type */ 391#define AVRC_SUB_TYPE_NONE 0x00 392#define AVRC_SUB_TYPE_AUDIO_BOOK 0x01 /* Audio Book */ 393#define AVRC_SUB_TYPE_PODCAST 0x02 /* Podcast */ 394#define AVRC_SUB_TYPE_INVALID 0xFC 395 396/* media item - media type */ 397#define AVRC_MEDIA_TYPE_AUDIO 0x00 398#define AVRC_MEDIA_TYPE_VIDEO 0x01 399 400#define AVRC_DIR_UP 0x00 /* Folder Up */ 401#define AVRC_DIR_DOWN 0x01 /* Folder Down */ 402 403#define AVRC_UID_SIZE 8 404typedef uint8_t tAVRC_UID[AVRC_UID_SIZE]; 405 406/***************************************************************************** 407 * player attribute - supported features 408 ****************************************************************************/ 409#define AVRC_PF_SELECT_BIT_NO 0 410#define AVRC_PF_SELECT_MASK 0x01 411#define AVRC_PF_SELECT_OFF 0 412#define AVRC_PF_SELECT_SUPPORTED(x) ((x)[AVRC_PF_SELECT_OFF] & AVRC_PF_SELECT_MASK) 413 414#define AVRC_PF_UP_BIT_NO 1 415#define AVRC_PF_UP_MASK 0x02 416#define AVRC_PF_UP_OFF 0 417#define AVRC_PF_UP_SUPPORTED(x) ((x)[AVRC_PF_UP_OFF] & AVRC_PF_UP_MASK) 418 419#define AVRC_PF_DOWN_BIT_NO 2 420#define AVRC_PF_DOWN_MASK 0x04 421#define AVRC_PF_DOWN_OFF 0 422#define AVRC_PF_DOWN_SUPPORTED(x) ((x)[AVRC_PF_DOWN_OFF] & AVRC_PF_DOWN_MASK) 423 424#define AVRC_PF_LEFT_BIT_NO 3 425#define AVRC_PF_LEFT_MASK 0x08 426#define AVRC_PF_LEFT_OFF 0 427#define AVRC_PF_LEFT_SUPPORTED(x) ((x)[AVRC_PF_LEFT_OFF] & AVRC_PF_LEFT_MASK) 428 429#define AVRC_PF_RIGHT_BIT_NO 4 430#define AVRC_PF_RIGHT_MASK 0x10 431#define AVRC_PF_RIGHT_OFF 0 432#define AVRC_PF_RIGHT_SUPPORTED(x) ((x)[AVRC_PF_RIGHT_OFF] & AVRC_PF_RIGHT_MASK) 433 434#define AVRC_PF_RIGHTUP_BIT_NO 5 435#define AVRC_PF_RIGHTUP_MASK 0x20 436#define AVRC_PF_RIGHTUP_OFF 0 437#define AVRC_PF_RIGHTUP_SUPPORTED(x) ((x)[AVRC_PF_RIGHTUP_OFF] & AVRC_PF_RIGHTUP_MASK) 438 439#define AVRC_PF_RIGHTDOWN_BIT_NO 6 440#define AVRC_PF_RIGHTDOWN_MASK 0x40 441#define AVRC_PF_RIGHTDOWN_OFF 0 442#define AVRC_PF_RIGHTDOWN_SUPPORTED(x) ((x)[AVRC_PF_RIGHTDOWN_OFF] & AVRC_PF_RIGHTDOWN_MASK) 443 444#define AVRC_PF_LEFTUP_BIT_NO 7 445#define AVRC_PF_LEFTUP_MASK 0x80 446#define AVRC_PF_LEFTUP_OFF 0 447#define AVRC_PF_LEFTUP_SUPPORTED(x) ((x)[AVRC_PF_LEFTUP_OFF] & AVRC_PF_LEFTUP_MASK) 448 449#define AVRC_PF_LEFTDOWN_BIT_NO 8 450#define AVRC_PF_LEFTDOWN_MASK 0x01 451#define AVRC_PF_LEFTDOWN_OFF 1 452#define AVRC_PF_LEFTDOWN_SUPPORTED(x) ((x)[AVRC_PF_LEFTDOWN_OFF] & AVRC_PF_LEFTDOWN_MASK) 453 454#define AVRC_PF_ROOT_MENU_BIT_NO 9 455#define AVRC_PF_ROOT_MENU_MASK 0x02 456#define AVRC_PF_ROOT_MENU_OFF 1 457#define AVRC_PF_ROOT_MENU_SUPPORTED(x) ((x)[AVRC_PF_ROOT_MENU_OFF] & AVRC_PF_ROOT_MENU_MASK) 458 459#define AVRC_PF_SETUP_MENU_BIT_NO 10 460#define AVRC_PF_SETUP_MENU_MASK 0x04 461#define AVRC_PF_SETUP_MENU_OFF 1 462#define AVRC_PF_SETUP_MENU_SUPPORTED(x) ((x)[AVRC_PF_SETUP_MENU_OFF] & AVRC_PF_SETUP_MENU_MASK) 463 464#define AVRC_PF_CONTENTS_MENU_BIT_NO 11 465#define AVRC_PF_CONTENTS_MENU_MASK 0x08 466#define AVRC_PF_CONTENTS_MENU_OFF 1 467#define AVRC_PF_CONTENTS_MENU_SUPPORTED(x) ((x)[AVRC_PF_CONTENTS_MENU_OFF] & AVRC_PF_CONTENTS_MENU_MASK) 468 469#define AVRC_PF_FAVORITE_MENU_BIT_NO 12 470#define AVRC_PF_FAVORITE_MENU_MASK 0x10 471#define AVRC_PF_FAVORITE_MENU_OFF 1 472#define AVRC_PF_FAVORITE_MENU_SUPPORTED(x) ((x)[AVRC_PF_FAVORITE_MENU_OFF] & AVRC_PF_FAVORITE_MENU_MASK) 473 474#define AVRC_PF_EXIT_BIT_NO 13 475#define AVRC_PF_EXIT_MASK 0x20 476#define AVRC_PF_EXIT_OFF 1 477#define AVRC_PF_EXIT_SUPPORTED(x) ((x)[AVRC_PF_EXIT_OFF] & AVRC_PF_EXIT_MASK) 478 479#define AVRC_PF_0_BIT_NO 14 480#define AVRC_PF_0_MASK 0x40 481#define AVRC_PF_0_OFF 1 482#define AVRC_PF_0_SUPPORTED(x) ((x)[AVRC_PF_0_OFF] & AVRC_PF_0_MASK) 483 484#define AVRC_PF_1_BIT_NO 15 485#define AVRC_PF_1_MASK 0x80 486#define AVRC_PF_1_OFF 1 487#define AVRC_PF_1_SUPPORTED(x) ((x)[AVRC_PF_1_OFF] & AVRC_PF_1_MASK) 488 489#define AVRC_PF_2_BIT_NO 16 490#define AVRC_PF_2_MASK 0x01 491#define AVRC_PF_2_OFF 2 492#define AVRC_PF_2_SUPPORTED(x) ((x)[AVRC_PF_2_OFF] & AVRC_PF_2_MASK) 493 494#define AVRC_PF_3_BIT_NO 17 495#define AVRC_PF_3_MASK 0x02 496#define AVRC_PF_3_OFF 2 497#define AVRC_PF_3_SUPPORTED(x) ((x)[AVRC_PF_3_OFF] & AVRC_PF_3_MASK) 498 499#define AVRC_PF_4_BIT_NO 18 500#define AVRC_PF_4_MASK 0x04 501#define AVRC_PF_4_OFF 2 502#define AVRC_PF_4_SUPPORTED(x) ((x)[AVRC_PF_4_OFF] & AVRC_PF_4_MASK) 503 504#define AVRC_PF_5_BIT_NO 19 505#define AVRC_PF_5_MASK 0x08 506#define AVRC_PF_5_OFF 2 507#define AVRC_PF_5_SUPPORTED(x) ((x)[AVRC_PF_5_OFF] & AVRC_PF_5_MASK) 508 509#define AVRC_PF_6_BIT_NO 20 510#define AVRC_PF_6_MASK 0x10 511#define AVRC_PF_6_OFF 2 512#define AVRC_PF_6_SUPPORTED(x) ((x)[AVRC_PF_6_OFF] & AVRC_PF_6_MASK) 513 514#define AVRC_PF_7_BIT_NO 21 515#define AVRC_PF_7_MASK 0x20 516#define AVRC_PF_7_OFF 2 517#define AVRC_PF_7_SUPPORTED(x) ((x)[AVRC_PF_7_OFF] & AVRC_PF_7_MASK) 518 519#define AVRC_PF_8_BIT_NO 22 520#define AVRC_PF_8_MASK 0x40 521#define AVRC_PF_8_OFF 2 522#define AVRC_PF_8_SUPPORTED(x) ((x)[AVRC_PF_8_OFF] & AVRC_PF_8_MASK) 523 524#define AVRC_PF_9_BIT_NO 23 525#define AVRC_PF_9_MASK 0x80 526#define AVRC_PF_9_OFF 2 527#define AVRC_PF_9_SUPPORTED(x) ((x)[AVRC_PF_9_OFF] & AVRC_PF_9_MASK) 528 529#define AVRC_PF_DOT_BIT_NO 24 530#define AVRC_PF_DOT_MASK 0x01 531#define AVRC_PF_DOT_OFF 3 532#define AVRC_PF_DOT_SUPPORTED(x) ((x)[AVRC_PF_DOT_OFF] & AVRC_PF_DOT_MASK) 533 534#define AVRC_PF_ENTER_BIT_NO 25 535#define AVRC_PF_ENTER_MASK 0x02 536#define AVRC_PF_ENTER_OFF 3 537#define AVRC_PF_ENTER_SUPPORTED(x) ((x)[AVRC_PF_ENTER_OFF] & AVRC_PF_ENTER_MASK) 538 539#define AVRC_PF_CLEAR_BIT_NO 26 540#define AVRC_PF_CLEAR_MASK 0x04 541#define AVRC_PF_CLEAR_OFF 3 542#define AVRC_PF_CLEAR_SUPPORTED(x) ((x)[AVRC_PF_CLEAR_OFF] & AVRC_PF_CLEAR_MASK) 543 544#define AVRC_PF_CHNL_UP_BIT_NO 27 545#define AVRC_PF_CHNL_UP_MASK 0x08 546#define AVRC_PF_CHNL_UP_OFF 3 547#define AVRC_PF_CHNL_UP_SUPPORTED(x) ((x)[AVRC_PF_CHNL_UP_OFF] & AVRC_PF_CHNL_UP_MASK) 548 549#define AVRC_PF_CHNL_DOWN_BIT_NO 28 550#define AVRC_PF_CHNL_DOWN_MASK 0x10 551#define AVRC_PF_CHNL_DOWN_OFF 3 552#define AVRC_PF_CHNL_DOWN_SUPPORTED(x) ((x)[AVRC_PF_CHNL_DOWN_OFF] & AVRC_PF_CHNL_DOWN_MASK) 553 554#define AVRC_PF_PREV_CHNL_BIT_NO 29 555#define AVRC_PF_PREV_CHNL_MASK 0x20 556#define AVRC_PF_PREV_CHNL_OFF 3 557#define AVRC_PF_PREV_CHNL_SUPPORTED(x) ((x)[AVRC_PF_PREV_CHNL_OFF] & AVRC_PF_PREV_CHNL_MASK) 558 559#define AVRC_PF_SOUND_SEL_BIT_NO 30 560#define AVRC_PF_SOUND_SEL_MASK 0x40 561#define AVRC_PF_SOUND_SEL_OFF 3 562#define AVRC_PF_SOUND_SEL_SUPPORTED(x) ((x)[AVRC_PF_SOUND_SEL_OFF] & AVRC_PF_SOUND_SEL_MASK) 563 564#define AVRC_PF_INPUT_SEL_BIT_NO 31 565#define AVRC_PF_INPUT_SEL_MASK 0x80 566#define AVRC_PF_INPUT_SEL_OFF 3 567#define AVRC_PF_INPUT_SEL_SUPPORTED(x) ((x)[AVRC_PF_INPUT_SEL_OFF] & AVRC_PF_INPUT_SEL_MASK) 568 569#define AVRC_PF_DISP_INFO_BIT_NO 32 570#define AVRC_PF_DISP_INFO_MASK 0x01 571#define AVRC_PF_DISP_INFO_OFF 4 572#define AVRC_PF_DISP_INFO_SUPPORTED(x) ((x)[AVRC_PF_DISP_INFO_OFF] & AVRC_PF_DISP_INFO_MASK) 573 574#define AVRC_PF_HELP_BIT_NO 33 575#define AVRC_PF_HELP_MASK 0x02 576#define AVRC_PF_HELP_OFF 4 577#define AVRC_PF_HELP_SUPPORTED(x) ((x)[AVRC_PF_HELP_OFF] & AVRC_PF_HELP_MASK) 578 579#define AVRC_PF_PAGE_UP_BIT_NO 34 580#define AVRC_PF_PAGE_UP_MASK 0x04 581#define AVRC_PF_PAGE_UP_OFF 4 582#define AVRC_PF_PAGE_UP_SUPPORTED(x) ((x)[AVRC_PF_PAGE_UP_OFF] & AVRC_PF_PAGE_UP_MASK) 583 584#define AVRC_PF_PAGE_DOWN_BIT_NO 35 585#define AVRC_PF_PAGE_DOWN_MASK 0x08 586#define AVRC_PF_PAGE_DOWN_OFF 4 587#define AVRC_PF_PAGE_DOWN_SUPPORTED(x) ((x)[AVRC_PF_PAGE_DOWN_OFF] & AVRC_PF_PAGE_DOWN_MASK) 588 589#define AVRC_PF_POWER_BIT_NO 36 590#define AVRC_PF_POWER_MASK 0x10 591#define AVRC_PF_POWER_OFF 4 592#define AVRC_PF_POWER_SUPPORTED(x) ((x)[AVRC_PF_POWER_OFF] & AVRC_PF_POWER_MASK) 593 594#define AVRC_PF_VOL_UP_BIT_NO 37 595#define AVRC_PF_VOL_UP_MASK 0x20 596#define AVRC_PF_VOL_UP_OFF 4 597#define AVRC_PF_VOL_UP_SUPPORTED(x) ((x)[AVRC_PF_VOL_UP_OFF] & AVRC_PF_VOL_UP_MASK) 598 599#define AVRC_PF_VOL_DOWN_BIT_NO 38 600#define AVRC_PF_VOL_DOWN_MASK 0x40 601#define AVRC_PF_VOL_DOWN_OFF 4 602#define AVRC_PF_VOL_DOWN_SUPPORTED(x) ((x)[AVRC_PF_VOL_DOWN_OFF] & AVRC_PF_VOL_DOWN_MASK) 603 604#define AVRC_PF_MUTE_BIT_NO 39 605#define AVRC_PF_MUTE_MASK 0x80 606#define AVRC_PF_MUTE_OFF 4 607#define AVRC_PF_MUTE_SUPPORTED(x) ((x)[AVRC_PF_MUTE_OFF] & AVRC_PF_MUTE_MASK) 608 609#define AVRC_PF_PLAY_BIT_NO 40 610#define AVRC_PF_PLAY_MASK 0x01 611#define AVRC_PF_PLAY_OFF 5 612#define AVRC_PF_PLAY_SUPPORTED(x) ((x)[AVRC_PF_PLAY_OFF] & AVRC_PF_PLAY_MASK) 613 614#define AVRC_PF_STOP_BIT_NO 41 615#define AVRC_PF_STOP_MASK 0x02 616#define AVRC_PF_STOP_OFF 5 617#define AVRC_PF_STOP_SUPPORTED(x) ((x)[AVRC_PF_STOP_OFF] & AVRC_PF_STOP_MASK) 618 619#define AVRC_PF_PAUSE_BIT_NO 42 620#define AVRC_PF_PAUSE_MASK 0x04 621#define AVRC_PF_PAUSE_OFF 5 622#define AVRC_PF_PAUSE_SUPPORTED(x) ((x)[AVRC_PF_PAUSE_OFF] & AVRC_PF_PAUSE_MASK) 623 624#define AVRC_PF_RECORD_BIT_NO 43 625#define AVRC_PF_RECORD_MASK 0x08 626#define AVRC_PF_RECORD_OFF 5 627#define AVRC_PF_RECORD_SUPPORTED(x) ((x)[AVRC_PF_RECORD_OFF] & AVRC_PF_RECORD_MASK) 628 629#define AVRC_PF_REWIND_BIT_NO 44 630#define AVRC_PF_REWIND_MASK 0x10 631#define AVRC_PF_REWIND_OFF 5 632#define AVRC_PF_REWIND_SUPPORTED(x) ((x)[AVRC_PF_REWIND_OFF] & AVRC_PF_REWIND_MASK) 633 634#define AVRC_PF_FAST_FWD_BIT_NO 45 635#define AVRC_PF_FAST_FWD_MASK 0x20 636#define AVRC_PF_FAST_FWD_OFF 5 637#define AVRC_PF_FAST_FWD_SUPPORTED(x) ((x)[AVRC_PF_FAST_FWD_OFF] & AVRC_PF_FAST_FWD_MASK) 638 639#define AVRC_PF_EJECT_BIT_NO 46 640#define AVRC_PF_EJECT_MASK 0x40 641#define AVRC_PF_EJECT_OFF 5 642#define AVRC_PF_EJECT_SUPPORTED(x) ((x)[AVRC_PF_EJECT_OFF] & AVRC_PF_EJECT_MASK) 643 644#define AVRC_PF_FORWARD_BIT_NO 47 645#define AVRC_PF_FORWARD_MASK 0x80 646#define AVRC_PF_FORWARD_OFF 5 647#define AVRC_PF_FORWARD_SUPPORTED(x) ((x)[AVRC_PF_FORWARD_OFF] & AVRC_PF_FORWARD_MASK) 648 649#define AVRC_PF_BACKWARD_BIT_NO 48 650#define AVRC_PF_BACKWARD_MASK 0x01 651#define AVRC_PF_BACKWARD_OFF 6 652#define AVRC_PF_BACKWARD_SUPPORTED(x) ((x)[AVRC_PF_BACKWARD_OFF] & AVRC_PF_BACKWARD_MASK) 653 654#define AVRC_PF_ANGLE_BIT_NO 49 655#define AVRC_PF_ANGLE_MASK 0x02 656#define AVRC_PF_ANGLE_OFF 6 657#define AVRC_PF_ANGLE_SUPPORTED(x) ((x)[AVRC_PF_ANGLE_OFF] & AVRC_PF_ANGLE_MASK) 658 659#define AVRC_PF_SUBPICTURE_BIT_NO 50 660#define AVRC_PF_SUBPICTURE_MASK 0x04 661#define AVRC_PF_SUBPICTURE_OFF 6 662#define AVRC_PF_SUBPICTURE_SUPPORTED(x) ((x)[AVRC_PF_SUBPICTURE_OFF] & AVRC_PF_SUBPICTURE_MASK) 663 664#define AVRC_PF_F1_BIT_NO 51 665#define AVRC_PF_F1_MASK 0x08 666#define AVRC_PF_F1_OFF 6 667#define AVRC_PF_F1_SUPPORTED(x) ((x)[AVRC_PF_F1_OFF] & AVRC_PF_F1_MASK) 668 669#define AVRC_PF_F2_BIT_NO 52 670#define AVRC_PF_F2_MASK 0x10 671#define AVRC_PF_F2_OFF 6 672#define AVRC_PF_F2_SUPPORTED(x) ((x)[AVRC_PF_F2_OFF] & AVRC_PF_F2_MASK) 673 674#define AVRC_PF_F3_BIT_NO 53 675#define AVRC_PF_F3_MASK 0x20 676#define AVRC_PF_F3_OFF 6 677#define AVRC_PF_F3_SUPPORTED(x) ((x)[AVRC_PF_F3_OFF] & AVRC_PF_F3_MASK) 678 679#define AVRC_PF_F4_BIT_NO 54 680#define AVRC_PF_F4_MASK 0x40 681#define AVRC_PF_F4_OFF 6 682#define AVRC_PF_F4_SUPPORTED(x) ((x)[AVRC_PF_F4_OFF] & AVRC_PF_F4_MASK) 683 684#define AVRC_PF_F5_BIT_NO 55 685#define AVRC_PF_F5_MASK 0x80 686#define AVRC_PF_F5_OFF 6 687#define AVRC_PF_F5_SUPPORTED(x) ((x)[AVRC_PF_F5_OFF] & AVRC_PF_F5_MASK) 688 689/* Vendor unique. This PASSTHROUGH command is supported. */ 690#define AVRC_PF_VENDOR_BIT_NO 56 691#define AVRC_PF_VENDOR_MASK 0x01 692#define AVRC_PF_VENDOR_OFF 7 693#define AVRC_PF_VENDOR_SUPPORTED(x) ((x)[AVRC_PF_VENDOR_OFF] & AVRC_PF_VENDOR_MASK) 694 695/* Basic Group Navigation. This overrules the SDP entry as it is set per player.7 */ 696#define AVRC_PF_GROUP_NAVI_BIT_NO 57 697#define AVRC_PF_GROUP_NAVI_MASK 0x02 698#define AVRC_PF_GROUP_NAVI_OFF 7 699#define AVRC_PF_GROUP_NAVI_SUPPORTED(x) ((x)[AVRC_PF_GROUP_NAVI_OFF] & AVRC_PF_GROUP_NAVI_MASK) 700 701/* Advanced Control Player. This bit is set if the player supports at least AVRCP 1.4. */ 702#define AVRC_PF_ADV_CTRL_BIT_NO 58 703#define AVRC_PF_ADV_CTRL_MASK 0x04 704#define AVRC_PF_ADV_CTRL_OFF 7 705#define AVRC_PF_ADV_CTRL_SUPPORTED(x) ((x)[AVRC_PF_ADV_CTRL_OFF] & AVRC_PF_ADV_CTRL_MASK) 706 707/* Browsing. This bit is set if the player supports browsing. */ 708#define AVRC_PF_BROWSE_BIT_NO 59 709#define AVRC_PF_BROWSE_MASK 0x08 710#define AVRC_PF_BROWSE_OFF 7 711#define AVRC_PF_BROWSE_SUPPORTED(x) ((x)[AVRC_PF_BROWSE_OFF] & AVRC_PF_BROWSE_MASK) 712 713/* Searching. This bit is set if the player supports searching. */ 714#define AVRC_PF_SEARCH_BIT_NO 60 715#define AVRC_PF_SEARCH_MASK 0x10 716#define AVRC_PF_SEARCH_OFF 7 717#define AVRC_PF_SEARCH_SUPPORTED(x) ((x)[AVRC_PF_SEARCH_OFF] & AVRC_PF_SEARCH_MASK) 718 719/* AddToNowPlaying. This bit is set if the player supports the AddToNowPlaying command. */ 720#define AVRC_PF_ADD2NOWPLAY_BIT_NO 61 721#define AVRC_PF_ADD2NOWPLAY_MASK 0x20 722#define AVRC_PF_ADD2NOWPLAY_OFF 7 723#define AVRC_PF_ADD2NOWPLAY_SUPPORTED(x) ((x)[AVRC_PF_ADD2NOWPLAY_OFF] & AVRC_PF_ADD2NOWPLAY_MASK) 724 725/* UIDs unique in player browse tree. This bit is set if the player is able to maintain unique UIDs across the player browse tree. */ 726#define AVRC_PF_UID_UNIQUE_BIT_NO 62 727#define AVRC_PF_UID_UNIQUE_MASK 0x40 728#define AVRC_PF_UID_UNIQUE_OFF 7 729#define AVRC_PF_UID_UNIQUE_SUPPORTED(x) ((x)[AVRC_PF_UID_UNIQUE_OFF] & AVRC_PF_UID_UNIQUE_MASK) 730 731/* OnlyBrowsableWhenAddressed. This bit is set if the player is only able to be browsed when it is set as the Addressed Player. */ 732#define AVRC_PF_BR_WH_ADDR_BIT_NO 63 733#define AVRC_PF_BR_WH_ADDR_MASK 0x80 734#define AVRC_PF_BR_WH_ADDR_OFF 7 735#define AVRC_PF_BR_WH_ADDR_SUPPORTED(x) ((x)[AVRC_PF_BR_WH_ADDR_OFF] & AVRC_PF_BR_WH_ADDR_MASK) 736 737/* OnlySearchableWhenAddressed. This bit is set if the player is only able to be searched when it is set as the Addressed player. */ 738#define AVRC_PF_SEARCH_WH_ADDR_BIT_NO 64 739#define AVRC_PF_SEARCH_WH_ADDR_MASK 0x01 740#define AVRC_PF_SEARCH_WH_ADDR_OFF 8 741#define AVRC_PF_SEARCH_WH_ADDR_SUPPORTED(x) ((x)[AVRC_PF_SEARCH_WH_ADDR_OFF] & AVRC_PF_SEARCH_WH_ADDR_MASK) 742 743/* NowPlaying. This bit is set if the player supports the NowPlaying folder. Note that for all players that support browsing this bit shall be set */ 744#define AVRC_PF_NOW_PLAY_BIT_NO 65 745#define AVRC_PF_NOW_PLAY_MASK 0x02 746#define AVRC_PF_NOW_PLAY_OFF 8 747#define AVRC_PF_NOW_PLAY_SUPPORTED(x) ((x)[AVRC_PF_NOW_PLAY_OFF] & AVRC_PF_NOW_PLAY_MASK) 748 749/* UIDPersistency. This bit is set if the Player is able to persist UID values between AVRCP Browse Reconnect */ 750#define AVRC_PF_UID_PERSIST_BIT_NO 66 751#define AVRC_PF_UID_PERSIST_MASK 0x04 752#define AVRC_PF_UID_PERSIST_OFF 8 753#define AVRC_PF_UID_PERSIST_SUPPORTED(x) ((x)[AVRC_PF_UID_PERSIST_OFF] & AVRC_PF_UID_PERSIST_MASK) 754 755/* NumberOfItems. This bit is set if player supports the GetTotalNumberOfItems browsing command. */ 756#define AVRC_PF_GET_NUM_OF_ITEMS_BIT_NO 67 757#define AVRC_PF_GET_NUM_OF_ITEMS_MASK 0x08 758#define AVRC_PF_GET_NUM_OF_ITEMS_OFF 8 759#define AVRC_PF_GET_NUM_OF_ITEMS_SUPPORTED(x) ((x)[AVRC_PF_GET_NUM_OF_ITEMS_OFF] & AVRC_PF_GET_NUM_OF_ITEMS_MASK) 760 761/***************************************************************************** 762 * data type definitions 763 ****************************************************************************/ 764 765/* 766This structure contains the header parameters of an AV/C message. 767*/ 768typedef struct 769{ 770 uint8_t ctype; /* Command type. */ 771 uint8_t subunit_type; /* Subunit type. */ 772 uint8_t subunit_id; /* Subunit ID. This value is typically ignored in AVRCP, 773 * except for VENDOR DEPENDENT messages when the value is 774 * vendor-dependent. Value range is 0-7. */ 775 uint8_t opcode; /* Op Code (passthrough, vendor, etc) */ 776} tAVRC_HDR; 777 778/* This structure contains a UNIT INFO message. */ 779typedef struct 780{ 781 tAVRC_HDR hdr; /* Message header. */ 782 uint32_t company_id; /* Company identifier. */ 783 uint8_t unit_type; /* Unit type. Uses the same values as subunit type. */ 784 uint8_t unit; /* This value is vendor dependent and typically zero. */ 785} tAVRC_MSG_UNIT; 786 787/* This structure contains a SUBUNIT INFO message. */ 788typedef struct 789{ 790 tAVRC_HDR hdr; /* Message header. */ 791 uint8_t subunit_type[AVRC_SUB_TYPE_LEN]; 792 /* Array containing subunit type values. */ 793 bool panel; /* true if the panel subunit type is in the 794 * subunit_type array, false otherwise. */ 795 uint8_t page; /* Specifies which part of the subunit type table is 796 * returned. For AVRCP it is typically zero. 797 * Value range is 0-7. */ 798} tAVRC_MSG_SUB; 799 800/* This structure contains a VENDOR DEPENDENT message. */ 801typedef struct 802{ 803 tAVRC_HDR hdr; /* Message header. */ 804 uint32_t company_id; /* Company identifier. */ 805 uint8_t *p_vendor_data;/* Pointer to vendor dependent data. */ 806 uint16_t vendor_len; /* Length in bytes of vendor dependent data. */ 807} tAVRC_MSG_VENDOR; 808 809/* PASS THROUGH message structure */ 810typedef struct 811{ 812 tAVRC_HDR hdr; /* hdr.ctype Unused. 813 * hdr.subunit_type Unused. 814 * hdr.subunit_id Unused. */ 815 uint8_t op_id; /* Operation ID. */ 816 uint8_t state; /* Keypress state. */ 817 uint8_t *p_pass_data;/* Pointer to data. This parameter is only valid 818 * when the op_id is AVRC_ID_VENDOR.*/ 819 uint8_t pass_len; /* Length in bytes of data. This parameter is only 820 * valid when the op_id is AVRC_ID_VENDOR.*/ 821} tAVRC_MSG_PASS; 822 823/* Command/Response indicator. */ 824#define AVRC_CMD AVCT_CMD /* Command message */ 825#define AVRC_RSP AVCT_RSP /* Response message */ 826 827/* Browsing channel message structure */ 828typedef struct 829{ 830 tAVRC_HDR hdr; /* hdr.ctype AVRC_CMD or AVRC_RSP. 831 * hdr.subunit_type Unused. 832 * hdr.subunit_id Unused. */ 833 uint8_t *p_browse_data; /* Pointer to data. */ 834 uint16_t browse_len; /* Length in bytes of data. */ 835 BT_HDR *p_browse_pkt; /* The GKI buffer received. Set to NULL, if the callback function wants to keep the buffer */ 836} tAVRC_MSG_BROWSE; 837 838/* This is a union of all message type structures. */ 839typedef union 840{ 841 tAVRC_HDR hdr; /* Message header. */ 842 tAVRC_MSG_UNIT unit; /* UNIT INFO message. */ 843 tAVRC_MSG_SUB sub; /* SUBUNIT INFO message. */ 844 tAVRC_MSG_VENDOR vendor; /* VENDOR DEPENDENT message. */ 845 tAVRC_MSG_PASS pass; /* PASS THROUGH message. */ 846 tAVRC_MSG_BROWSE browse; /* messages thru browsing channel */ 847} tAVRC_MSG; 848 849/* macros */ 850#define AVRC_IS_VALID_CAP_ID(a) ((((a) == AVRC_CAP_COMPANY_ID) || ((a) == AVRC_CAP_EVENTS_SUPPORTED)) ? true : false) 851 852#define AVRC_IS_VALID_EVENT_ID(a) ((((a) >= AVRC_EVT_PLAY_STATUS_CHANGE) && \ 853 ((a) <= AVRC_EVT_VOLUME_CHANGE)) ? true : false) 854 855#define AVRC_IS_VALID_ATTRIBUTE(a) ((((((a) > 0) && (a) <= AVRC_PLAYER_SETTING_SCAN)) || \ 856 ((a) >= AVRC_PLAYER_SETTING_LOW_MENU_EXT)) ? true : false) 857 858#define AVRC_IS_VALID_MEDIA_ATTRIBUTE(a) (((a) >= AVRC_MEDIA_ATTR_ID_TITLE) && \ 859 ((a) <= AVRC_MEDIA_ATTR_ID_PLAYING_TIME) ? true : false) 860 861#define AVRC_IS_VALID_BATTERY_STATUS(a) (((a) <= AVRC_BATTERY_STATUS_FULL_CHARGE) ? true : false) 862 863#define AVRC_IS_VALID_SYSTEM_STATUS(a) (((a) <= AVRC_SYSTEMSTATE_PWR_UNPLUGGED) ? true : false) 864 865#define AVRC_IS_VALID_GROUP(a) (((a) <= AVRC_PDU_PREV_GROUP) ? true : false) 866 867/* Company ID is 24-bit integer We can not use the macros in bt_types.h */ 868#define AVRC_CO_ID_TO_BE_STREAM(p, u32) {*(p)++ = (uint8_t)((u32) >> 16); *(p)++ = (uint8_t)((u32) >> 8); *(p)++ = (uint8_t)(u32); } 869#define AVRC_BE_STREAM_TO_CO_ID(u32, p) {(u32) = (((uint32_t)(*((p) + 2))) + (((uint32_t)(*((p) + 1))) << 8) + (((uint32_t)(*(p))) << 16)); (p) += 3;} 870 871/***************************************************************************** 872 * data type definitions 873 ****************************************************************************/ 874#define AVRC_MAX_APP_ATTR_SIZE 16 875#define AVRC_MAX_CHARSET_SIZE 16 876#define AVRC_MAX_ELEM_ATTR_SIZE 8 877 878/***************************************************************************** 879 * Metadata transfer Building/Parsing definitions 880 ****************************************************************************/ 881 882typedef struct { 883 uint16_t charset_id; 884 uint16_t str_len; 885 uint8_t *p_str; 886} tAVRC_FULL_NAME; 887 888typedef struct { 889 uint16_t str_len; 890 uint8_t *p_str; 891} tAVRC_NAME; 892 893#ifndef AVRC_CAP_MAX_NUM_COMP_ID 894#define AVRC_CAP_MAX_NUM_COMP_ID 4 895#endif 896 897#ifndef AVRC_CAP_MAX_NUM_EVT_ID 898#define AVRC_CAP_MAX_NUM_EVT_ID 16 899#endif 900 901typedef union 902{ 903 uint32_t company_id[AVRC_CAP_MAX_NUM_COMP_ID]; 904 uint8_t event_id[AVRC_CAP_MAX_NUM_EVT_ID]; 905} tAVRC_CAPS_PARAM; 906 907typedef struct 908{ 909 uint8_t attr_id; 910 uint8_t attr_val; 911} tAVRC_APP_SETTING; 912 913typedef struct 914{ 915 uint8_t attr_id; 916 uint16_t charset_id; 917 uint8_t str_len; 918 uint8_t *p_str; 919} tAVRC_APP_SETTING_TEXT; 920 921typedef uint8_t tAVRC_FEATURE_MASK[AVRC_FEATURE_MASK_SIZE]; 922 923typedef struct 924{ 925 uint16_t player_id; /* A unique identifier for this media player.*/ 926 uint8_t major_type; /* Use AVRC_MJ_TYPE_AUDIO, AVRC_MJ_TYPE_VIDEO, AVRC_MJ_TYPE_BC_AUDIO, or AVRC_MJ_TYPE_BC_VIDEO.*/ 927 uint32_t sub_type; /* Use AVRC_SUB_TYPE_NONE, AVRC_SUB_TYPE_AUDIO_BOOK, or AVRC_SUB_TYPE_PODCAST*/ 928 uint8_t play_status; /* Use AVRC_PLAYSTATE_STOPPED, AVRC_PLAYSTATE_PLAYING, AVRC_PLAYSTATE_PAUSED, AVRC_PLAYSTATE_FWD_SEEK, 929 AVRC_PLAYSTATE_REV_SEEK, or AVRC_PLAYSTATE_ERROR*/ 930 tAVRC_FEATURE_MASK features; /* Supported feature bit mask*/ 931 tAVRC_FULL_NAME name; /* The player name, name length and character set id.*/ 932} tAVRC_ITEM_PLAYER; 933 934typedef struct 935{ 936 tAVRC_UID uid; /* The uid of this folder */ 937 uint8_t type; /* Use AVRC_FOLDER_TYPE_MIXED, AVRC_FOLDER_TYPE_TITLES, 938 AVRC_FOLDER_TYPE_ALNUMS, AVRC_FOLDER_TYPE_ARTISTS, AVRC_FOLDER_TYPE_GENRES, 939 AVRC_FOLDER_TYPE_PLAYLISTS, or AVRC_FOLDER_TYPE_YEARS.*/ 940 bool playable; /* true, if the folder can be played. */ 941 tAVRC_FULL_NAME name; /* The folder name, name length and character set id. */ 942} tAVRC_ITEM_FOLDER; 943 944typedef struct 945{ 946 uint32_t attr_id; /* Use AVRC_MEDIA_ATTR_ID_TITLE, AVRC_MEDIA_ATTR_ID_ARTIST, AVRC_MEDIA_ATTR_ID_ALBUM, 947 AVRC_MEDIA_ATTR_ID_TRACK_NUM, AVRC_MEDIA_ATTR_ID_NUM_TRACKS, 948 AVRC_MEDIA_ATTR_ID_GENRE, AVRC_MEDIA_ATTR_ID_PLAYING_TIME */ 949 tAVRC_FULL_NAME name; /* The attribute value, value length and character set id. */ 950} tAVRC_ATTR_ENTRY; 951 952typedef struct 953{ 954 tAVRC_UID uid; /* The uid of this media element item */ 955 uint8_t type; /* Use AVRC_MEDIA_TYPE_AUDIO or AVRC_MEDIA_TYPE_VIDEO. */ 956 tAVRC_FULL_NAME name; /* The media name, name length and character set id. */ 957 uint8_t attr_count; /* The number of attributes in p_attr_list */ 958 tAVRC_ATTR_ENTRY* p_attr_list; /* Attribute entry list. */ 959} tAVRC_ITEM_MEDIA; 960 961typedef struct 962{ 963 uint8_t item_type; /* AVRC_ITEM_PLAYER, AVRC_ITEM_FOLDER, or AVRC_ITEM_MEDIA */ 964 union 965 { 966 tAVRC_ITEM_PLAYER player; /* The properties of a media player item.*/ 967 tAVRC_ITEM_FOLDER folder; /* The properties of a folder item.*/ 968 tAVRC_ITEM_MEDIA media; /* The properties of a media item.*/ 969 } u; 970} tAVRC_ITEM; 971 972/* GetCapability */ 973typedef struct 974{ 975 uint8_t pdu; 976 tAVRC_STS status; 977 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 978 uint8_t capability_id; 979} tAVRC_GET_CAPS_CMD; 980 981/* ListPlayerAppValues */ 982typedef struct 983{ 984 uint8_t pdu; 985 tAVRC_STS status; 986 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 987 uint8_t attr_id; 988} tAVRC_LIST_APP_VALUES_CMD; 989 990/* GetCurAppValue */ 991typedef struct 992{ 993 uint8_t pdu; 994 tAVRC_STS status; 995 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 996 uint8_t num_attr; 997 uint8_t attrs[AVRC_MAX_APP_ATTR_SIZE]; 998} tAVRC_GET_CUR_APP_VALUE_CMD; 999 1000/* SetAppValue */ 1001typedef struct 1002{ 1003 uint8_t pdu; 1004 tAVRC_STS status; 1005 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1006 uint8_t num_val; 1007 tAVRC_APP_SETTING *p_vals; 1008} tAVRC_SET_APP_VALUE_CMD; 1009 1010/* GetAppAttrTxt */ 1011typedef struct 1012{ 1013 uint8_t pdu; 1014 tAVRC_STS status; 1015 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1016 uint8_t num_attr; 1017 uint8_t attrs[AVRC_MAX_APP_ATTR_SIZE]; 1018} tAVRC_GET_APP_ATTR_TXT_CMD; 1019 1020/* GetAppValueTxt */ 1021typedef struct 1022{ 1023 uint8_t pdu; 1024 tAVRC_STS status; 1025 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1026 uint8_t attr_id; 1027 uint8_t num_val; 1028 uint8_t vals[AVRC_MAX_APP_ATTR_SIZE]; 1029} tAVRC_GET_APP_VAL_TXT_CMD; 1030 1031/* InformCharset */ 1032typedef struct 1033{ 1034 uint8_t pdu; 1035 tAVRC_STS status; 1036 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1037 uint8_t num_id; 1038 uint16_t charsets[AVRC_MAX_CHARSET_SIZE]; 1039} tAVRC_INFORM_CHARSET_CMD; 1040 1041/* InformBatteryStatus */ 1042typedef struct 1043{ 1044 uint8_t pdu; 1045 tAVRC_STS status; 1046 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1047 uint8_t battery_status; 1048} tAVRC_BATTERY_STATUS_CMD; 1049 1050/* GetElemAttrs */ 1051typedef struct 1052{ 1053 uint8_t pdu; 1054 tAVRC_STS status; 1055 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1056 uint8_t num_attr; 1057 uint32_t attrs[AVRC_MAX_ELEM_ATTR_SIZE]; 1058} tAVRC_GET_ELEM_ATTRS_CMD; 1059 1060/* RegNotify */ 1061typedef struct 1062{ 1063 uint8_t pdu; 1064 tAVRC_STS status; 1065 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1066 uint8_t event_id; 1067 uint32_t param; 1068} tAVRC_REG_NOTIF_CMD; 1069 1070/* SetAddrPlayer */ 1071typedef struct 1072{ 1073 uint8_t pdu; 1074 tAVRC_STS status; 1075 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1076 uint16_t player_id; 1077} tAVRC_SET_ADDR_PLAYER_CMD; 1078 1079/* SetBrowsedPlayer */ 1080typedef struct 1081{ 1082 uint8_t pdu; 1083 tAVRC_STS status; 1084 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1085 uint16_t player_id; 1086} tAVRC_SET_BR_PLAYER_CMD; 1087 1088/* SetAbsVolume */ 1089typedef struct 1090{ 1091 uint8_t pdu; 1092 tAVRC_STS status; 1093 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1094 uint8_t volume; 1095} tAVRC_SET_VOLUME_CMD; 1096 1097/* GetFolderItems */ 1098typedef struct 1099{ 1100 uint8_t pdu; 1101 tAVRC_STS status; 1102 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1103 uint8_t scope; 1104 uint32_t start_item; 1105 uint32_t end_item; 1106 uint8_t attr_count; 1107 uint32_t *p_attr_list; 1108} tAVRC_GET_ITEMS_CMD; 1109 1110/* ChangePath */ 1111typedef struct 1112{ 1113 uint8_t pdu; 1114 tAVRC_STS status; 1115 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1116 uint16_t uid_counter; 1117 uint8_t direction; 1118 tAVRC_UID folder_uid; 1119} tAVRC_CHG_PATH_CMD; 1120 1121/* GetItemAttrs */ 1122typedef struct 1123{ 1124 uint8_t pdu; 1125 tAVRC_STS status; 1126 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1127 uint8_t scope; 1128 tAVRC_UID uid; 1129 uint16_t uid_counter; 1130 uint8_t attr_count; 1131 uint32_t *p_attr_list; 1132} tAVRC_GET_ATTRS_CMD; 1133 1134/* Search */ 1135typedef struct 1136{ 1137 uint8_t pdu; 1138 tAVRC_STS status; 1139 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1140 tAVRC_FULL_NAME string; 1141} tAVRC_SEARCH_CMD; 1142 1143/* PlayItem */ 1144typedef struct 1145{ 1146 uint8_t pdu; 1147 tAVRC_STS status; 1148 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1149 uint8_t scope; 1150 tAVRC_UID uid; 1151 uint16_t uid_counter; 1152} tAVRC_PLAY_ITEM_CMD; 1153 1154/* AddToNowPlaying */ 1155typedef struct 1156{ 1157 uint8_t pdu; 1158 tAVRC_STS status; 1159 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1160 uint8_t scope; 1161 tAVRC_UID uid; 1162 uint16_t uid_counter; 1163} tAVRC_ADD_TO_PLAY_CMD; 1164 1165/* GetTotalNumOfItems */ 1166typedef struct 1167{ 1168 uint8_t pdu; 1169 tAVRC_STS status; 1170 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1171 uint8_t scope; 1172} tAVRC_GET_NUM_OF_ITEMS_CMD; 1173 1174typedef struct 1175{ 1176 uint8_t pdu; 1177 tAVRC_STS status; 1178 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1179} tAVRC_CMD; 1180 1181/* Continue and Abort */ 1182typedef struct 1183{ 1184 uint8_t pdu; 1185 tAVRC_STS status; 1186 uint8_t opcode; /* Op Code (assigned by AVRC_BldCommand according to pdu) */ 1187 uint8_t target_pdu; 1188} tAVRC_NEXT_CMD; 1189 1190typedef union 1191{ 1192 uint8_t pdu; 1193 tAVRC_CMD cmd; 1194 tAVRC_GET_CAPS_CMD get_caps; /* GetCapability */ 1195 tAVRC_CMD list_app_attr; /* ListPlayerAppAttr */ 1196 tAVRC_LIST_APP_VALUES_CMD list_app_values; /* ListPlayerAppValues */ 1197 tAVRC_GET_CUR_APP_VALUE_CMD get_cur_app_val; /* GetCurAppValue */ 1198 tAVRC_SET_APP_VALUE_CMD set_app_val; /* SetAppValue */ 1199 tAVRC_GET_APP_ATTR_TXT_CMD get_app_attr_txt; /* GetAppAttrTxt */ 1200 tAVRC_GET_APP_VAL_TXT_CMD get_app_val_txt; /* GetAppValueTxt */ 1201 tAVRC_INFORM_CHARSET_CMD inform_charset; /* InformCharset */ 1202 tAVRC_BATTERY_STATUS_CMD inform_battery_status; /* InformBatteryStatus */ 1203 tAVRC_GET_ELEM_ATTRS_CMD get_elem_attrs; /* GetElemAttrs */ 1204 tAVRC_CMD get_play_status; /* GetPlayStatus */ 1205 tAVRC_REG_NOTIF_CMD reg_notif; /* RegNotify */ 1206 tAVRC_NEXT_CMD continu; /* Continue */ 1207 tAVRC_NEXT_CMD abort; /* Abort */ 1208 1209 tAVRC_SET_ADDR_PLAYER_CMD addr_player; /* SetAddrPlayer */ 1210 tAVRC_SET_VOLUME_CMD volume; /* SetAbsVolume */ 1211 tAVRC_SET_BR_PLAYER_CMD br_player; /* SetBrowsedPlayer */ 1212 tAVRC_GET_ITEMS_CMD get_items; /* GetFolderItems */ 1213 tAVRC_CHG_PATH_CMD chg_path; /* ChangePath */ 1214 tAVRC_GET_ATTRS_CMD get_attrs; /* GetItemAttrs */ 1215 tAVRC_SEARCH_CMD search; /* Search */ 1216 tAVRC_PLAY_ITEM_CMD play_item; /* PlayItem */ 1217 tAVRC_ADD_TO_PLAY_CMD add_to_play; /* AddToNowPlaying */ 1218 tAVRC_GET_NUM_OF_ITEMS_CMD get_num_of_items; /* GetTotalNumOfItems */ 1219} tAVRC_COMMAND; 1220 1221/* GetCapability */ 1222typedef struct 1223{ 1224 uint8_t pdu; 1225 tAVRC_STS status; 1226 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1227 uint8_t capability_id; 1228 uint8_t count; 1229 tAVRC_CAPS_PARAM param; 1230} tAVRC_GET_CAPS_RSP; 1231 1232/* ListPlayerAppAttr */ 1233typedef struct 1234{ 1235 uint8_t pdu; 1236 tAVRC_STS status; 1237 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1238 uint8_t num_attr; 1239 uint8_t attrs[AVRC_MAX_APP_ATTR_SIZE]; 1240} tAVRC_LIST_APP_ATTR_RSP; 1241 1242/* ListPlayerAppValues */ 1243typedef struct 1244{ 1245 uint8_t pdu; 1246 tAVRC_STS status; 1247 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1248 uint8_t num_val; 1249 uint8_t vals[AVRC_MAX_APP_ATTR_SIZE]; 1250} tAVRC_LIST_APP_VALUES_RSP; 1251 1252/* GetCurAppValue */ 1253typedef struct 1254{ 1255 uint8_t pdu; 1256 tAVRC_STS status; 1257 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1258 uint8_t num_val; 1259 tAVRC_APP_SETTING *p_vals; 1260} tAVRC_GET_CUR_APP_VALUE_RSP; 1261 1262/* GetAppAttrTxt */ 1263typedef struct 1264{ 1265 uint8_t pdu; 1266 tAVRC_STS status; 1267 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1268 uint8_t num_attr; 1269 tAVRC_APP_SETTING_TEXT *p_attrs; 1270} tAVRC_GET_APP_ATTR_TXT_RSP; 1271 1272/* GetPlayStatus */ 1273typedef struct 1274{ 1275 uint8_t pdu; 1276 tAVRC_STS status; 1277 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1278 uint32_t song_len; 1279 uint32_t song_pos; 1280 uint8_t play_status; 1281} tAVRC_GET_PLAY_STATUS_RSP; 1282 1283/* notification event parameter for AddressedPlayer change */ 1284typedef struct 1285{ 1286 uint16_t player_id; 1287 uint16_t uid_counter; 1288} tAVRC_ADDR_PLAYER_PARAM; 1289 1290#ifndef AVRC_MAX_APP_SETTINGS 1291#define AVRC_MAX_APP_SETTINGS 8 1292#endif 1293 1294/* notification event parameter for Player Application setting change */ 1295typedef struct 1296{ 1297 uint8_t num_attr; 1298 uint8_t attr_id[AVRC_MAX_APP_SETTINGS]; 1299 uint8_t attr_value[AVRC_MAX_APP_SETTINGS]; 1300} tAVRC_PLAYER_APP_PARAM; 1301 1302typedef union 1303{ 1304 tAVRC_PLAYSTATE play_status; 1305 tAVRC_UID track; 1306 uint32_t play_pos; 1307 tAVRC_BATTERY_STATUS battery_status; 1308 tAVRC_SYSTEMSTATE system_status; 1309 tAVRC_PLAYER_APP_PARAM player_setting; 1310 tAVRC_ADDR_PLAYER_PARAM addr_player; 1311 uint16_t uid_counter; 1312 uint8_t volume; 1313} tAVRC_NOTIF_RSP_PARAM; 1314 1315/* RegNotify */ 1316typedef struct 1317{ 1318 uint8_t pdu; 1319 tAVRC_STS status; 1320 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1321 uint8_t event_id; 1322 tAVRC_NOTIF_RSP_PARAM param; 1323} tAVRC_REG_NOTIF_RSP; 1324 1325/* SetAbsVolume */ 1326typedef struct 1327{ 1328 uint8_t pdu; 1329 tAVRC_STS status; 1330 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1331 uint8_t volume; 1332} tAVRC_SET_VOLUME_RSP; 1333 1334/* SetBrowsedPlayer */ 1335typedef struct 1336{ 1337 uint8_t pdu; 1338 tAVRC_STS status; 1339 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1340 uint16_t uid_counter; 1341 uint32_t num_items; 1342 uint16_t charset_id; 1343 uint8_t folder_depth; 1344 tAVRC_NAME *p_folders; 1345} tAVRC_SET_BR_PLAYER_RSP; 1346 1347/* GetFolderItems */ 1348typedef struct 1349{ 1350 uint8_t pdu; 1351 tAVRC_STS status; 1352 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1353 uint16_t uid_counter; 1354 uint16_t item_count; 1355 tAVRC_ITEM *p_item_list; 1356} tAVRC_GET_ITEMS_RSP; 1357 1358/* ChangePath */ 1359typedef struct 1360{ 1361 uint8_t pdu; 1362 tAVRC_STS status; 1363 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1364 uint32_t num_items; 1365} tAVRC_CHG_PATH_RSP; 1366 1367/* GetItemAttrs, GetElemAttrs */ 1368typedef struct 1369{ 1370 uint8_t pdu; 1371 tAVRC_STS status; 1372 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1373 uint8_t num_attrs; 1374 tAVRC_ATTR_ENTRY *p_attrs; 1375} tAVRC_GET_ATTRS_RSP; 1376 1377/* Get Total Number of Items */ 1378typedef struct 1379{ 1380 uint8_t pdu; 1381 tAVRC_STS status; 1382 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1383 uint16_t uid_counter; 1384 uint32_t num_items; 1385} tAVRC_GET_NUM_OF_ITEMS_RSP; 1386 1387/* Search */ 1388typedef struct 1389{ 1390 uint8_t pdu; 1391 tAVRC_STS status; 1392 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1393 uint16_t uid_counter; 1394 uint32_t num_items; 1395} tAVRC_SEARCH_RSP; 1396 1397typedef struct 1398{ 1399 uint8_t pdu; 1400 tAVRC_STS status; 1401 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1402 uint8_t target_pdu; 1403} tAVRC_NEXT_RSP; 1404 1405typedef struct 1406{ 1407 uint8_t pdu; 1408 tAVRC_STS status; 1409 uint8_t opcode; /* Op Code (copied from avrc_cmd.opcode by AVRC_BldResponse user. invalid one to generate according to pdu) */ 1410} tAVRC_RSP; 1411 1412typedef union 1413{ 1414 uint8_t pdu; 1415 tAVRC_RSP rsp; 1416 tAVRC_GET_CAPS_RSP get_caps; /* GetCapability */ 1417 tAVRC_LIST_APP_ATTR_RSP list_app_attr; /* ListPlayerAppAttr */ 1418 tAVRC_LIST_APP_VALUES_RSP list_app_values; /* ListPlayerAppValues */ 1419 tAVRC_GET_CUR_APP_VALUE_RSP get_cur_app_val; /* GetCurAppValue */ 1420 tAVRC_RSP set_app_val; /* SetAppValue */ 1421 tAVRC_GET_APP_ATTR_TXT_RSP get_app_attr_txt; /* GetAppAttrTxt */ 1422 tAVRC_GET_APP_ATTR_TXT_RSP get_app_val_txt; /* GetAppValueTxt */ 1423 tAVRC_RSP inform_charset; /* InformCharset */ 1424 tAVRC_RSP inform_battery_status; /* InformBatteryStatus */ 1425 tAVRC_GET_PLAY_STATUS_RSP get_play_status; /* GetPlayStatus */ 1426 tAVRC_REG_NOTIF_RSP reg_notif; /* RegNotify */ 1427 tAVRC_NEXT_RSP continu; /* Continue */ 1428 tAVRC_NEXT_RSP abort; /* Abort */ 1429 tAVRC_RSP addr_player; /* SetAddrPlayer */ 1430 tAVRC_SET_VOLUME_RSP volume; /* SetAbsVolume */ 1431 tAVRC_SET_BR_PLAYER_RSP br_player; /* SetBrowsedPlayer */ 1432 tAVRC_GET_ITEMS_RSP get_items; /* GetFolderItems */ 1433 tAVRC_CHG_PATH_RSP chg_path; /* ChangePath */ 1434 tAVRC_GET_ATTRS_RSP get_attrs; /* GetItemAttrs, GetElemAttrs */ 1435 tAVRC_GET_NUM_OF_ITEMS_RSP get_num_of_items; /* GetTotalNumberOfItems */ 1436 tAVRC_SEARCH_RSP search; /* Search */ 1437 tAVRC_RSP play_item; /* PlayItem */ 1438 tAVRC_RSP add_to_play; /* AddToNowPlaying */ 1439} tAVRC_RESPONSE; 1440 1441#endif 1442