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