1
6
7
8
16
17
18
19
20
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
77
78
79
82
83
84
87
88
89
93
94
95
98
99
100
103
104
105
109
110
111
115
116
117
121
122
123
126
127
128
129
132
133
134
135
136
137
138
139
140
141
142
143
144
151
152
153
155
156
157
160
161
162
163
164
165
166
167
168
169
170
/* ... */
/* ... */
#ifndef __BTC_HF_CLIENT_H__
#define __BTC_HF_CLIENT_H__
#include "common/bt_target.h"
#include "esp_hf_client_api.h"
#include "btc/btc_task.h"
#include "btc/btc_common.h"
#include "bta/bta_hf_client_api.h"5 includes
#if (BTC_HF_CLIENT_INCLUDED == TRUE)
/* ... */
typedef enum {
BTC_HF_CLIENT_INIT_EVT,
BTC_HF_CLIENT_DEINIT_EVT,
BTC_HF_CLIENT_CONNECT_EVT,
BTC_HF_CLIENT_DISCONNECT_EVT,
BTC_HF_CLIENT_CONNECT_AUDIO_EVT,
BTC_HF_CLIENT_DISCONNECT_AUDIO_EVT,
BTC_HF_CLIENT_START_VOICE_RECOGNITION_EVT,
BTC_HF_CLIENT_STOP_VOICE_RECOGNITION_EVT,
BTC_HF_CLIENT_VOLUME_UPDATE_EVT,
BTC_HF_CLIENT_DIAL_EVT,
BTC_HF_CLIENT_DIAL_MEMORY_EVT,
BTC_HF_CLIENT_SEND_CHLD_CMD_EVT,
BTC_HF_CLIENT_SEND_BTRH_CMD_EVT,
BTC_HF_CLIENT_ANSWER_CALL_EVT,
BTC_HF_CLIENT_REJECT_CALL_EVT,
BTC_HF_CLIENT_QUERY_CURRENT_CALLS_EVT,
BTC_HF_CLIENT_QUERY_CURRENT_OPERATOR_NAME_EVT,
BTC_HF_CLIENT_RETRIEVE_SUBSCRIBER_INFO_EVT,
BTC_HF_CLIENT_SEND_DTMF_EVT,
BTC_HF_CLIENT_REQUEST_LAST_VOICE_TAG_NUMBER_EVT,
BTC_HF_CLIENT_REGISTER_DATA_CALLBACK_EVT,
BTC_HF_CLIENT_SEND_NREC_EVT,
BTC_HF_CLIENT_SEND_XAPL_EVT,
BTC_HF_CLIENT_SEND_IPHONEACCEV_EVT,
BTC_HF_CLIENT_REQUEST_PKT_STAT_EVT,
}{...} btc_hf_client_act_t;
typedef union {
bt_bdaddr_t connect;
bt_bdaddr_t disconnect;
bt_bdaddr_t connect_audio;
bt_bdaddr_t disconnect_audio;
struct volume_update_args {
esp_hf_volume_control_target_t type;
int volume;
}{...} volume_update;
struct dial_args {
char number[ESP_BT_HF_CLIENT_NUMBER_LEN + 1];
}{...} dial;
struct dial_memory_args {
int location;
}{...} dial_memory;
struct send_chld_cmd_args {
esp_hf_chld_type_t type;
int idx;
}{...} chld;
struct send_btrh_cmd_args {
esp_hf_btrh_cmd_t cmd;
}{...} btrh;
struct send_dtmf {
char code;
}{...} send_dtmf;
struct hf_client_reg_data_callback {
esp_hf_client_incoming_data_cb_t recv;
esp_hf_client_outgoing_data_cb_t send;
}{...} reg_data_cb;
struct send_xapl_args {
char information[ESP_BT_HF_AT_SEND_XAPL_LEN + 1];
uint32_t features;
}{...} send_xapl;
struct send_iphoneaccev_args {
uint32_t bat_level;
bool docked;
}{...} send_iphoneaccev;
struct hf_client_req_pkt_stat_sync_handle {
UINT16 sync_conn_handle;
}{...} pkt_sync_hd;
}{...} btc_hf_client_args_t;
/* ... */
typedef struct
{
bool initialized;
UINT16 handle;
bt_bdaddr_t connected_bda;
esp_hf_client_connection_state_t state;
esp_hf_vr_state_t vr_state;
tBTA_HF_CLIENT_PEER_FEAT peer_feat;
tBTA_HF_CLIENT_CHLD_FEAT chld_feat;
}{...} btc_hf_client_cb_t;
typedef struct
{
UINT32 btc_hf_client_features;
btc_hf_client_cb_t btc_hf_client_cb;
esp_hf_client_incoming_data_cb_t btc_hf_client_incoming_data_cb;
esp_hf_client_outgoing_data_cb_t btc_hf_client_outgoing_data_cb;
}{...}hf_client_local_param_t;
#if HFP_DYNAMIC_MEMORY == TRUE
extern hf_client_local_param_t *hf_client_local_param_ptr;
#define hf_client_local_param (*hf_client_local_param_ptr)/* ... */
#endif
/* ... */
void btc_hf_client_call_handler(btc_msg_t *msg);
void btc_hf_client_cb_handler(btc_msg_t *msg);
void btc_hf_client_incoming_data_cb_to_app(const uint8_t *data, uint32_t len);
uint32_t btc_hf_client_outgoing_data_cb_to_app(uint8_t *data, uint32_t len);/* ... */
#endif
/* ... */
#endif