1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
24
25
26
27
33
34
35
36
37
38
39
40
43
44
45
53
54
55
56
57
59
60
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
349
350
351
352
353
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
403
404
405
410
411
412
416
417
418
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
468
469
470
471
472
473
474
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
542
543
544
545
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
720
721
724
726
727
728
729
730
731
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
/* ... */
/* ... */
#ifndef AVDT_INT_H
#define AVDT_INT_H
#include "stack/avdt_api.h"
#include "stack/avdtc_api.h"
#include "avdt_defs.h"
#include "stack/l2c_api.h"
#include "stack/btm_api.h"
#include "osi/fixed_queue.h"6 includes
#if (AVRC_INCLUDED == TRUE)
#ifndef AVDT_DEBUG
#define AVDT_DEBUG FALSE
#endif
/* ... */
enum {
AVDT_CHAN_SIG,
AVDT_CHAN_MEDIA,
#if AVDT_REPORTING == TRUE
AVDT_CHAN_REPORT,
#endif
AVDT_CHAN_NUM_TYPES
}{...};
#if ((AVDT_MULTIPLEXING == TRUE) && (AVDT_REPORTING == TRUE))
#define AVDT_PSC (AVDT_PSC_TRANS | AVDT_PSC_MUX | AVDT_PSC_REPORT | AVDT_PSC_DELAY_RPT)
#define AVDT_LEG_PSC (AVDT_PSC_TRANS | AVDT_PSC_MUX | AVDT_PSC_REPORT)/* ... */
#else
#if (AVDT_MULTIPLEXING == TRUE)
#define AVDT_PSC (AVDT_PSC_TRANS | AVDT_PSC_MUX | AVDT_PSC_DELAY_RPT)
#define AVDT_LEG_PSC (AVDT_PSC_TRANS | AVDT_PSC_MUX)/* ... */
#else
#if (AVDT_REPORTING == TRUE)
#define AVDT_PSC (AVDT_PSC_TRANS | AVDT_PSC_REPORT | AVDT_PSC_DELAY_RPT)
#define AVDT_LEG_PSC (AVDT_PSC_TRANS | AVDT_PSC_REPORT)/* ... */
#else
#define AVDT_PSC (AVDT_PSC_TRANS | AVDT_PSC_DELAY_RPT)
#define AVDT_LEG_PSC (AVDT_PSC_TRANS)/* ... */
#endif
/* ... */
#endif
/* ... */
#endif
#define AVDT_CLOSE_ACP 0
#define AVDT_CLOSE_INT 1
#define AVDT_OPEN_ACP 2
#define AVDT_OPEN_INT 3
#define AVDT_CONF_ACP 4
#define AVDT_CONF_INT 5
#define AVDT_VERIFY_OPEN 0
#define AVDT_VERIFY_STREAMING 1
#define AVDT_VERIFY_SUSPEND 2
#define AVDT_VERIFY_START 3
#define AVDT_CCB_MKR 0x80
#define AVDT_HDR_OFFSET (L2CAP_MIN_OFFSET + AVDT_NUM_SEPS)
/* ... */
#define AVDT_MSG_OFFSET (L2CAP_MIN_OFFSET + AVDT_NUM_SEPS + AVDT_LEN_TYPE_START)
#define AVDT_SCB_TC_CONN_TOUT 10
#define AVDT_SCB_TC_DISC_TOUT 10
#define AVDT_SCB_TC_DELAY_RPT_TOUT 516 defines
#ifndef AVDT_RET_MAX
#define AVDT_RET_MAX 1
#endif
enum {
AVDT_CCB_IDLE_ST,
AVDT_CCB_OPENING_ST,
AVDT_CCB_OPEN_ST,
AVDT_CCB_CLOSING_ST
}{...};
enum {
AVDT_CCB_CHAN_OPEN,
AVDT_CCB_CHAN_CLOSE,
AVDT_CCB_CHK_CLOSE,
AVDT_CCB_HDL_DISCOVER_CMD,
AVDT_CCB_HDL_DISCOVER_RSP,
AVDT_CCB_HDL_GETCAP_CMD,
AVDT_CCB_HDL_GETCAP_RSP,
AVDT_CCB_HDL_START_CMD,
AVDT_CCB_HDL_START_RSP,
AVDT_CCB_HDL_SUSPEND_CMD,
AVDT_CCB_HDL_SUSPEND_RSP,
AVDT_CCB_SND_DISCOVER_CMD,
AVDT_CCB_SND_DISCOVER_RSP,
AVDT_CCB_SND_GETCAP_CMD,
AVDT_CCB_SND_GETCAP_RSP,
AVDT_CCB_SND_START_CMD,
AVDT_CCB_SND_START_RSP,
AVDT_CCB_SND_SUSPEND_CMD,
AVDT_CCB_SND_SUSPEND_RSP,
AVDT_CCB_CLEAR_CMDS,
AVDT_CCB_CMD_FAIL,
AVDT_CCB_FREE_CMD,
AVDT_CCB_CONG_STATE,
AVDT_CCB_RET_CMD,
AVDT_CCB_SND_CMD,
AVDT_CCB_SND_MSG,
AVDT_CCB_SET_RECONN,
AVDT_CCB_CLR_RECONN,
AVDT_CCB_CHK_RECONN,
AVDT_CCB_CHK_TIMER,
AVDT_CCB_SET_CONN,
AVDT_CCB_SET_DISCONN,
AVDT_CCB_DO_DISCONN,
AVDT_CCB_LL_CLOSED,
AVDT_CCB_LL_OPENED,
AVDT_CCB_DEALLOC,
AVDT_CCB_NUM_ACTIONS
}{...};
#define AVDT_CCB_IGNORE AVDT_CCB_NUM_ACTIONS
enum {
AVDT_CCB_API_DISCOVER_REQ_EVT,
AVDT_CCB_API_GETCAP_REQ_EVT,
AVDT_CCB_API_START_REQ_EVT,
AVDT_CCB_API_SUSPEND_REQ_EVT,
AVDT_CCB_API_DISCOVER_RSP_EVT,
AVDT_CCB_API_GETCAP_RSP_EVT,
AVDT_CCB_API_START_RSP_EVT,
AVDT_CCB_API_SUSPEND_RSP_EVT,
AVDT_CCB_API_CONNECT_REQ_EVT,
AVDT_CCB_API_DISCONNECT_REQ_EVT,
AVDT_CCB_MSG_DISCOVER_CMD_EVT,
AVDT_CCB_MSG_GETCAP_CMD_EVT,
AVDT_CCB_MSG_START_CMD_EVT,
AVDT_CCB_MSG_SUSPEND_CMD_EVT,
AVDT_CCB_MSG_DISCOVER_RSP_EVT,
AVDT_CCB_MSG_GETCAP_RSP_EVT,
AVDT_CCB_MSG_START_RSP_EVT,
AVDT_CCB_MSG_SUSPEND_RSP_EVT,
AVDT_CCB_RCVRSP_EVT,
AVDT_CCB_SENDMSG_EVT,
AVDT_CCB_RET_TOUT_EVT,
AVDT_CCB_RSP_TOUT_EVT,
AVDT_CCB_ID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ND_ABORT_REQ,
AVDT_SCB_SND_ABORT_RSP,
AVDT_SCB_SND_CLOSE_REQ,
AVDT_SCB_SND_STREAM_CLOSE,
AVDT_SCB_SND_CLOSE_RSP,
AVDT_SCB_SND_GETCONFIG_REQ,
AVDT_SCB_SND_GETCONFIG_RSP,
AVDT_SCB_SND_OPEN_REQ,
AVDT_SCB_SND_OPEN_RSP,
AVDT_SCB_SND_RECONFIG_REQ,
AVDT_SCB_SND_RECONFIG_RSP,
AVDT_SCB_SND_SECURITY_REQ,
AVDT_SCB_SND_SECURITY_RSP,
AVDT_SCB_SND_SETCONFIG_REQ,
AVDT_SCB_SND_SETCONFIG_REJ,
AVDT_SCB_SND_SETCONFIG_RSP,
AVDT_SCB_SND_TC_CLOSE,
AVDT_SCB_CB_ERR,
AVDT_SCB_CONG_STATE,
AVDT_SCB_REJ_STATE,
AVDT_SCB_REJ_IN_USE,
AVDT_SCB_REJ_NOT_IN_USE,
AVDT_SCB_SET_REMOVE,
AVDT_SCB_FREE_PKT,
AVDT_SCB_CLR_PKT,
AVDT_SCB_CHK_SND_PKT,
AVDT_SCB_TC_TIMER,
AVDT_SCB_CLR_VARS,
AVDT_SCB_DEALLOC,
AVDT_SCB_HDL_DELAY_RPT_TOUT,
AVDT_SCB_INIT_OPEN_REQ_EVT,
AVDT_SCB_SEND_DELAY_REPORT_CMD_EVT,
AVDT_SCB_NUM_ACTIONS
}{...};
#define AVDT_SCB_IGNORE AVDT_SCB_NUM_ACTIONS
enum {
AVDT_SCB_API_REMOVE_EVT,
AVDT_SCB_API_WRITE_REQ_EVT,
AVDT_SCB_API_GETCONFIG_REQ_EVT,
AVDT_SCB_API_DELAY_RPT_REQ_EVT,
AVDT_SCB_API_SETCONFIG_REQ_EVT,
AVDT_SCB_API_OPEN_REQ_EVT,
AVDT_SCB_API_CLOSE_REQ_EVT,
AVDT_SCB_API_RECONFIG_REQ_EVT,
AVDT_SCB_API_SECURITY_REQ_EVT,
AVDT_SCB_API_ABORT_REQ_E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
AVDT_SCB_DELAY_RPT_RSP_TOUT_EVT
}{...};
#if AVDT_REPORTING == TRUE
#define AVDT_NUM_RT_TBL ((AVDT_NUM_SEPS<<1) + 1)/* ... */
#else
#define AVDT_NUM_RT_TBL (AVDT_NUM_SEPS + 1)
#endif
/* ... */
#define AVDT_AD_ST_UNUSED 0
#define AVDT_AD_ST_IDLE 1
#define AVDT_AD_ST_ACP 2
#define AVDT_AD_ST_INT 3
#define AVDT_AD_ST_CONN 4
#define AVDT_AD_ST_CFG 5
#define AVDT_AD_ST_OPEN 6
#define AVDT_AD_ST_SEC_INT 7
#define AVDT_AD_ST_SEC_ACP 8
#define AVDT_L2C_CFG_IND_DONE (1<<0)
#define AVDT_L2C_CFG_CFM_DONE (1<<1)
#define AVDT_L2C_CFG_CONN_INT (1<<2)
#define AVDT_L2C_CFG_CONN_ACP (1<<3)
#define AVDT_AD_FAILED L2CAP_DW_FAILED
#define AVDT_AD_SUCCESS L2CAP_DW_SUCCESS
#define AVDT_AD_CONGESTED L2CAP_DW_CONGESTED 16 defines
/* ... */
typedef union {
tAVDT_EVT_HDR hdr;
tAVDT_EVT_HDR single;
tAVDT_SETCONFIG config_cmd;
tAVDT_CONFIG reconfig_cmd;
tAVDT_MULTI multi;
tAVDT_SECURITY security_cmd;
tAVDT_DISCOVER discover_rsp;
tAVDT_CONFIG svccap;
tAVDT_SECURITY security_rsp;
tAVDT_DELAY_RPT delay_rpt_cmd;
}{...} tAVDT_MSG;
typedef struct {
tAVDT_CTRL_CBACK *p_cback;
tAVDT_SEP_INFO *p_sep_info;
UINT8 num_seps;
}{...} tAVDT_CCB_API_DISCOVER;
typedef struct {
tAVDT_EVT_HDR single;
tAVDT_CTRL_CBACK *p_cback;
tAVDT_CFG *p_cfg;
}{...} tAVDT_CCB_API_GETCAP;
typedef struct {
tAVDT_CTRL_CBACK *p_cback;
UINT8 sec_mask;
}{...} tAVDT_CCB_API_CONNECT;
typedef struct {
tAVDT_CTRL_CBACK *p_cback;
}{...} tAVDT_CCB_API_DISCONNECT;
typedef union {
tAVDT_CCB_API_DISCOVER discover;
tAVDT_CCB_API_GETCAP getcap;
tAVDT_CCB_API_CONNECT connect;
tAVDT_CCB_API_DISCONNECT disconnect;
tAVDT_MSG msg;
BOOLEAN llcong;
UINT8 err_code;
}{...} tAVDT_CCB_EVT;
typedef struct {
BD_ADDR peer_addr;
TIMER_LIST_ENT timer_entry;
fixed_queue_t *cmd_q;
fixed_queue_t *rsp_q;
tAVDT_CTRL_CBACK *proc_cback;
tAVDT_CTRL_CBACK *p_conn_cback;
void *p_proc_data;
BT_HDR *p_curr_cmd;
BT_HDR *p_curr_msg;
BT_HDR *p_rx_msg;
BOOLEAN allocated;
UINT8 state;
BOOLEAN ll_opened;
BOOLEAN proc_busy;
UINT8 proc_param;
BOOLEAN cong;
UINT8 label;
BOOLEAN reconn;
UINT8 ret_count;
UINT8 disc_rsn;
}{...} tAVDT_CCB;
typedef void (*tAVDT_CCB_ACTION)(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
typedef struct {
BT_HDR *p_buf;
UINT32 time_stamp;
#if AVDT_MULTIPLEXING == TRUE
fixed_queue_t *frag_q;
UINT8 *p_data;
UINT32 data_len;/* ... */
#endif
UINT8 m_pt;
tAVDT_DATA_OPT_MASK opt;
}{...} tAVDT_SCB_APIWRITE;
typedef struct {
UINT8 old_tc_state;
UINT8 tcid;
UINT8 type;
UINT8 disc_rsn;
}{...} tAVDT_SCB_TC_CLOSE;
typedef union {
tAVDT_MSG msg;
tAVDT_SCB_APIWRITE apiwrite;
tAVDT_DELAY_RPT apidelay;
tAVDT_OPEN open;
tAVDT_SCB_TC_CLOSE close;
BOOLEAN llcong;
BT_HDR *p_pkt;
}{...} tAVDT_SCB_EVT;
typedef struct {
tAVDT_CS cs;
tAVDT_CFG curr_cfg;
tAVDT_CFG req_cfg;
TIMER_LIST_ENT timer_entry;
BT_HDR *p_pkt;
tAVDT_CCB *p_ccb;
UINT16 media_seq;
BOOLEAN allocated;
BOOLEAN in_use;
BOOLEAN sink_activated;
UINT8 role;
BOOLEAN remove;
UINT8 state;
UINT8 peer_seid;
UINT8 curr_evt;
BOOLEAN cong;
UINT8 close_code;
#if AVDT_MULTIPLEXING == TRUE
fixed_queue_t *frag_q;
UINT32 frag_off;
UINT32 frag_org_len;
UINT8 *p_next_frag;
UINT8 *p_media_buf;
UINT32 media_buf_len; /* ... */
#endif
}{...} tAVDT_SCB;
typedef void (*tAVDT_SCB_ACTION)(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
typedef struct {
UINT16 peer_mtu;
UINT16 my_mtu;
UINT16 my_flush_to;
UINT16 lcid;
UINT8 tcid;
UINT8 ccb_idx;
UINT8 state;
UINT8 cfg_flags;
UINT8 id;
}{...} tAVDT_TC_TBL;
typedef struct {
UINT16 lcid;
UINT8 scb_hdl;
}{...} tAVDT_RT_TBL;
typedef struct {
tAVDT_RT_TBL rt_tbl[AVDT_NUM_LINKS][AVDT_NUM_RT_TBL];
tAVDT_TC_TBL tc_tbl[AVDT_NUM_TC_TBL];
UINT8 lcid_tbl[MAX_L2CAP_CHANNELS];
}{...} tAVDT_AD;
typedef struct {
tAVDT_REG rcb;
tAVDT_CCB ccb[AVDT_NUM_LINKS];
tAVDT_SCB scb[AVDT_NUM_SEPS];
tAVDT_AD ad;
tAVDTC_CTRL_CBACK *p_conf_cback;
tAVDT_CCB_ACTION *p_ccb_act;
tAVDT_SCB_ACTION *p_scb_act;
tAVDT_CTRL_CBACK *p_conn_cback;
UINT8 trace_level;
UINT16 delay_value;
}{...} tAVDT_CB;
/* ... */
extern void avdt_ccb_init(void);
extern void avdt_ccb_event(tAVDT_CCB *p_ccb, UINT8 event, tAVDT_CCB_EVT *p_data);
extern tAVDT_CCB *avdt_ccb_by_bd(BD_ADDR bd_addr);
extern tAVDT_CCB *avdt_ccb_alloc(BD_ADDR bd_addr);
extern void avdt_ccb_dealloc(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern UINT8 avdt_ccb_to_idx(tAVDT_CCB *p_ccb);
extern tAVDT_CCB *avdt_ccb_by_idx(UINT8 idx);
extern void avdt_ccb_chan_open(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_chan_close(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_chk_close(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_hdl_discover_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_hdl_discover_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_hdl_getcap_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_hdl_getcap_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_hdl_start_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_hdl_start_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_hdl_suspend_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_hdl_suspend_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_snd_discover_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_snd_discover_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_snd_getcap_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_snd_getcap_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_snd_start_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_snd_start_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_snd_suspend_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_snd_suspend_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_clear_cmds(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_cmd_fail(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_free_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_cong_state(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_ret_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_snd_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_snd_msg(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_set_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_clr_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_chk_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_chk_timer(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_set_conn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_set_disconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_do_disconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_ll_closed(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_ccb_ll_opened(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
extern void avdt_scb_event(tAVDT_SCB *p_scb, UINT8 event, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_init(void);
extern tAVDT_SCB *avdt_scb_alloc(tAVDT_CS *p_cs);
extern void avdt_scb_dealloc(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern UINT8 avdt_scb_to_hdl(tAVDT_SCB *p_scb);
extern tAVDT_SCB *avdt_scb_by_hdl(UINT8 hdl);
extern UINT8 avdt_scb_verify(tAVDT_CCB *p_ccb, UINT8 state, UINT8 *p_seid, UINT16 num_seid, UINT8 *p_err_code);
extern void avdt_scb_peer_seid_list(tAVDT_MULTI *p_multi);
extern UINT32 avdt_scb_gen_ssrc(tAVDT_SCB *p_scb);
extern void avdt_scb_hdl_abort_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_abort_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_close_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_close_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_getconfig_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_getconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_open_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_open_rej(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_open_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_drop_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_reconfig_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_reconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_security_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_security_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_setconfig_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_setconfig_rej(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_setconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_start_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_start_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_suspend_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_suspend_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_delay_rpt_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_delay_rpt_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_delay_rpt_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_tc_close(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_tc_open(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_tc_close_sto(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_tc_open_sto(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_hdl_write_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_abort_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_abort_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_close_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_stream_close(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_close_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_getconfig_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_getconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_open_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_open_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_reconfig_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_reconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_security_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_security_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_setconfig_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_setconfig_rej(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_setconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_snd_tc_close(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_cb_err(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_cong_state(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_rej_state(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_rej_in_use(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_rej_not_in_use(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_set_remove(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_free_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_chk_snd_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_clr_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_tc_timer(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_clr_vars(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_queue_frags(tAVDT_SCB *p_scb, UINT8 **pp_data, UINT32 *p_data_len, fixed_queue_t *pq);
extern void avdt_scb_hdl_delay_rpt_tout(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_init_open_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_send_delay_report_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern BOOLEAN avdt_msg_send(tAVDT_CCB *p_ccb, BT_HDR *p_msg);
extern void avdt_msg_send_cmd(tAVDT_CCB *p_ccb, void *p_scb, UINT8 sig_id, tAVDT_MSG *p_params);
extern void avdt_msg_send_rsp(tAVDT_CCB *p_ccb, UINT8 sig_id, tAVDT_MSG *p_params);
extern void avdt_msg_send_rej(tAVDT_CCB *p_ccb, UINT8 sig_id, tAVDT_MSG *p_params);
extern void avdt_msg_send_grej(tAVDT_CCB *p_ccb, UINT8 sig_id, tAVDT_MSG *p_params);
extern void avdt_msg_ind(tAVDT_CCB *p_ccb, BT_HDR *p_buf);
extern void avdt_ad_init(void);
extern UINT8 avdt_ad_type_to_tcid(UINT8 type, tAVDT_SCB *p_scb);
extern tAVDT_TC_TBL *avdt_ad_tc_tbl_by_st(UINT8 type, tAVDT_CCB *p_ccb, UINT8 state);
extern tAVDT_TC_TBL *avdt_ad_tc_tbl_by_lcid(UINT16 lcid);
extern tAVDT_TC_TBL *avdt_ad_tc_tbl_alloc(tAVDT_CCB *p_ccb);
extern UINT8 avdt_ad_tc_tbl_to_idx(tAVDT_TC_TBL *p_tbl);
extern void avdt_ad_tc_close_ind(tAVDT_TC_TBL *p_tbl, UINT16 reason);
extern void avdt_ad_tc_open_ind(tAVDT_TC_TBL *p_tbl);
extern void avdt_ad_tc_cong_ind(tAVDT_TC_TBL *p_tbl, BOOLEAN is_congested);
extern void avdt_ad_tc_data_ind(tAVDT_TC_TBL *p_tbl, BT_HDR *p_buf);
extern tAVDT_TC_TBL *avdt_ad_tc_tbl_by_type(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb);
extern UINT8 avdt_ad_write_req(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb, BT_HDR *p_buf);
extern void avdt_ad_open_req(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb, UINT8 role);
extern void avdt_ad_close_req(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb);
extern void avdt_process_timeout(TIMER_LIST_ENT *p_tle);
/* ... */
/* ... */
#define AVDT_BLD_LAYERSPEC(ls, msg, label) \
ls = (((label) << 4) | (msg))...
#define AVDT_LAYERSPEC_LABEL(ls) ((UINT8)((ls) >> 4))
#define AVDT_LAYERSPEC_MSG(ls) ((UINT8)((ls) & 0x000F))
/* ... */
#ifdef __cplusplus
extern "C"
{
#endif
#if AVDT_DYNAMIC_MEMORY == FALSE
extern tAVDT_CB avdt_cb;
#else
extern tAVDT_CB *avdt_cb_ptr;
#define avdt_cb (*avdt_cb_ptr)
#endif
extern const tL2CAP_APPL_INFO avdt_l2c_appl;
extern const UINT8 avdt_msg_rej_2_evt[];
#ifdef __cplusplus
}
#endif
#endif
#endif