Select one of the symbols to view example projects that use it.
 
Outline
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "bt_common.h"
#include "btc/btc_common.h"
#include "btc/btc_dm.h"
#include "btc_hf_ag.h"
#include "btc/btc_profile_queue.h"
#include "btc/btc_manage.h"
#include "btc/btc_util.h"
#include "bta/bta_ag_api.h"
#include "bta/bta_api.h"
#include "common/bt_target.h"
#include "common/bt_defs.h"
#include "device/bdaddr.h"
#include "esp_bt.h"
#include "esp_hf_ag_api.h"
#include "esp_err.h"
#include "esp_bt_main.h"
#include "osi/allocator.h"
Files
ESP-IDF
components
app_trace
app_update
bootloader_support
bt
common
controller
esp_ble_mesh
host
bluedroid
api
include
bta
btc
common
config
device
external
hci
main
stack
nimble
include
porting
cmock
console
cxx
driver
efuse
esp_adc
esp_app_format
esp_bootloader_format
esp_coex
esp_common
esp_driver_ana_cmpr
esp_driver_cam
esp_driver_dac
esp_driver_gpio
esp_driver_gptimer
esp_driver_i2c
esp_driver_i2s
esp_driver_jpeg
esp_driver_ledc
esp_driver_mcpwm
esp_driver_parlio
esp_driver_pcnt
esp_driver_rmt
esp_driver_sdio
esp_driver_sdm
esp_driver_sdmmc
esp_driver_sdspi
esp_driver_spi
esp_driver_tsens
esp_driver_uart
esp_driver_usb_serial_jtag
esp_eth
esp_event
esp_gdbstub
esp_hid
esp_http_client
esp_http_server
esp_https_ota
esp_https_server
esp_hw_support
esp_lcd
esp_local_ctrl
esp_mm
esp_netif
esp_partition
esp_phy
esp_pm
esp_psram
esp_ringbuf
esp_rom
esp_security
esp_system
esp_timer
esp_vfs_console
esp_wifi
esp-tls
espcoredump
hal
heap
http_parser
ieee802154
log
mqtt
newlib
nvs_flash
nvs_sec_provider
openthread
perfmon
protobuf-c
protocomm
pthread
rt
sdmmc
soc
spi_flash
spiffs
tcp_transport
ulp
unity
vfs
wear_levelling
wifi_provisioning
wpa_supplicant
xtensa
examples
lwIP
FreeRTOS
cJSON
mbedTLS
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/bt/host/bluedroid/api/esp_hf_ag_api.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
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
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
348
349
350
351
352
353
354
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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
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
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include "bt_common.h" #include "btc/btc_common.h" #include "btc/btc_dm.h" #include "btc_hf_ag.h" #include "btc/btc_profile_queue.h" #include "btc/btc_manage.h" #include "btc/btc_util.h" #include "bta/bta_ag_api.h" #include "bta/bta_api.h" #include "common/bt_target.h" #include "common/bt_defs.h" #include "device/bdaddr.h"17 includes #if (BT_CONTROLLER_INCLUDED == TRUE) #include "esp_bt.h" #endif #include "esp_hf_ag_api.h" #include "esp_err.h" #include "esp_bt_main.h" #include "osi/allocator.h" #if (BTC_HF_INCLUDED == TRUE) esp_err_t esp_hf_ag_register_callback(esp_hf_cb_t callback) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} if (callback == NULL) { return ESP_FAIL; }{...} btc_profile_cb_set(BTC_PID_HF, callback); return ESP_OK; }{...} esp_err_t esp_hf_ag_init(void) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_INIT_EVT; /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, NULL, 0, NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_deinit(void) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_DEINIT_EVT; /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, NULL, 0, NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_slc_connect(esp_bd_addr_t remote_addr) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_CONNECT_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.connect), remote_addr, sizeof(esp_bd_addr_t)); /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_slc_disconnect(esp_bd_addr_t remote_addr) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_DISCONNECT_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.disconnect), remote_addr, sizeof(esp_bd_addr_t)); /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_audio_connect(esp_bd_addr_t remote_addr) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_CONNECT_AUDIO_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.connect_audio), remote_addr, sizeof(esp_bd_addr_t)); /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_audio_disconnect(esp_bd_addr_t remote_addr) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_DISCONNECT_AUDIO_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.disconnect_audio), remote_addr, sizeof(esp_bd_addr_t)); /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_vra_control(esp_bd_addr_t remote_addr, esp_hf_vr_state_t value) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_VRA_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); arg.vra_rep.value = value; memcpy(&(arg.volcon.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_volume_control(esp_bd_addr_t remote_addr, esp_hf_volume_control_target_t type, int volume) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} if (volume < 0 || volume > 15) { return ESP_ERR_INVALID_ARG; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_VOLUME_CONTROL_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); arg.volcon.target_type = type; arg.volcon.volume = volume; memcpy(&(arg.volcon.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_unknown_at_send(esp_bd_addr_t remote_addr, char *unat) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_UNAT_RESPONSE_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); arg.unat_rep.unat = unat; memcpy(&(arg.unat_rep.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), btc_hf_arg_deep_copy, btc_hf_arg_deep_free); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_cmee_send(esp_bd_addr_t remote_addr, esp_hf_at_response_code_t response_code, esp_hf_cme_err_t error_code) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_CME_ERR_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); arg.ext_at.response_code = response_code; arg.ext_at.error_code = error_code; memcpy(&(arg.ext_at.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_devices_status_indchange(esp_bd_addr_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) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} if (signal < 0 || signal > 5) { return ESP_ERR_INVALID_ARG; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_IND_NOTIFICATION_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.ind_change.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); arg.ind_change.call_state = call_state; arg.ind_change.call_setup_state = call_setup_state; arg.ind_change.ntk_state = ntk_state; arg.ind_change.signal = signal; /* Switch to BTC context */ bt_status_t state = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (state == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_ciev_report(esp_bd_addr_t remote_addr, esp_hf_ciev_report_type_t ind_type, int value) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_CIEV_REPORT_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.ciev_rep.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); arg.ciev_rep.ind.type = ind_type; arg.ciev_rep.ind.value = value; /* Switch to BTC context */ bt_status_t state = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (state == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_cind_response(esp_bd_addr_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_status) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} if (signal < 0 || signal > 5 || batt_lev < 0 || batt_lev > 5) { return ESP_ERR_INVALID_ARG; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_CIND_RESPONSE_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.cind_rep.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); arg.cind_rep.call_state = call_state; arg.cind_rep.call_setup_state = call_setup_state; arg.cind_rep.ntk_state = ntk_state; arg.cind_rep.signal = signal; arg.cind_rep.roam = roam; arg.cind_rep.batt_lev = batt_lev; arg.cind_rep.call_held_state = call_held_status; /* Switch to BTC context */ bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_cops_response(esp_bd_addr_t remote_addr, char *name) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_COPS_RESPONSE_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.cops_rep.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); arg.cops_rep.name = name; //deep_copy /* Switch to BTC context */ bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), btc_hf_arg_deep_copy, btc_hf_arg_deep_free); return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_clcc_response(esp_bd_addr_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) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_CLCC_RESPONSE_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.clcc_rep.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); //mandatory args arg.clcc_rep.index = index; arg.clcc_rep.dir = dir; arg.clcc_rep.current_call_state = current_call_state; arg.clcc_rep.mode = mode; arg.clcc_rep.mpty = mpty; // option args arg.clcc_rep.number = number; //deep_copy arg.clcc_rep.type = type; /* Switch to BTC context */ bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), btc_hf_arg_deep_copy, btc_hf_arg_deep_free); return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, int number_type, esp_hf_subscriber_service_type_t service_type) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} if (number == NULL || number_type < 128 || number_type > 175) { return ESP_ERR_INVALID_ARG; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_CNUM_RESPONSE_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.cnum_rep), remote_addr, sizeof(esp_bd_addr_t)); arg.cnum_rep.number = number; //deep_copy arg.cnum_rep.number_type = number_type; arg.cnum_rep.service_type = service_type; /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), btc_hf_arg_deep_copy, btc_hf_arg_deep_free); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_bsir(esp_bd_addr_t remote_addr, esp_hf_in_band_ring_state_t state) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_INBAND_RING_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.bsir.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); arg.bsir.state = state; /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_answer_call(esp_bd_addr_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) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_AC_INCALL_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.phone.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); arg.phone.num_active = num_active; arg.phone.num_held = num_held; arg.phone.call_state = call_state; arg.phone.call_setup_state = call_setup_state; arg.phone.number = number; //deep_copy arg.phone.call_addr_type = call_addr_type; /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), btc_hf_arg_deep_copy, btc_hf_arg_deep_free); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_reject_call(esp_bd_addr_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) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_RJ_INCALL_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.phone.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); arg.phone.num_active = num_active; arg.phone.num_held = num_held; arg.phone.call_state = call_state; arg.phone.call_setup_state = call_setup_state; arg.phone.number = number; //deep_copy arg.phone.call_addr_type = call_addr_type; /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), btc_hf_arg_deep_copy, btc_hf_arg_deep_free); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_end_call(esp_bd_addr_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) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_END_CALL_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.phone.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); arg.phone.num_active = num_active; arg.phone.num_held = num_held; arg.phone.call_state = call_state; arg.phone.call_setup_state = call_setup_state; arg.phone.number = number; //deep_copy arg.phone.call_addr_type = call_addr_type; /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), btc_hf_arg_deep_copy, btc_hf_arg_deep_free); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_out_call(esp_bd_addr_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) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_OUT_CALL_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); memcpy(&(arg.phone.remote_addr), remote_addr, sizeof(esp_bd_addr_t)); arg.phone.num_active = num_active; arg.phone.num_held = num_held; arg.phone.call_state = call_state; arg.phone.call_setup_state = call_setup_state; arg.phone.number = number; //deep_copy arg.phone.call_addr_type = call_addr_type; /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), btc_hf_arg_deep_copy, btc_hf_arg_deep_free); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} esp_err_t esp_hf_ag_register_data_callback(esp_hf_incoming_data_cb_t recv, esp_hf_outgoing_data_cb_t send) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_REGISTER_DATA_CALLBACK_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); arg.reg_data_cb.recv = recv; arg.reg_data_cb.send = send; /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} #if (BTM_SCO_HCI_INCLUDED == TRUE) esp_err_t esp_hf_ag_pkt_stat_nums_get(uint16_t sync_conn_handle) { if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) { return ESP_ERR_INVALID_STATE; }{...} btc_msg_t msg; msg.sig = BTC_SIG_API_CALL; msg.pid = BTC_PID_HF; msg.act = BTC_HF_REQUEST_PKT_STAT_EVT; btc_hf_args_t arg; memset(&arg, 0, sizeof(btc_hf_args_t)); arg.pkt_sync_hd.sync_conn_handle = sync_conn_handle; /* Switch to BTC context */ bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL); return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL; }{...} void esp_hf_ag_outgoing_data_ready(void) { btc_hf_ci_sco_data(); }{...} /* ... */#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE) */ /* ... */ #endif // BTC_HF_INCLUDED
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.