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