Select one of the symbols to view example projects that use it.
 
Outline
#include "common/bt_target.h"
#include "common/bt_trace.h"
#include "bta/bta_api.h"
#include "bta/bta_av_api.h"
#include "btc_av.h"
#include "btc_av_co.h"
#include "btc_a2dp.h"
#include "btc_a2dp_control.h"
#include "btc_a2dp_sink.h"
#include "btc_a2dp_source.h"
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/bt/host/bluedroid/btc/profile/std/a2dp/btc_a2dp.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ /***************************************************************************** * * Filename: btc_a2dp.c * *****************************************************************************//* ... */ #include "common/bt_target.h" #include "common/bt_trace.h" #include "bta/bta_api.h" #include "bta/bta_av_api.h" #include "btc_av.h" #include "btc_av_co.h" #include "btc_a2dp.h" #include "btc_a2dp_control.h" #include "btc_a2dp_sink.h" #include "btc_a2dp_source.h"10 includes #if BTC_AV_INCLUDED /***************************************************************************** ** ** Function btc_a2dp_on_init ** *******************************************************************************//* ... */ void btc_a2dp_on_init(void) { BTC_TRACE_EVENT("A2DP Initialized."); }{...} /***************************************************************************** ** ** Function btc_a2dp_on_idle ** *******************************************************************************//* ... */ void btc_a2dp_on_idle(void) { APPL_TRACE_EVENT("## ON A2DP IDLE ## peer_sep = %d, service id = %d", btc_av_get_peer_sep(), btc_av_get_service_id()); #if BTC_AV_SRC_INCLUDED if (btc_av_get_peer_sep() == AVDT_TSEP_SNK && btc_av_get_service_id() == BTA_A2DP_SOURCE_SERVICE_ID) { btc_a2dp_source_on_idle(); }{...} /* ... */#endif // BTC_AV_SRC_INCLUDED bta_av_co_init(); #if BTC_AV_SINK_INCLUDED if (btc_av_get_peer_sep() == AVDT_TSEP_SRC && btc_av_get_service_id() == BTA_A2DP_SINK_SERVICE_ID) { btc_a2dp_sink_on_idle(); }{...} /* ... */#endif // BTC_AV_SINK_INCLUDED }{...} /***************************************************************************** ** ** Function btc_a2dp_on_started ** ** Description ** ** Returns ** *******************************************************************************//* ... */ BOOLEAN btc_a2dp_on_started(tBTA_AV_START *p_av, BOOLEAN pending_start) { BOOLEAN ack = FALSE; APPL_TRACE_EVENT("## ON A2DP STARTED ##"); #if BTC_AV_SRC_INCLUDED if (p_av == NULL) { /* ack back a local start request */ btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_SUCCESS); return TRUE; }{...} if (p_av->status == BTA_AV_SUCCESS) { if (p_av->suspending == FALSE) { if (p_av->initiator) { if (pending_start) { btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_SUCCESS); ack = TRUE; }{...} }{...} else { /* we were remotely started, make sure codec is setup before datapath is started *//* ... */ btc_a2dp_source_setup_codec(); }{...} /* media task is autostarted upon a2dp audiopath connection */ }{...} }{...} else if (pending_start) { btc_a2dp_control_command_ack(ESP_A2D_MEDIA_CTRL_ACK_FAILURE); ack = TRUE; }{...} /* ... */#endif /* BTC_AV_SRC_INCLUDED */ return ack; }{...} /***************************************************************************** ** ** Function btc_a2dp_on_stopped ** *******************************************************************************//* ... */ void btc_a2dp_on_stopped(tBTA_AV_SUSPEND *p_av) { APPL_TRACE_EVENT("## ON A2DP STOPPED ##"); #if BTC_AV_SINK_INCLUDED if (btc_av_get_peer_sep() == AVDT_TSEP_SRC && btc_av_get_service_id() == BTA_A2DP_SINK_SERVICE_ID) { btc_a2dp_sink_on_stopped(p_av); return; }{...} /* ... */#endif // BTC_AV_SINK_INCLUDED #if BTC_AV_SRC_INCLUDED btc_a2dp_source_on_stopped(p_av); #endif // BTC_AV_SRC_INCLUDED }{...} /***************************************************************************** ** ** Function btc_a2dp_on_suspended ** *******************************************************************************//* ... */ void btc_a2dp_on_suspended(tBTA_AV_SUSPEND *p_av) { APPL_TRACE_EVENT("## ON A2DP SUSPENDED ##"); #if BTC_AV_SINK_INCLUDED if (btc_av_get_peer_sep() == AVDT_TSEP_SRC && btc_av_get_service_id() == BTA_A2DP_SINK_SERVICE_ID) { btc_a2dp_sink_on_suspended(p_av); return; }{...} /* ... */#endif // BTC_AV_SINK_INCLUDED #if BTC_AV_SRC_INCLUDED btc_a2dp_source_on_suspended(p_av); #endif // BTC_AV_SRC_INCLUDED }{...} /* ... */ #endif /* #if BTC_AV_INCLUDED */
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.