avrc_defs.h 59 KB

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