avrc_api.h 28 KB

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