• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright 2004-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  *  This is the public interface file for the advanced audio/video streaming
22  *  (AV) subsystem of BTA, Broadcom's Bluetooth application layer for mobile
23  *  phones.
24  *
25  ******************************************************************************/
26 #ifndef BTA_AV_API_H
27 #define BTA_AV_API_H
28 
29 #include <cstdint>
30 
31 #include "bta/include/bta_api.h"
32 #include "stack/include/avrc_defs.h"
33 #include "stack/include/bt_types.h"
34 
35 /*****************************************************************************
36  *  Constants and data types
37  ****************************************************************************/
38 
39 /* AV status values */
40 #define BTA_AV_SUCCESS 0        /* successful operation */
41 #define BTA_AV_FAIL 1           /* generic failure */
42 #define BTA_AV_FAIL_SDP 2       /* service not found */
43 #define BTA_AV_FAIL_STREAM 3    /* stream connection failed */
44 #define BTA_AV_FAIL_RESOURCES 4 /* no resources */
45 #define BTA_AV_FAIL_ROLE 5 /* failed due to role management related issues */
46 #define BTA_AV_FAIL_GET_CAP \
47   6 /* get capability failed due to no SEP availale on the peer  */
48 
49 typedef uint8_t tBTA_AV_STATUS;
50 
51 /* AV features masks */
52 #define BTA_AV_FEAT_RCTG 0x0001    /* remote control target */
53 #define BTA_AV_FEAT_RCCT 0x0002    /* remote control controller */
54 #define BTA_AV_FEAT_PROTECT 0x0004 /* streaming media contect protection */
55 #define BTA_AV_FEAT_VENDOR                                                    \
56   0x0008                          /* remote control vendor dependent commands \
57                                      */
58 #define BTA_AV_FEAT_REPORT 0x0020 /* use reporting service for VDP */
59 #define BTA_AV_FEAT_METADATA \
60   0x0040 /* remote control Metadata Transfer command/response */
61 #define BTA_AV_FEAT_MULTI_AV \
62   0x0080                          /* use multi-av, if controller supports it */
63 #define BTA_AV_FEAT_BROWSE 0x0010 /* use browsing channel */
64 #define BTA_AV_FEAT_ADV_CTRL \
65   0x0200 /* remote control Advanced Control command/response */
66 #define BTA_AV_FEAT_DELAY_RPT 0x0400 /* allow delay reporting */
67 #define BTA_AV_FEAT_ACP_START \
68   0x0800 /* start stream when 2nd SNK was accepted   */
69 #define BTA_AV_FEAT_COVER_ARTWORK 0x1000 /* use cover art feature */
70 #define BTA_AV_FEAT_APP_SETTING 0x2000 /* Player app setting support */
71 
72 /* Internal features */
73 #define BTA_AV_FEAT_NO_SCO_SSPD \
74   0x8000 /* Do not suspend av streaming as to AG events(SCO or Call) */
75 
76 typedef uint16_t tBTA_AV_FEAT;
77 
78 /* AV channel values */
79 #define BTA_AV_CHNL_MSK 0xC0
80 #define BTA_AV_CHNL_AUDIO 0x40 /* audio channel */
81 #define BTA_AV_CHNL_VIDEO 0x80 /* video channel */
82 typedef uint8_t tBTA_AV_CHNL;
83 
84 #define BTA_AV_HNDL_MSK 0x3F
85 typedef uint8_t tBTA_AV_HNDL;
86 /* handle index to mask */
87 #define BTA_AV_HNDL_TO_MSK(h) ((uint8_t)(1 << (h)))
88 
89 /* maximum number of streams created */
90 #ifndef BTA_AV_NUM_STRS
91 #define BTA_AV_NUM_STRS 6
92 #endif
93 
94 /* operation id list for BTA_AvRemoteCmd */
95 typedef uint8_t tBTA_AV_RC;
96 
97 /* state flag for pass through command */
98 typedef uint8_t tBTA_AV_STATE;
99 
100 /* command codes for BTA_AvVendorCmd */
101 typedef uint8_t tBTA_AV_CMD;
102 
103 /* response codes for BTA_AvVendorRsp */
104 typedef uint8_t tBTA_AV_CODE;
105 
106 /* error codes for BTA_AvProtectRsp */
107 typedef uint8_t tBTA_AV_ERR;
108 
109 /* AV callback events */
110 #define BTA_AV_ENABLE_EVT 0      /* AV enabled */
111 #define BTA_AV_REGISTER_EVT 1    /* registered to AVDT */
112 #define BTA_AV_OPEN_EVT 2        /* connection opened */
113 #define BTA_AV_CLOSE_EVT 3       /* connection closed */
114 #define BTA_AV_START_EVT 4       /* stream data transfer started */
115 #define BTA_AV_STOP_EVT 5        /* stream data transfer stopped */
116 #define BTA_AV_PROTECT_REQ_EVT 6 /* content protection request */
117 #define BTA_AV_PROTECT_RSP_EVT 7 /* content protection response */
118 #define BTA_AV_RC_OPEN_EVT 8     /* remote control channel open */
119 #define BTA_AV_RC_CLOSE_EVT 9    /* remote control channel closed */
120 #define BTA_AV_REMOTE_CMD_EVT 10 /* remote control command */
121 #define BTA_AV_REMOTE_RSP_EVT 11 /* remote control response */
122 #define BTA_AV_VENDOR_CMD_EVT 12 /* vendor dependent remote control command */
123 #define BTA_AV_VENDOR_RSP_EVT                                              \
124   13                           /* vendor dependent remote control response \
125                                   */
126 #define BTA_AV_RECONFIG_EVT 14 /* reconfigure response */
127 #define BTA_AV_SUSPEND_EVT 15  /* suspend response */
128 #define BTA_AV_PENDING_EVT                                             \
129   16                           /* incoming connection pending:         \
130                                 * signal channel is open and stream is \
131                                 * not open after                       \
132                                 * BTA_AV_SIGNALLING_TIMEOUT_MS */
133 #define BTA_AV_META_MSG_EVT 17 /* metadata messages */
134 #define BTA_AV_REJECT_EVT 18   /* incoming connection rejected */
135 #define BTA_AV_RC_FEAT_EVT \
136   19 /* remote control channel peer supported features update */
137 #define BTA_AV_SINK_MEDIA_CFG_EVT 20    /* command to configure codec */
138 #define BTA_AV_SINK_MEDIA_DATA_EVT 21   /* sending data to Media Task */
139 #define BTA_AV_OFFLOAD_START_RSP_EVT 22 /* a2dp offload start response */
140 #define BTA_AV_RC_BROWSE_OPEN_EVT 23    /* remote control channel open */
141 #define BTA_AV_RC_BROWSE_CLOSE_EVT 24   /* remote control channel closed */
142 #define BTA_AV_RC_PSM_EVT 25            /* cover art psm update */
143 /* Max BTA event */
144 #define BTA_AV_MAX_EVT 26
145 
146 typedef uint8_t tBTA_AV_EVT;
147 
148 typedef enum {
149   BTA_AV_CODEC_TYPE_UNKNOWN = 0x00,
150   BTA_AV_CODEC_TYPE_SBC = 0x01,
151   BTA_AV_CODEC_TYPE_AAC = 0x02,
152   BTA_AV_CODEC_TYPE_APTX = 0x04,
153   BTA_AV_CODEC_TYPE_APTXHD = 0x08,
154   BTA_AV_CODEC_TYPE_LDAC = 0x10
155 } tBTA_AV_CODEC_TYPE;
156 
157 /* Event associated with BTA_AV_ENABLE_EVT */
158 typedef struct { tBTA_AV_FEAT features; } tBTA_AV_ENABLE;
159 
160 /* Event associated with BTA_AV_REGISTER_EVT */
161 typedef struct {
162   tBTA_AV_CHNL chnl; /* audio/video */
163   tBTA_AV_HNDL hndl; /* Handle associated with the stream. */
164   uint8_t app_id;    /* ID associated with call to BTA_AvRegister() */
165   tBTA_AV_STATUS status;
166 } tBTA_AV_REGISTER;
167 
168 /* data associated with BTA_AV_OPEN_EVT */
169 #define BTA_AV_EDR_2MBPS 0x01
170 #define BTA_AV_EDR_3MBPS 0x02
171 typedef uint8_t tBTA_AV_EDR;
172 
173 typedef struct {
174   tBTA_AV_CHNL chnl;
175   tBTA_AV_HNDL hndl;
176   RawAddress bd_addr;
177   tBTA_AV_STATUS status;
178   bool starting;
179   tBTA_AV_EDR edr; /* 0, if peer device does not support EDR */
180   uint8_t sep;     /*  sep type of peer device */
181 } tBTA_AV_OPEN;
182 
183 /* data associated with BTA_AV_CLOSE_EVT */
184 typedef struct {
185   tBTA_AV_CHNL chnl;
186   tBTA_AV_HNDL hndl;
187 } tBTA_AV_CLOSE;
188 
189 /* data associated with BTA_AV_START_EVT */
190 typedef struct {
191   tBTA_AV_CHNL chnl;
192   tBTA_AV_HNDL hndl;
193   tBTA_AV_STATUS status;
194   bool initiator; /* true, if local device initiates the START */
195   bool suspending;
196 } tBTA_AV_START;
197 
198 /* data associated with BTA_AV_SUSPEND_EVT, BTA_AV_STOP_EVT */
199 typedef struct {
200   tBTA_AV_CHNL chnl;
201   tBTA_AV_HNDL hndl;
202   bool initiator; /* true, if local device initiates the SUSPEND */
203   tBTA_AV_STATUS status;
204 } tBTA_AV_SUSPEND;
205 
206 /* data associated with BTA_AV_RECONFIG_EVT */
207 typedef struct {
208   tBTA_AV_CHNL chnl;
209   tBTA_AV_HNDL hndl;
210   tBTA_AV_STATUS status;
211 } tBTA_AV_RECONFIG;
212 
213 /* data associated with BTA_AV_PROTECT_REQ_EVT */
214 typedef struct {
215   tBTA_AV_CHNL chnl;
216   tBTA_AV_HNDL hndl;
217   uint8_t* p_data;
218   uint16_t len;
219 } tBTA_AV_PROTECT_REQ;
220 
221 /* data associated with BTA_AV_PROTECT_RSP_EVT */
222 typedef struct {
223   tBTA_AV_CHNL chnl;
224   tBTA_AV_HNDL hndl;
225   uint8_t* p_data;
226   uint16_t len;
227   tBTA_AV_ERR err_code;
228 } tBTA_AV_PROTECT_RSP;
229 
230 /* data associated with BTA_AV_RC_OPEN_EVT */
231 typedef struct {
232   uint8_t rc_handle;
233   uint16_t cover_art_psm;
234   tBTA_AV_FEAT peer_features;
235   RawAddress peer_addr;
236   tBTA_AV_STATUS status;
237 } tBTA_AV_RC_OPEN;
238 
239 /* data associated with BTA_AV_RC_CLOSE_EVT */
240 typedef struct {
241   uint8_t rc_handle;
242   RawAddress peer_addr;
243 } tBTA_AV_RC_CLOSE;
244 
245 /* data associated with BTA_AV_RC_BROWSE_OPEN_EVT */
246 typedef struct {
247   uint8_t rc_handle;
248   RawAddress peer_addr;
249   tBTA_AV_STATUS status;
250 } tBTA_AV_RC_BROWSE_OPEN;
251 
252 /* data associated with BTA_AV_RC_BROWSE_CLOSE_EVT */
253 typedef struct {
254   uint8_t rc_handle;
255   RawAddress peer_addr;
256 } tBTA_AV_RC_BROWSE_CLOSE;
257 
258 /* data associated with BTA_AV_RC_FEAT_EVT */
259 typedef struct {
260   uint8_t rc_handle;
261   tBTA_AV_FEAT peer_features;
262   RawAddress peer_addr;
263 } tBTA_AV_RC_FEAT;
264 
265 /* data associated with BTA_AV_RC_PSM_EVT */
266 typedef struct {
267   uint8_t rc_handle;
268   uint16_t cover_art_psm;
269   RawAddress peer_addr;
270 } tBTA_AV_RC_PSM;
271 
272 /* data associated with BTA_AV_REMOTE_CMD_EVT */
273 typedef struct {
274   uint8_t rc_handle;
275   tBTA_AV_RC rc_id;
276   tBTA_AV_STATE key_state;
277   uint8_t len;
278   uint8_t* p_data;
279   tAVRC_HDR hdr; /* Message header. */
280   uint8_t label;
281 } tBTA_AV_REMOTE_CMD;
282 
283 /* data associated with BTA_AV_REMOTE_RSP_EVT */
284 typedef struct {
285   uint8_t rc_handle;
286   tBTA_AV_RC rc_id;
287   tBTA_AV_STATE key_state;
288   uint8_t len;
289   uint8_t* p_data;
290   tBTA_AV_CODE rsp_code;
291   uint8_t label;
292 } tBTA_AV_REMOTE_RSP;
293 
294 /* data associated with BTA_AV_VENDOR_CMD_EVT, BTA_AV_VENDOR_RSP_EVT */
295 typedef struct {
296   uint8_t rc_handle;
297   uint16_t len; /* Max vendor dependent message is 512 */
298   uint8_t label;
299   tBTA_AV_CODE code;
300   uint32_t company_id;
301   uint8_t* p_data;
302 } tBTA_AV_VENDOR;
303 
304 /* data associated with BTA_AV_META_MSG_EVT */
305 typedef struct {
306   uint8_t rc_handle;
307   uint16_t len;
308   uint8_t label;
309   tBTA_AV_CODE code;
310   uint32_t company_id;
311   uint8_t* p_data;
312   tAVRC_MSG* p_msg;
313 } tBTA_AV_META_MSG;
314 
315 /* data associated with BTA_AV_PENDING_EVT */
316 typedef struct { RawAddress bd_addr; } tBTA_AV_PEND;
317 
318 /* data associated with BTA_AV_REJECT_EVT */
319 typedef struct {
320   RawAddress bd_addr;
321   tBTA_AV_HNDL hndl; /* Handle associated with the stream that rejected the
322                         connection. */
323 } tBTA_AV_REJECT;
324 
325 /* union of data associated with AV callback */
326 typedef union {
327   tBTA_AV_CHNL chnl;
328   tBTA_AV_ENABLE enable;
329   tBTA_AV_REGISTER registr;
330   tBTA_AV_OPEN open;
331   tBTA_AV_CLOSE close;
332   tBTA_AV_START start;
333   tBTA_AV_PROTECT_REQ protect_req;
334   tBTA_AV_PROTECT_RSP protect_rsp;
335   tBTA_AV_RC_OPEN rc_open;
336   tBTA_AV_RC_CLOSE rc_close;
337   tBTA_AV_RC_BROWSE_OPEN rc_browse_open;
338   tBTA_AV_RC_BROWSE_CLOSE rc_browse_close;
339   tBTA_AV_REMOTE_CMD remote_cmd;
340   tBTA_AV_REMOTE_RSP remote_rsp;
341   tBTA_AV_VENDOR vendor_cmd;
342   tBTA_AV_VENDOR vendor_rsp;
343   tBTA_AV_RECONFIG reconfig;
344   tBTA_AV_SUSPEND suspend;
345   tBTA_AV_PEND pend;
346   tBTA_AV_META_MSG meta_msg;
347   tBTA_AV_REJECT reject;
348   tBTA_AV_RC_FEAT rc_feat;
349   tBTA_AV_RC_PSM rc_cover_art_psm;
350   tBTA_AV_STATUS status;
351 } tBTA_AV;
352 
353 typedef struct {
354   uint8_t* codec_info;
355   RawAddress bd_addr;
356 } tBTA_AVK_CONFIG;
357 
358 /* union of data associated with AV Media callback */
359 typedef union {
360   BT_HDR* p_data;
361   tBTA_AVK_CONFIG avk_config;
362 } tBTA_AV_MEDIA;
363 
364 #define BTA_GROUP_NAVI_MSG_OP_DATA_LEN 5
365 
366 /* AV callback */
367 typedef void(tBTA_AV_CBACK)(tBTA_AV_EVT event, tBTA_AV* p_data);
368 typedef void(tBTA_AV_SINK_DATA_CBACK)(const RawAddress&, tBTA_AV_EVT event,
369                                       tBTA_AV_MEDIA* p_data);
370 
371 /* type for stream state machine action functions */
372 struct tBTA_AV_SCB;
373 union tBTA_AV_DATA;
374 typedef void (*tBTA_AV_ACT)(tBTA_AV_SCB* p_cb, tBTA_AV_DATA* p_data);
375 
376 /* AV configuration structure */
377 typedef struct {
378   uint32_t company_id;  /* AVRCP Company ID */
379   uint16_t avrc_ct_cat; /* AVRCP controller categories */
380   uint16_t avrc_tg_cat; /* AVRCP target categories */
381   uint16_t audio_mqs;      /* AVDTP audio channel max data queue size */
382   bool avrc_group;     /* true, to accept AVRC 1.3 group nevigation command */
383   uint8_t num_co_ids;  /* company id count in p_meta_co_ids */
384   uint8_t num_evt_ids; /* event id count in p_meta_evt_ids */
385   tBTA_AV_CODE
386       rc_pass_rsp; /* the default response code for pass through commands */
387   const uint32_t*
388       p_meta_co_ids; /* the metadata Get Capabilities response for company id */
389   const uint8_t* p_meta_evt_ids; /* the the metadata Get Capabilities response
390                                     for event id */
391   char avrc_controller_name[BTA_SERVICE_NAME_LEN]; /* Default AVRCP controller
392                                                       name */
393   char avrc_target_name[BTA_SERVICE_NAME_LEN]; /* Default AVRCP target name*/
394 } tBTA_AV_CFG;
395 
396 /*****************************************************************************
397  *  External Function Declarations
398  ****************************************************************************/
399 
400 /*******************************************************************************
401  *
402  * Function         BTA_AvEnable
403  *
404  * Description      Enable the advanced audio/video service. When the enable
405  *                  operation is complete the callback function will be
406  *                  called with a BTA_AV_ENABLE_EVT. This function must
407  *                  be called before other function in the AV API are
408  *                  called.
409  *
410  * Returns          void
411  *
412  ******************************************************************************/
413 void BTA_AvEnable(tBTA_AV_FEAT features, tBTA_AV_CBACK* p_cback);
414 
415 /*******************************************************************************
416  *
417  * Function         BTA_AvDisable
418  *
419  * Description      Disable the advanced audio/video service.
420  *
421  *
422  * Returns          void
423  *
424  ******************************************************************************/
425 void BTA_AvDisable(void);
426 
427 /*******************************************************************************
428  *
429  * Function         BTA_AvRegister
430  *
431  * Description      Register the audio or video service to stack. When the
432  *                  operation is complete the callback function will be
433  *                  called with a BTA_AV_REGISTER_EVT. This function must
434  *                  be called before AVDT stream is open.
435  *
436  *
437  * Returns          void
438  *
439  ******************************************************************************/
440 void BTA_AvRegister(tBTA_AV_CHNL chnl, const char* p_service_name,
441                     uint8_t app_id, tBTA_AV_SINK_DATA_CBACK* p_sink_data_cback,
442                     uint16_t service_uuid);
443 
444 /*******************************************************************************
445  *
446  * Function         BTA_AvDeregister
447  *
448  * Description      Deregister the audio or video service
449  *
450  * Returns          void
451  *
452  ******************************************************************************/
453 void BTA_AvDeregister(tBTA_AV_HNDL hndl);
454 
455 /*******************************************************************************
456  *
457  * Function         BTA_AvOpen
458  *
459  * Description      Opens an advanced audio/video connection to a peer device.
460  *                  When connection is open callback function is called
461  *                  with a BTA_AV_OPEN_EVT.
462  *
463  * Returns          void
464  *
465  ******************************************************************************/
466 void BTA_AvOpen(const RawAddress& bd_addr, tBTA_AV_HNDL handle, bool use_rc,
467                 uint16_t uuid);
468 
469 /*******************************************************************************
470  *
471  * Function         BTA_AvClose
472  *
473  * Description      Close the current streams.
474  *
475  * Returns          void
476  *
477  ******************************************************************************/
478 void BTA_AvClose(tBTA_AV_HNDL handle);
479 
480 /*******************************************************************************
481  *
482  * Function         BTA_AvDisconnect
483  *
484  * Description      Close the connection to the address.
485  *
486  * Returns          void
487  *
488  ******************************************************************************/
489 void BTA_AvDisconnect(tBTA_AV_HNDL handle);
490 
491 /*******************************************************************************
492  *
493  * Function         BTA_AvStart
494  *
495  * Description      Start audio/video stream data transfer.
496  *
497  * Returns          void
498  *
499  ******************************************************************************/
500 void BTA_AvStart(tBTA_AV_HNDL handle);
501 
502 /*******************************************************************************
503  *
504  * Function         BTA_AvStop
505  *
506  * Description      Stop audio/video stream data transfer.
507  *                  If suspend is true, this function sends AVDT suspend signal
508  *                  to the connected peer(s).
509  *
510  * Returns          void
511  *
512  ******************************************************************************/
513 void BTA_AvStop(tBTA_AV_HNDL handle, bool suspend);
514 
515 /*******************************************************************************
516  *
517  * Function         BTA_AvReconfig
518  *
519  * Description      Reconfigure the audio/video stream.
520  *                  If suspend is true, this function tries the
521  *                  suspend/reconfigure procedure first.
522  *                  If suspend is false or when suspend/reconfigure fails,
523  *                  this function closes and re-opens the AVDT connection.
524  *
525  * Returns          void
526  *
527  ******************************************************************************/
528 void BTA_AvReconfig(tBTA_AV_HNDL hndl, bool suspend, uint8_t sep_info_idx,
529                     uint8_t* p_codec_info, uint8_t num_protect,
530                     const uint8_t* p_protect_info);
531 
532 /*******************************************************************************
533  *
534  * Function         BTA_AvProtectReq
535  *
536  * Description      Send a content protection request.  This function can only
537  *                  be used if AV is enabled with feature BTA_AV_FEAT_PROTECT.
538  *
539  * Returns          void
540  *
541  ******************************************************************************/
542 void BTA_AvProtectReq(tBTA_AV_HNDL hndl, uint8_t* p_data, uint16_t len);
543 
544 /*******************************************************************************
545  *
546  * Function         BTA_AvProtectRsp
547  *
548  * Description      Send a content protection response.  This function must
549  *                  be called if a BTA_AV_PROTECT_REQ_EVT is received.
550  *                  This function can only be used if AV is enabled with
551  *                  feature BTA_AV_FEAT_PROTECT.
552  *
553  * Returns          void
554  *
555  ******************************************************************************/
556 void BTA_AvProtectRsp(tBTA_AV_HNDL hndl, uint8_t error_code, uint8_t* p_data,
557                       uint16_t len);
558 
559 /*******************************************************************************
560  *
561  * Function         BTA_AvRemoteCmd
562  *
563  * Description      Send a remote control command.  This function can only
564  *                  be used if AV is enabled with feature BTA_AV_FEAT_RCCT.
565  *
566  * Returns          void
567  *
568  ******************************************************************************/
569 void BTA_AvRemoteCmd(uint8_t rc_handle, uint8_t label, tBTA_AV_RC rc_id,
570                      tBTA_AV_STATE key_state);
571 
572 /*******************************************************************************
573  *
574  * Function         BTA_AvRemoteVendorUniqueCmd
575  *
576  * Description      Send a remote control command with Vendor Unique rc_id.
577  *                  This function can only be used if AV is enabled with
578  *                  feature BTA_AV_FEAT_RCCT.
579  *
580  * Returns          void
581  *
582  ******************************************************************************/
583 void BTA_AvRemoteVendorUniqueCmd(uint8_t rc_handle, uint8_t label,
584                                  tBTA_AV_STATE key_state, uint8_t* p_msg,
585                                  uint8_t buf_len);
586 
587 /*******************************************************************************
588  *
589  * Function         BTA_AvVendorCmd
590  *
591  * Description      Send a vendor dependent remote control command.  This
592  *                  function can only be used if AV is enabled with feature
593  *                  BTA_AV_FEAT_VENDOR.
594  *
595  * Returns          void
596  *
597  ******************************************************************************/
598 void BTA_AvVendorCmd(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE cmd_code,
599                      uint8_t* p_data, uint16_t len);
600 
601 /*******************************************************************************
602  *
603  * Function         BTA_AvVendorRsp
604  *
605  * Description      Send a vendor dependent remote control response.
606  *                  This function must be called if a BTA_AV_VENDOR_CMD_EVT
607  *                  is received. This function can only be used if AV is
608  *                  enabled with feature BTA_AV_FEAT_VENDOR.
609  *
610  * Returns          void
611  *
612  ******************************************************************************/
613 void BTA_AvVendorRsp(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code,
614                      uint8_t* p_data, uint16_t len, uint32_t company_id);
615 
616 /*******************************************************************************
617  *
618  * Function         BTA_AvOpenRc
619  *
620  * Description      Open an AVRCP connection toward the device with the
621  *                  specified handle
622  *
623  * Returns          void
624  *
625  ******************************************************************************/
626 void BTA_AvOpenRc(tBTA_AV_HNDL handle);
627 
628 /*******************************************************************************
629  *
630  * Function         BTA_AvCloseRc
631  *
632  * Description      Close an AVRCP connection
633  *
634  * Returns          void
635  *
636  ******************************************************************************/
637 void BTA_AvCloseRc(uint8_t rc_handle);
638 
639 /*******************************************************************************
640  *
641  * Function         BTA_AvMetaRsp
642  *
643  * Description      Send a Metadata command/response. The message contained
644  *                  in p_pkt can be composed with AVRC utility functions.
645  *                  This function can only be used if AV is enabled with feature
646  *                  BTA_AV_FEAT_METADATA.
647  *
648  * Returns          void
649  *
650  ******************************************************************************/
651 void BTA_AvMetaRsp(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code,
652                    BT_HDR* p_pkt);
653 
654 /*******************************************************************************
655  *
656  * Function         BTA_AvMetaCmd
657  *
658  * Description      Send a Metadata/Advanced Control command. The message
659 *contained
660  *                  in p_pkt can be composed with AVRC utility functions.
661  *                  This function can only be used if AV is enabled with feature
662  *                  BTA_AV_FEAT_METADATA.
663  *                  This message is sent only when the peer supports the TG
664 *role.
665 *8                  The only command makes sense right now is the absolute
666 *volume command.
667  *
668  * Returns          void
669  *
670  ******************************************************************************/
671 void BTA_AvMetaCmd(uint8_t rc_handle, uint8_t label, tBTA_AV_CMD cmd_code,
672                    BT_HDR* p_pkt);
673 
674 /*******************************************************************************
675  *
676  * Function         BTA_AvOffloadStart
677  *
678  * Description      Request Starting of A2DP Offload.
679  *                  This function is used to start A2DP offload if vendor lib
680  *                  has the feature enabled.
681  *
682  * Returns          void
683  *
684  ******************************************************************************/
685 void BTA_AvOffloadStart(tBTA_AV_HNDL hndl);
686 
687 /*******************************************************************************
688  *
689  * Function         BTA_AvOffloadStartRsp
690  *
691  * Description      Response from vendor library indicating response for
692  *                  OffloadStart.
693  *
694  * Returns          void
695  *
696  ******************************************************************************/
697 void BTA_AvOffloadStartRsp(tBTA_AV_HNDL hndl, tBTA_AV_STATUS status);
698 
699 /**
700  * Obtain the Channel Index for a peer.
701  * If the peer already has associated internal state, the corresponding
702  * Channel Index for that state is returned. Otherwise, the Channel Index
703  * for unused internal state is returned instead.
704  *
705  * @param peer_address the peer address
706  * @return the peer Channel Index index if obtained, otherwise -1
707  */
708 int BTA_AvObtainPeerChannelIndex(const RawAddress& peer_address);
709 
710 /**
711  * Dump debug-related information for the BTA AV module.
712  *
713  * @param fd the file descriptor to use for writing the ASCII formatted
714  * information
715  */
716 void bta_debug_av_dump(int fd);
717 
718 #endif /* BTA_AV_API_H */
719