avrc_api.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  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. * nterface to AVRCP Application Programming Interface
  21. *
  22. ******************************************************************************/
  23. #ifndef AVRC_API_H
  24. #define AVRC_API_H
  25. #include "bt_target.h"
  26. #include "avct_api.h"
  27. #include "sdp_api.h"
  28. #include "avrc_defs.h"
  29. /*****************************************************************************
  30. ** constants
  31. *****************************************************************************/
  32. /* API function return value result codes. */
  33. #define AVRC_SUCCESS AVCT_SUCCESS /* 0 Function successful */
  34. #define AVRC_NO_RESOURCES AVCT_NO_RESOURCES /* 1 Not enough resources */
  35. #define AVRC_BAD_HANDLE AVCT_BAD_HANDLE /* 2 Bad handle */
  36. #define AVRC_PID_IN_USE AVCT_PID_IN_USE /* 3 PID already in use */
  37. #define AVRC_NOT_OPEN AVCT_NOT_OPEN /* 4 Connection not open */
  38. #define AVRC_MSG_TOO_BIG 5 /* 5 the message length exceed the MTU of the browsing channel */
  39. #define AVRC_FAIL 0x10 /* 0x10 generic failure */
  40. #define AVRC_BAD_PARAM 0x11 /* 0x11 bad parameter */
  41. /* Control role - same as AVCT_TARGET/AVCT_CONTROL */
  42. #define AVRC_CT_TARGET 1 /* target */
  43. #define AVRC_CT_CONTROL 2 /* controller */
  44. #define AVRC_CT_PASSIVE 4 /* If conflict, allow the other side to succeed */
  45. /* Connection role */
  46. #define AVRC_CONN_INT AVCT_INT /* initiator */
  47. #define AVRC_CONN_ACP AVCT_ACP /* Acceptor */
  48. /* AVRC CTRL events */
  49. /* AVRC_OPEN_IND_EVT event is sent when the connection is successfully opened.
  50. * This eventis sent in response to an AVRC_Open(). */
  51. #define AVRC_OPEN_IND_EVT 0
  52. /* AVRC_CLOSE_IND_EVT event is sent when a connection is closed.
  53. * This event can result from a call to AVRC_Close() or when the peer closes
  54. * the connection. It is also sent when a connection attempted through
  55. * AVRC_Open() fails. */
  56. #define AVRC_CLOSE_IND_EVT 1
  57. /* AVRC_CONG_IND_EVT event indicates that AVCTP is congested and cannot send
  58. * any more messages. */
  59. #define AVRC_CONG_IND_EVT 2
  60. /* AVRC_UNCONG_IND_EVT event indicates that AVCTP is uncongested and ready to
  61. * send messages. */
  62. #define AVRC_UNCONG_IND_EVT 3
  63. /* AVRC_BROWSE_OPEN_IND_EVT event is sent when the browse channel is successfully opened.
  64. * This eventis sent in response to an AVRC_Open() or AVRC_OpenBrowse() . */
  65. #define AVRC_BROWSE_OPEN_IND_EVT 4
  66. /* AVRC_BROWSE_CLOSE_IND_EVT event is sent when a browse channel is closed.
  67. * This event can result from a call to AVRC_Close(), AVRC_CloseBrowse() or when the peer closes
  68. * the connection. It is also sent when a connection attempted through
  69. * AVRC_OpenBrowse() fails. */
  70. #define AVRC_BROWSE_CLOSE_IND_EVT 5
  71. /* AVRC_BROWSE_CONG_IND_EVT event indicates that AVCTP browse channel is congested and cannot send
  72. * any more messages. */
  73. #define AVRC_BROWSE_CONG_IND_EVT 6
  74. /* AVRC_BROWSE_UNCONG_IND_EVT event indicates that AVCTP browse channel is uncongested and ready to
  75. * send messages. */
  76. #define AVRC_BROWSE_UNCONG_IND_EVT 7
  77. /* AVRC_CMD_TIMEOUT_EVT event indicates timeout waiting for AVRC command response from the peer */
  78. #define AVRC_CMD_TIMEOUT_EVT 8
  79. /* Supported categories */
  80. #define AVRC_SUPF_CT_CAT1 0x0001 /* Category 1 */
  81. #define AVRC_SUPF_CT_CAT2 0x0002 /* Category 2 */
  82. #define AVRC_SUPF_CT_CAT3 0x0004 /* Category 3 */
  83. #define AVRC_SUPF_CT_CAT4 0x0008 /* Category 4 */
  84. #define AVRC_SUPF_CT_BROWSE 0x0040 /* Browsing */
  85. #define AVRC_SUPF_TG_CAT1 0x0001 /* Category 1 */
  86. #define AVRC_SUPF_TG_CAT2 0x0002 /* Category 2 */
  87. #define AVRC_SUPF_TG_CAT3 0x0004 /* Category 3 */
  88. #define AVRC_SUPF_TG_CAT4 0x0008 /* Category 4 */
  89. #define AVRC_SUPF_TG_APP_SETTINGS 0x0010 /* Player Application Settings */
  90. #define AVRC_SUPF_TG_GROUP_NAVI 0x0020 /* Group Navigation */
  91. #define AVRC_SUPF_TG_BROWSE 0x0040 /* Browsing */
  92. #define AVRC_SUPF_TG_MULTI_PLAYER 0x0080 /* Muliple Media Player */
  93. #define AVRC_META_SUCCESS AVRC_SUCCESS
  94. #define AVRC_META_FAIL AVRC_FAIL
  95. #define AVRC_METADATA_CMD 0x0000
  96. #define AVRC_METADATA_RESP 0x0001
  97. /*****************************************************************************
  98. ** data type definitions
  99. *****************************************************************************/
  100. /* This data type is used in AVRC_FindService() to initialize the SDP database
  101. * to hold the result service search. */
  102. typedef struct {
  103. UINT32 db_len; /* Length, in bytes, of the discovery database */
  104. tSDP_DISCOVERY_DB *p_db; /* Pointer to the discovery database */
  105. UINT16 num_attr;/* The number of attributes in p_attrs */
  106. UINT16 *p_attrs; /* The attributes filter. If NULL, AVRCP API sets the attribute filter
  107. * to be ATTR_ID_SERVICE_CLASS_ID_LIST, ATTR_ID_BT_PROFILE_DESC_LIST,
  108. * ATTR_ID_SUPPORTED_FEATURES, ATTR_ID_SERVICE_NAME and ATTR_ID_PROVIDER_NAME.
  109. * If not NULL, the input is taken as the filter. */
  110. } tAVRC_SDP_DB_PARAMS;
  111. /* This callback function returns service discovery information to the
  112. * application after the AVRC_FindService() API function is called. The
  113. * implementation of this callback function must copy the p_service_name
  114. * and p_provider_name parameters passed to it as they are not guaranteed
  115. * to remain after the callback function exits. */
  116. typedef void (tAVRC_FIND_CBACK) (UINT16 status);
  117. /* This is the control callback function. This function passes events
  118. * listed in Table 20 to the application. */
  119. typedef void (tAVRC_CTRL_CBACK) (UINT8 handle, UINT8 event, UINT16 result,
  120. BD_ADDR peer_addr);
  121. /* This is the message callback function. It is executed when AVCTP has
  122. * a message packet ready for the application. The implementation of this
  123. * callback function must copy the tAVRC_MSG structure passed to it as it
  124. * is not guaranteed to remain after the callback function exits. */
  125. typedef void (tAVRC_MSG_CBACK) (UINT8 handle, UINT8 label, UINT8 opcode,
  126. tAVRC_MSG *p_msg);
  127. typedef struct {
  128. tAVRC_CTRL_CBACK *p_ctrl_cback; /* pointer to application control callback */
  129. tAVRC_MSG_CBACK *p_msg_cback; /* pointer to application message callback */
  130. UINT32 company_id; /* the company ID */
  131. UINT8 conn; /* Connection role (Initiator/acceptor) */
  132. UINT8 control; /* Control role (Control/Target) */
  133. } tAVRC_CONN_CB;
  134. /*****************************************************************************
  135. ** external function declarations
  136. *****************************************************************************/
  137. #ifdef __cplusplus
  138. extern "C"
  139. {
  140. #endif
  141. /******************************************************************************
  142. **
  143. ** Function AVRC_AddRecord
  144. **
  145. ** Description This function is called to build an AVRCP SDP record.
  146. ** Prior to calling this function the application must
  147. ** call SDP_CreateRecord() to create an SDP record.
  148. **
  149. ** Input Parameters:
  150. ** service_uuid: Indicates TG(UUID_SERVCLASS_AV_REM_CTRL_TARGET)
  151. ** or CT(UUID_SERVCLASS_AV_REMOTE_CONTROL)
  152. **
  153. ** p_service_name: Pointer to a null-terminated character
  154. ** string containing the service name.
  155. ** If service name is not used set this to NULL.
  156. **
  157. ** p_provider_name: Pointer to a null-terminated character
  158. ** string containing the provider name.
  159. ** If provider name is not used set this to NULL.
  160. **
  161. ** categories: Supported categories.
  162. **
  163. ** sdp_handle: SDP handle returned by SDP_CreateRecord().
  164. **
  165. ** Output Parameters:
  166. ** None.
  167. **
  168. ** Returns AVRC_SUCCESS if successful.
  169. ** AVRC_NO_RESOURCES if not enough resources to build the SDP record.
  170. **
  171. ******************************************************************************/
  172. extern UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name,
  173. char *p_provider_name, UINT16 categories, UINT32 sdp_handle);
  174. /******************************************************************************
  175. **
  176. ** Function AVRC_FindService
  177. **
  178. ** Description This function is called by the application to perform service
  179. ** discovery and retrieve AVRCP SDP record information from a
  180. ** peer device. Information is returned for the first service
  181. ** record found on the server that matches the service UUID.
  182. ** The callback function will be executed when service discovery
  183. ** is complete. There can only be one outstanding call to
  184. ** AVRC_FindService() at a time; the application must wait for
  185. ** the callback before it makes another call to the function.
  186. ** The application is responsible for allocating memory for the
  187. ** discovery database. It is recommended that the size of the
  188. ** discovery database be at least 300 bytes. The application
  189. ** can deallocate the memory after the callback function has
  190. ** executed.
  191. **
  192. ** Input Parameters:
  193. ** service_uuid: Indicates TG(UUID_SERVCLASS_AV_REM_CTRL_TARGET)
  194. ** or CT(UUID_SERVCLASS_AV_REMOTE_CONTROL)
  195. **
  196. ** bd_addr: BD address of the peer device.
  197. **
  198. ** p_db: SDP discovery database parameters.
  199. **
  200. ** p_cback: Pointer to the callback function.
  201. **
  202. ** Output Parameters:
  203. ** None.
  204. **
  205. ** Returns AVRC_SUCCESS if successful.
  206. ** AVRC_BAD_PARAMS if discovery database parameters are invalid.
  207. ** AVRC_NO_RESOURCES if there are not enough resources to
  208. ** perform the service search.
  209. **
  210. ******************************************************************************/
  211. extern UINT16 AVRC_FindService(UINT16 service_uuid, BD_ADDR bd_addr,
  212. tAVRC_SDP_DB_PARAMS *p_db, tAVRC_FIND_CBACK *p_cback);
  213. /******************************************************************************
  214. **
  215. ** Function AVRC_Open
  216. **
  217. ** Description This function is called to open a connection to AVCTP.
  218. ** The connection can be either an initiator or acceptor, as
  219. ** determined by the p_ccb->stream parameter.
  220. ** The connection can be a target, a controller or for both role,
  221. ** as determined by the p_ccb->control parameter.
  222. ** By definition, a target connection is an acceptor connection
  223. ** that waits for an incoming AVCTP connection from the peer.
  224. ** The connection remains available to the application until
  225. ** the application closes it by calling AVRC_Close(). The
  226. ** application does not need to reopen the connection after an
  227. ** AVRC_CLOSE_IND_EVT is received.
  228. **
  229. ** Input Parameters:
  230. ** p_ccb->company_id: Company Identifier.
  231. **
  232. ** p_ccb->p_ctrl_cback: Pointer to control callback function.
  233. **
  234. ** p_ccb->p_msg_cback: Pointer to message callback function.
  235. **
  236. ** p_ccb->conn: AVCTP connection role. This is set to
  237. ** AVCTP_INT for initiator connections and AVCTP_ACP
  238. ** for acceptor connections.
  239. **
  240. ** p_ccb->control: Control role. This is set to
  241. ** AVRC_CT_TARGET for target connections, AVRC_CT_CONTROL
  242. ** for control connections or (AVRC_CT_TARGET|AVRC_CT_CONTROL)
  243. ** for connections that support both roles.
  244. **
  245. ** peer_addr: BD address of peer device. This value is
  246. ** only used for initiator connections; for acceptor
  247. ** connections it can be set to NULL.
  248. **
  249. ** Output Parameters:
  250. ** p_handle: Pointer to handle. This parameter is only
  251. ** valid if AVRC_SUCCESS is returned.
  252. **
  253. ** Returns AVRC_SUCCESS if successful.
  254. ** AVRC_NO_RESOURCES if there are not enough resources to open
  255. ** the connection.
  256. **
  257. ******************************************************************************/
  258. extern UINT16 AVRC_Open(UINT8 *p_handle, tAVRC_CONN_CB *p_ccb,
  259. BD_ADDR_PTR peer_addr);
  260. /******************************************************************************
  261. **
  262. ** Function AVRC_Close
  263. **
  264. ** Description Close a connection opened with AVRC_Open().
  265. ** This function is called when the
  266. ** application is no longer using a connection.
  267. **
  268. ** Input Parameters:
  269. ** handle: Handle of this connection.
  270. **
  271. ** Output Parameters:
  272. ** None.
  273. **
  274. ** Returns AVRC_SUCCESS if successful.
  275. ** AVRC_BAD_HANDLE if handle is invalid.
  276. **
  277. ******************************************************************************/
  278. extern UINT16 AVRC_Close(UINT8 handle);
  279. /******************************************************************************
  280. **
  281. ** Function AVRC_OpenBrowse
  282. **
  283. ** Description This function is called to open a browsing connection to AVCTP.
  284. ** The connection can be either an initiator or acceptor, as
  285. ** determined by the conn_role.
  286. ** The handle is returned by a previous call to AVRC_Open.
  287. **
  288. ** Returns AVRC_SUCCESS if successful.
  289. ** AVRC_NO_RESOURCES if there are not enough resources to open
  290. ** the connection.
  291. **
  292. ******************************************************************************/
  293. extern UINT16 AVRC_OpenBrowse(UINT8 handle, UINT8 conn_role);
  294. /******************************************************************************
  295. **
  296. ** Function AVRC_CloseBrowse
  297. **
  298. ** Description Close a connection opened with AVRC_OpenBrowse().
  299. ** This function is called when the
  300. ** application is no longer using a connection.
  301. **
  302. ** Returns AVRC_SUCCESS if successful.
  303. ** AVRC_BAD_HANDLE if handle is invalid.
  304. **
  305. ******************************************************************************/
  306. extern UINT16 AVRC_CloseBrowse(UINT8 handle);
  307. /******************************************************************************
  308. **
  309. ** Function AVRC_MsgReq
  310. **
  311. ** Description This function is used to send the AVRCP byte stream in p_pkt
  312. ** down to AVCTP.
  313. **
  314. ** It is expected that p_pkt->offset is at least AVCT_MSG_OFFSET
  315. ** p_pkt->layer_specific is AVCT_DATA_CTRL or AVCT_DATA_BROWSE
  316. ** p_pkt->event is AVRC_OP_VENDOR, AVRC_OP_PASS_THRU or AVRC_OP_BROWSING
  317. ** The above BT_HDR settings are set by the AVRC_Bld* functions.
  318. **
  319. ** Returns AVRC_SUCCESS if successful.
  320. ** AVRC_BAD_HANDLE if handle is invalid.
  321. **
  322. ******************************************************************************/
  323. extern UINT16 AVRC_MsgReq (UINT8 handle, UINT8 label, UINT8 ctype, BT_HDR *p_pkt);
  324. /******************************************************************************
  325. **
  326. ** Function AVRC_UnitCmd
  327. **
  328. ** Description Send a UNIT INFO command to the peer device. This
  329. ** function can only be called for controller role connections.
  330. ** Any response message from the peer is passed back through
  331. ** the tAVRC_MSG_CBACK callback function.
  332. **
  333. ** Input Parameters:
  334. ** handle: Handle of this connection.
  335. **
  336. ** label: Transaction label.
  337. **
  338. ** Output Parameters:
  339. ** None.
  340. **
  341. ** Returns AVRC_SUCCESS if successful.
  342. ** AVRC_BAD_HANDLE if handle is invalid.
  343. **
  344. ******************************************************************************/
  345. extern UINT16 AVRC_UnitCmd(UINT8 handle, UINT8 label);
  346. /******************************************************************************
  347. **
  348. ** Function AVRC_SubCmd
  349. **
  350. ** Description Send a SUBUNIT INFO command to the peer device. This
  351. ** function can only be called for controller role connections.
  352. ** Any response message from the peer is passed back through
  353. ** the tAVRC_MSG_CBACK callback function.
  354. **
  355. ** Input Parameters:
  356. ** handle: Handle of this connection.
  357. **
  358. ** label: Transaction label.
  359. **
  360. ** page: Specifies which part of the subunit type table
  361. ** is requested. For AVRCP it is typically zero.
  362. ** Value range is 0-7.
  363. **
  364. ** Output Parameters:
  365. ** None.
  366. **
  367. ** Returns AVRC_SUCCESS if successful.
  368. ** AVRC_BAD_HANDLE if handle is invalid.
  369. **
  370. ******************************************************************************/
  371. extern UINT16 AVRC_SubCmd(UINT8 handle, UINT8 label, UINT8 page);
  372. /******************************************************************************
  373. **
  374. ** Function AVRC_PassCmd
  375. **
  376. ** Description Send a PASS THROUGH command to the peer device. This
  377. ** function can only be called for controller role connections.
  378. ** Any response message from the peer is passed back through
  379. ** the tAVRC_MSG_CBACK callback function.
  380. **
  381. ** Input Parameters:
  382. ** handle: Handle of this connection.
  383. **
  384. ** label: Transaction label.
  385. **
  386. ** p_msg: Pointer to PASS THROUGH message structure.
  387. **
  388. ** Output Parameters:
  389. ** None.
  390. **
  391. ** Returns AVRC_SUCCESS if successful.
  392. ** AVRC_BAD_HANDLE if handle is invalid.
  393. **
  394. ******************************************************************************/
  395. extern UINT16 AVRC_PassCmd(UINT8 handle, UINT8 label, tAVRC_MSG_PASS *p_msg);
  396. /******************************************************************************
  397. **
  398. ** Function AVRC_PassRsp
  399. **
  400. ** Description Send a PASS THROUGH response to the peer device. This
  401. ** function can only be called for target role connections.
  402. ** This function must be called when a PASS THROUGH command
  403. ** message is received from the peer through the
  404. ** tAVRC_MSG_CBACK callback function.
  405. **
  406. ** Input Parameters:
  407. ** handle: Handle of this connection.
  408. **
  409. ** label: Transaction label. Must be the same value as
  410. ** passed with the command message in the callback function.
  411. **
  412. ** p_msg: Pointer to PASS THROUGH message structure.
  413. **
  414. ** Output Parameters:
  415. ** None.
  416. **
  417. ** Returns AVRC_SUCCESS if successful.
  418. ** AVRC_BAD_HANDLE if handle is invalid.
  419. **
  420. ******************************************************************************/
  421. extern UINT16 AVRC_PassRsp(UINT8 handle, UINT8 label, tAVRC_MSG_PASS *p_msg);
  422. /******************************************************************************
  423. **
  424. ** Function AVRC_VendorCmd
  425. **
  426. ** Description Send a VENDOR DEPENDENT command to the peer device. This
  427. ** function can only be called for controller role connections.
  428. ** Any response message from the peer is passed back through
  429. ** the tAVRC_MSG_CBACK callback function.
  430. **
  431. ** Input Parameters:
  432. ** handle: Handle of this connection.
  433. **
  434. ** label: Transaction label.
  435. **
  436. ** p_msg: Pointer to VENDOR DEPENDENT message structure.
  437. **
  438. ** Output Parameters:
  439. ** None.
  440. **
  441. ** Returns AVRC_SUCCESS if successful.
  442. ** AVRC_BAD_HANDLE if handle is invalid.
  443. **
  444. ******************************************************************************/
  445. extern UINT16 AVRC_VendorCmd(UINT8 handle, UINT8 label, tAVRC_MSG_VENDOR *p_msg);
  446. /******************************************************************************
  447. **
  448. ** Function AVRC_VendorRsp
  449. **
  450. ** Description Send a VENDOR DEPENDENT response to the peer device. This
  451. ** function can only be called for target role connections.
  452. ** This function must be called when a VENDOR DEPENDENT
  453. ** command message is received from the peer through the
  454. ** tAVRC_MSG_CBACK callback function.
  455. **
  456. ** Input Parameters:
  457. ** handle: Handle of this connection.
  458. **
  459. ** label: Transaction label. Must be the same value as
  460. ** passed with the command message in the callback function.
  461. **
  462. ** p_msg: Pointer to VENDOR DEPENDENT message structure.
  463. **
  464. ** Output Parameters:
  465. ** None.
  466. **
  467. ** Returns AVRC_SUCCESS if successful.
  468. ** AVRC_BAD_HANDLE if handle is invalid.
  469. **
  470. ******************************************************************************/
  471. extern UINT16 AVRC_VendorRsp(UINT8 handle, UINT8 label, tAVRC_MSG_VENDOR *p_msg);
  472. /******************************************************************************
  473. **
  474. ** Function AVRC_SetTraceLevel
  475. **
  476. ** Description Sets the trace level for AVRC. If 0xff is passed, the
  477. ** current trace level is returned.
  478. **
  479. ** Input Parameters:
  480. ** new_level: The level to set the AVRC tracing to:
  481. ** 0xff-returns the current setting.
  482. ** 0-turns off tracing.
  483. ** >= 1-Errors.
  484. ** >= 2-Warnings.
  485. ** >= 3-APIs.
  486. ** >= 4-Events.
  487. ** >= 5-Debug.
  488. **
  489. ** Returns The new trace level or current trace level if
  490. ** the input parameter is 0xff.
  491. **
  492. ******************************************************************************/
  493. extern UINT8 AVRC_SetTraceLevel (UINT8 new_level);
  494. /*******************************************************************************
  495. **
  496. ** Function AVRC_Init
  497. **
  498. ** Description This function is called at stack startup to allocate the
  499. ** control block (if using dynamic memory), and initializes the
  500. ** control block and tracing level.
  501. **
  502. ** Returns void
  503. **
  504. *******************************************************************************/
  505. extern void AVRC_Init(void);
  506. /*******************************************************************************
  507. **
  508. ** Function AVRC_ParsCommand
  509. **
  510. ** Description This function is used to parse the received command.
  511. **
  512. ** Returns AVRC_STS_NO_ERROR, if the message in p_data is parsed successfully.
  513. ** Otherwise, the error code defined by AVRCP 1.4
  514. **
  515. *******************************************************************************/
  516. extern tAVRC_STS AVRC_ParsCommand (tAVRC_MSG *p_msg, tAVRC_COMMAND *p_result,
  517. UINT8 *p_buf, UINT16 buf_len);
  518. /*******************************************************************************
  519. **
  520. ** Function AVRC_ParsResponse
  521. **
  522. ** Description This function is used to parse the received response.
  523. **
  524. ** Returns AVRC_STS_NO_ERROR, if the message in p_data is parsed successfully.
  525. ** Otherwise, the error code defined by AVRCP 1.4
  526. **
  527. *******************************************************************************/
  528. extern tAVRC_STS AVRC_ParsResponse (tAVRC_MSG *p_msg, tAVRC_RESPONSE *p_result,
  529. UINT8 *p_buf, UINT16 buf_len);
  530. /*******************************************************************************
  531. **
  532. ** Function AVRC_BldCommand
  533. **
  534. ** Description This function builds the given AVRCP command to the given
  535. ** GKI buffer
  536. **
  537. ** Returns AVRC_STS_NO_ERROR, if the command is built successfully
  538. ** Otherwise, the error code.
  539. **
  540. *******************************************************************************/
  541. extern tAVRC_STS AVRC_BldCommand( tAVRC_COMMAND *p_cmd, BT_HDR **pp_pkt);
  542. /*******************************************************************************
  543. **
  544. ** Function AVRC_BldResponse
  545. **
  546. ** Description This function builds the given AVRCP response to the given
  547. ** GKI buffer
  548. **
  549. ** Returns AVRC_STS_NO_ERROR, if the response is built successfully
  550. ** Otherwise, the error code.
  551. **
  552. *******************************************************************************/
  553. extern tAVRC_STS AVRC_BldResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR **pp_pkt);
  554. /**************************************************************************
  555. **
  556. ** Function AVRC_IsValidAvcType
  557. **
  558. ** Description Check if correct AVC type is specified
  559. **
  560. ** Returns returns TRUE if it is valid
  561. **
  562. **
  563. *******************************************************************************/
  564. extern BOOLEAN AVRC_IsValidAvcType(UINT8 pdu_id, UINT8 avc_type);
  565. /*******************************************************************************
  566. **
  567. ** Function AVRC_IsValidPlayerAttr
  568. **
  569. ** Description Check if the given attrib value is a valid one
  570. **
  571. **
  572. ** Returns returns TRUE if it is valid
  573. **
  574. *******************************************************************************/
  575. extern BOOLEAN AVRC_IsValidPlayerAttr(UINT8 attr);
  576. #ifdef __cplusplus
  577. }
  578. #endif
  579. #endif /* AVRC_API_H */