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