1
6
7
8
9
10
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
79
80
81
86
87
88
89
90
91
95
96
97
101
102
103
106
107
108
111
112
113
118
119
120
126
127
128
133
134
135
140
141
142
146
147
148
151
152
153
156
157
158
159
160
161
165
166
167
170
171
172
176
177
178
182
183
184
185
188
189
190
191
192
193
194
195
196
197
198
199
/* ... */
#ifndef __BTC_GAP_BT_H__
#define __BTC_GAP_BT_H__
#include "common/bt_target.h"
#include "common/bt_defs.h"
#include "esp_bt_defs.h"
#include "esp_gap_bt_api.h"
#include "btc/btc_task.h"
#include "bta/utl.h"6 includes
#if (BTC_GAP_BT_INCLUDED == TRUE)
typedef enum {
BTC_GAP_BT_SEARCH_DEVICES_EVT = 0,
BTC_GAP_BT_SEARCH_SERVICES_EVT,
BTC_GAP_BT_SEARCH_SERVICE_RECORD_EVT,
BTC_GAP_BT_AUTH_CMPL_EVT,
BTC_GAP_BT_ENC_CHG_EVT,
BTC_GAP_BT_PIN_REQ_EVT,
BTC_GAP_BT_CFM_REQ_EVT,
BTC_GAP_BT_KEY_NOTIF_EVT,
BTC_GAP_BT_KEY_REQ_EVT,
BTC_GAP_BT_READ_RSSI_DELTA_EVT,
BTC_GAP_BT_CONFIG_EIR_DATA_EVT,
BTC_GAP_BT_SET_AFH_CHANNELS_EVT,
BTC_GAP_BT_READ_REMOTE_NAME_EVT,
BTC_GAP_BT_MODE_CHG_EVT,
BTC_GAP_BT_REMOVE_BOND_DEV_COMPLETE_EVT,
BTC_GAP_BT_QOS_EVT,
BTC_GAP_BT_SET_PAGE_TO_EVT,
BTC_GAP_BT_GET_PAGE_TO_EVT,
BTC_GAP_BT_SET_ACL_PKT_TYPES_EVT,
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
BTC_GAP_BT_SET_MIN_ENC_KEY_SIZE_EVT,
#endif
BTC_GAP_BT_GET_DEV_NAME_CMPL_EVT,
}{...}btc_gap_bt_evt_t;
typedef enum {
BTC_GAP_BT_ACT_SET_SCAN_MODE = 0,
BTC_GAP_BT_ACT_START_DISCOVERY,
BTC_GAP_BT_ACT_CANCEL_DISCOVERY,
BTC_GAP_BT_ACT_GET_REMOTE_SERVICES,
BTC_GAP_BT_ACT_GET_REMOTE_SERVICE_RECORD,
BTC_GAP_BT_ACT_SET_COD,
BTC_GAP_BT_ACT_READ_RSSI_DELTA,
BTC_GAP_BT_ACT_REMOVE_BOND_DEVICE,
BTC_GAP_BT_ACT_SET_PIN_TYPE,
BTC_GAP_BT_ACT_PIN_REPLY,
BTC_GAP_BT_ACT_SET_SECURITY_PARAM,
BTC_GAP_BT_ACT_PASSKEY_REPLY,
BTC_GAP_BT_ACT_CONFIRM_REPLY,
BTC_GAP_BT_ACT_CONFIG_EIR,
BTC_GAP_BT_ACT_SET_AFH_CHANNELS,
BTC_GAP_BT_ACT_READ_REMOTE_NAME,
BTC_GAP_BT_ACT_SET_QOS,
BTC_GAP_BT_ACT_SET_PAGE_TIMEOUT,
BTC_GAP_BT_ACT_GET_PAGE_TIMEOUT,
BTC_GAP_BT_ACT_SET_ACL_PKT_TYPES,
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
BTC_GAP_BT_ACT_SET_MIN_ENC_KEY_SIZE,
#endif
BTC_GAP_BT_ACT_SET_DEV_NAME,
BTC_GAP_BT_ACT_GET_DEV_NAME,
}{...} btc_gap_bt_act_t;
typedef union {
struct set_bt_scan_mode_args {
esp_bt_connection_mode_t c_mode;
esp_bt_discovery_mode_t d_mode;
}{...} set_scan_mode;
struct start_disc_args {
esp_bt_inq_mode_t mode;
uint8_t inq_len;
uint8_t num_rsps;
}{...} start_disc;
bt_bdaddr_t bda;
struct get_rmt_srv_rcd_args {
bt_bdaddr_t bda;
esp_bt_uuid_t uuid;
}{...} get_rmt_srv_rcd;
struct set_cod_args {
esp_bt_cod_t cod;
esp_bt_cod_mode_t mode;
}{...} set_cod;
struct bt_read_rssi_delta_args {
bt_bdaddr_t bda;
}{...} read_rssi_delta;
struct rm_bond_device_args {
bt_bdaddr_t bda;
}{...} rm_bond_device;
struct set_pin_type_args {
esp_bt_pin_type_t pin_type;
uint8_t pin_code_len;
esp_bt_pin_code_t pin_code;
}{...} set_pin_type;
struct pin_reply_args {
bt_bdaddr_t bda;
bool accept;
uint8_t pin_code_len;
esp_bt_pin_code_t pin_code;
}{...} pin_reply;
struct set_sec_param_args {
esp_bt_sp_param_t param_type;
uint8_t len;
uint8_t *value;
}{...} set_security_param;
struct passkey_reply_args {
bt_bdaddr_t bda;
bool accept;
uint32_t passkey;
}{...} passkey_reply;
struct confirm_reply_args {
bt_bdaddr_t bda;
bool accept;
}{...} confirm_reply;
struct config_eir_args {
esp_bt_eir_data_t eir_data;
}{...} config_eir;
struct set_afh_channels_args {
esp_bt_gap_afh_channels channels;
}{...} set_afh_channels;
bt_bdaddr_t rmt_name_bda;
struct set_qos_args {
bt_bdaddr_t bda;
uint32_t t_poll;
}{...} set_qos;
struct set_page_to_args {
uint16_t page_to;
}{...} set_page_to;
struct set_acl_pkt_types_args {
bt_bdaddr_t bda;
uint16_t pkt_types;
}{...} set_acl_pkt_types;
#if (ENC_KEY_SIZE_CTRL_MODE != ENC_KEY_SIZE_CTRL_MODE_NONE)
struct set_min_enc_key_size_args {
uint8_t key_size;
}{...} set_min_enc_key_size;/* ... */
#endif
struct bt_set_dev_name_args {
char *device_name;
}{...} bt_set_dev_name;
}{...} btc_gap_bt_args_t;
void btc_gap_bt_call_handler(btc_msg_t *msg);
void btc_gap_bt_cb_handler(btc_msg_t *msg);
void btc_gap_bt_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
void btc_gap_bt_arg_deep_free(btc_msg_t *msg);
void btc_gap_bt_busy_level_updated(uint8_t bl_flags);
esp_err_t btc_gap_bt_get_cod(esp_bt_cod_t *cod);/* ... */
#endif
/* ... */
#endif