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