avrc_defs.h 59 KB

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