Select one of the symbols to view example projects that use it.
 
Outline
#define __BTC_HF_AG_H__
#include "common/bt_target.h"
#include "btc/btc_task.h"
#include "btc/btc_common.h"
#include "bta/bta_ag_api.h"
#include "esp_hf_ag_api.h"
#define BTC_HF_NUM_CB
#define BTC_HF_ID_1
#define hf_local_param
Files
loading (2/5)...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/bt/host/bluedroid/btc/profile/std/include/btc_hf_ag.h
 
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
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
208
209
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ /******************************************************************************* * * Filename: btc_hf_ag.h * * Description: Main API header file for all BTC HF AG functions accessed * from internal stack. * *******************************************************************************//* ... */ #ifndef __BTC_HF_AG_H__ #define __BTC_HF_AG_H__ #include "common/bt_target.h" #include "btc/btc_task.h" #include "btc/btc_common.h" #include "bta/bta_ag_api.h" #include "esp_hf_ag_api.h"5 includes #if (BTC_HF_INCLUDED == TRUE) /******************************************************************************* ** Type Defs ********************************************************************************//* ... */ /* btc_hf_act_t */ typedef enum { //INIT BTC_HF_INIT_EVT, BTC_HF_DEINIT_EVT, BTC_HF_CONNECT_EVT, BTC_HF_DISCONNECT_EVT, BTC_HF_CONNECT_AUDIO_EVT, BTC_HF_DISCONNECT_AUDIO_EVT, BTC_HF_VRA_EVT, BTC_HF_VOLUME_CONTROL_EVT, //AT_RESPONSE BTC_HF_UNAT_RESPONSE_EVT, BTC_HF_CME_ERR_EVT, BTC_HF_IND_NOTIFICATION_EVT, BTC_HF_CIEV_REPORT_EVT, BTC_HF_CIND_RESPONSE_EVT, BTC_HF_COPS_RESPONSE_EVT, BTC_HF_CLCC_RESPONSE_EVT, BTC_HF_CNUM_RESPONSE_EVT, BTC_HF_INBAND_RING_EVT, //CALL_HANDLE BTC_HF_AC_INCALL_EVT, BTC_HF_RJ_INCALL_EVT, BTC_HF_OUT_CALL_EVT, BTC_HF_END_CALL_EVT, //REG BTC_HF_REGISTER_DATA_CALLBACK_EVT, BTC_HF_REQUEST_PKT_STAT_EVT }{...} btc_hf_act_t; /* btc_hf_args_t */ typedef union { // BTC_HF_CONNECT_EVT bt_bdaddr_t connect; // BTC_HF_DISCONNECT_EVT bt_bdaddr_t disconnect; // BTC_HF_CONNECT_AUDIO_EVT bt_bdaddr_t connect_audio; // BTC_HF_DISCONNECT_AUDIO_EVT bt_bdaddr_t disconnect_audio; //BTC_HF_VRA_EVT struct vra_param { bt_bdaddr_t remote_addr; esp_hf_vr_state_t value; }{...} vra_rep; // BTC_HF_VOLUME_CONTROL_EVT struct volcon_args { bt_bdaddr_t remote_addr; esp_hf_volume_control_target_t target_type; int volume; }{...} volcon; //BTC_HF_UNAT_RESPONSE_EVT struct unat_param { bt_bdaddr_t remote_addr; char *unat; }{...} unat_rep; //BTC_HF_CME_ERR_EVT struct at_ok_err_args { bt_bdaddr_t remote_addr; esp_hf_at_response_code_t response_code; esp_hf_cme_err_t error_code; }{...} ext_at; // BTC_HF_IND_NOTIFICATION_EVT struct indchange_status { bt_bdaddr_t remote_addr; esp_hf_call_status_t call_state; esp_hf_call_setup_status_t call_setup_state; esp_hf_network_state_t ntk_state; int signal; }{...} ind_change; //BTC_HF_CIEV_REPORT_EVT struct ciev_args { bt_bdaddr_t remote_addr; tBTA_AG_IND ind; }{...} ciev_rep; //BTC_HF_CIND_RESPONSE_EVT struct cind_args { bt_bdaddr_t remote_addr; esp_hf_call_status_t call_state; esp_hf_call_setup_status_t call_setup_state; esp_hf_network_state_t ntk_state; int signal; esp_hf_roaming_status_t roam; int batt_lev; esp_hf_call_held_status_t call_held_state; }{...} cind_rep; //BTC_HF_COPS_RESPONSE_EVT struct cops_args { bt_bdaddr_t remote_addr; char *name; }{...} cops_rep; // BTC_HF_CLCC_RESPONSE_EVT struct clcc_args { bt_bdaddr_t remote_addr; int index; esp_hf_current_call_direction_t dir; esp_hf_current_call_status_t current_call_state; esp_hf_current_call_mode_t mode; esp_hf_current_call_mpty_type_t mpty; char *number; esp_hf_call_addr_type_t type; }{...} clcc_rep; // BTC_HF_CNUM_RESPONSE_EVT struct cnum_args { bt_bdaddr_t remote_addr; char *number; int number_type; esp_hf_subscriber_service_type_t service_type; }{...} cnum_rep; //BTC_HF_NREC_RESPONSE_EVT bt_bdaddr_t nrec_rep; //BTC_HF_VTC_RESPONSE_EVT struct bts_args { bt_bdaddr_t remote_addr; char *code; }{...} vts_rep; //BTC_HF_INBAND_RING_EVT struct bsir_args { bt_bdaddr_t remote_addr; esp_hf_in_band_ring_state_t state; }{...} bsir; // BTC_HF_AC_INCALL_EVT // BTC_HF_RJ_INCALL_EVT // BTC_HF_OUT_CALL_EVT // BTC_HF_END_CALL_EVT struct phone_args { bt_bdaddr_t remote_addr; int num_active; int num_held; esp_hf_call_status_t call_state; esp_hf_call_setup_status_t call_setup_state; char *number; esp_hf_call_addr_type_t call_addr_type; }{...} phone; // BTC_HF_REGISTER_DATA_CALLBACK_EVT struct ag_reg_data_callback { esp_hf_incoming_data_cb_t recv; esp_hf_outgoing_data_cb_t send; }{...} reg_data_cb; // BTC_HF_REQUEST_PKT_STAT_EVT struct ag_req_pkt_stat_sync_handle { UINT16 sync_conn_handle; }{...} pkt_sync_hd; }{...} btc_hf_args_t; /************************************************************************************ ** Local definitions ************************************************************************************//* ... */ /* Number of BTC-HF-AG control blocks */ #define BTC_HF_NUM_CB 1 /* Handsfree AG app ids for service registration */ /* APP ID definition*/ #define BTC_HF_ID_1 0 /* BTC-AG control block to map bdaddr to BTA handle */ typedef struct { bool initialized; UINT16 handle; bt_bdaddr_t connected_bda; tBTA_AG_PEER_FEAT peer_feat; tBTA_AG_CHLD_FEAT chld_feat; struct timespec call_end_timestamp; struct timespec connected_timestamp; esp_hf_connection_state_t connection_state; esp_hf_vr_state_t vr_state; int num_active; int num_held; esp_hf_call_status_t call_state; esp_hf_call_setup_status_t call_setup_state; }{...} btc_hf_cb_t; typedef struct { int hf_idx; UINT32 btc_hf_features; btc_hf_cb_t btc_hf_cb; esp_hf_incoming_data_cb_t btc_hf_incoming_data_cb; esp_hf_outgoing_data_cb_t btc_hf_outgoing_data_cb; }{...} hf_local_param_t; #if HFP_DYNAMIC_MEMORY == TRUE extern hf_local_param_t *hf_local_param_ptr; #define hf_local_param (hf_local_param_ptr)/* ... */ #endif /******************************************************************************* ** BTC HF AG Handle Hub ********************************************************************************//* ... */ void btc_hf_call_handler(btc_msg_t *msg); // act the cmd from esp-application void btc_hf_cb_handler(btc_msg_t *msg); //handle the event from bta void btc_hf_incoming_data_cb_to_app(const uint8_t *data, uint32_t len); uint32_t btc_hf_outgoing_data_cb_to_app(uint8_t *data, uint32_t len); void btc_hf_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src); void btc_hf_arg_deep_free(btc_msg_t *msg); bt_status_t btc_hf_ci_sco_data(void); /* ... */ #endif // BTC_HF_INCLUDED == TRUE /* ... */ #endif /* __BTC_HF_AG_H__ */
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.