BLE5.2 1.0
开发文档说明
xc_gap_api.c
浏览该文件的文档.
1
9#include "rwip_config.h"
10#if BLE_APP_PRESENT
11#include "xc_gap_api.h"
12
14{
15 // Reset the stack
16 struct gapm_reset_cmd *p_cmd =
17 KE_MSG_ALLOC(GAPM_RESET_CMD, TASK_GAPM, TASK_APP, gapm_reset_cmd);
18
19 p_cmd->operation = GAPM_RESET;
20
21 ke_msg_send(p_cmd);
22}
23
24void xc_ble_set_dev_config(struct gapm_set_dev_config_cmd *cfg_param)
25{
26 struct gapm_set_dev_config_cmd *p_cmd = KE_MSG_ALLOC(
27 GAPM_SET_DEV_CONFIG_CMD, TASK_GAPM, TASK_APP, gapm_set_dev_config_cmd);
28
29 memcpy(p_cmd, cfg_param, sizeof(struct gapm_set_dev_config_cmd));
30 p_cmd->operation = GAPM_SET_DEV_CONFIG;
31
32 ke_msg_send(p_cmd);
33}
34
35void xc_ble_get_dev_info(struct gapm_get_dev_info_cmd *cmd)
36{
37 struct gapm_get_dev_info_cmd *p_cmd = KE_MSG_ALLOC(
38 GAPM_GET_DEV_INFO_CMD, TASK_GAPM, TASK_APP, gapm_get_dev_info_cmd);
39
40 p_cmd->operation = cmd->operation;
41
42 ke_msg_send(p_cmd);
43}
44
45void xc_ble_resolve_addr(uint8_t nb_key, gap_addr_t *addr, uint8_t *irk)
46{
47 struct gapm_resolv_addr_cmd *p_cmd = KE_MSG_ALLOC_DYN(
48 GAPM_RESOLV_ADDR_CMD, TASK_GAPM, TASK_APP, gapm_resolv_addr_cmd,
49 (nb_key * sizeof(struct gap_sec_key)));
50
51 memcpy(&p_cmd->addr.addr[0], &addr->addr[0], GAP_BD_ADDR_LEN);
52 memcpy(&p_cmd->irk[0].key[0], &irk[0], GAP_KEY_LEN * nb_key);
53 p_cmd->nb_key = nb_key;
54
55 p_cmd->operation = GAPM_RESOLV_ADDR;
56
57 ke_msg_send(p_cmd);
58}
59
60void xc_ble_gen_random_addr(struct gapm_gen_rand_addr_cmd *p_param)
61{
62 struct gapm_gen_rand_addr_cmd *p_cmd = KE_MSG_ALLOC(
63 GAPM_GEN_RAND_ADDR_CMD, TASK_GAPM, TASK_APP, gapm_gen_rand_addr_cmd);
64
65 memcpy(p_cmd, p_param, sizeof(struct gapm_gen_rand_addr_cmd));
66 p_cmd->operation = GAPM_GEN_RAND_ADDR;
67
68 ke_msg_send(p_cmd);
69}
70
72{
73 struct gapm_get_pub_key_cmd *p_cmd = KE_MSG_ALLOC(
74 GAPM_GET_PUB_KEY_CMD, TASK_GAPM, TASK_APP, gapm_get_pub_key_cmd);
75
76 p_cmd->operation = GAPM_GET_PUB_KEY;
77
78 ke_msg_send(p_cmd);
79}
80
82{
83 struct gapm_gen_rand_nb_cmd *p_cmd = KE_MSG_ALLOC(
84 GAPM_GEN_RAND_NB_CMD, TASK_GAPM, TASK_APP, gapm_gen_rand_nb_cmd);
85
86 p_cmd->operation = GAPM_GEN_RAND_NB;
87
88 ke_msg_send(p_cmd);
89}
90
91void xc_ble_set_irk(gap_sec_key_t *irk)
92{
93 struct gapm_set_irk_cmd *p_cmd =
94 KE_MSG_ALLOC(GAPM_SET_IRK_CMD, TASK_GAPM, TASK_APP, gapm_set_irk_cmd);
95
96 p_cmd->operation = GAPM_SET_IRK;
97 memcpy(p_cmd->irk.key, irk->key, GAP_KEY_LEN);
98
99 ke_msg_send(p_cmd);
100}
101
102void xc_ble_get_ral_addr(struct gapm_get_ral_addr_cmd *p_param)
103{
104 struct gapm_get_ral_addr_cmd *p_cmd = KE_MSG_ALLOC(
105 GAPM_GET_RAL_ADDR_CMD, TASK_GAPM, TASK_APP, gapm_get_ral_addr_cmd);
106
107 memcpy(p_cmd, p_param, sizeof(struct gapm_get_ral_addr_cmd));
108 p_cmd->operation = p_param->operation;
109
110 ke_msg_send(p_cmd);
111}
112
113void xc_ble_set_ral_list(uint8_t size, struct gap_ral_dev_info *ral_info)
114{
115 struct gapm_list_set_ral_cmd *p_cmd = KE_MSG_ALLOC_DYN(
116 GAPM_LIST_SET_CMD, TASK_GAPM, TASK_APP, gapm_list_set_ral_cmd,
117 (size * sizeof(struct gap_ral_dev_info)));
118
119 p_cmd->size = size;
120 memcpy(&p_cmd->ral_info, ral_info, sizeof(struct gap_ral_dev_info) * size);
121 p_cmd->operation = GAPM_SET_RAL;
122
123 ke_msg_send(p_cmd);
124}
125
126void xc_ble_set_white_list(uint8_t size, gap_bdaddr_t *wl_info)
127{
128 struct gapm_list_set_wl_cmd *p_cmd = KE_MSG_ALLOC_DYN(
129 GAPM_LIST_SET_CMD, TASK_GAPM, TASK_APP, gapm_list_set_wl_cmd,
130 (size * sizeof(struct gap_bdaddr)));
131
132 p_cmd->size = size;
133 memcpy(&p_cmd->wl_info, wl_info, sizeof(struct gap_bdaddr) * size);
134 p_cmd->operation = GAPM_SET_WL;
135
136 ke_msg_send(p_cmd);
137}
138
140 struct gapm_activity_create_adv_cmd *adv_creat_param)
141{
142 struct gapm_activity_create_adv_cmd *p_cmd =
143 KE_MSG_ALLOC(GAPM_ACTIVITY_CREATE_CMD, TASK_GAPM, TASK_APP,
144 gapm_activity_create_adv_cmd);
145
146 memcpy(p_cmd, adv_creat_param, sizeof(struct gapm_activity_create_adv_cmd));
147 p_cmd->operation = GAPM_CREATE_ADV_ACTIVITY;
148
149 ke_msg_send(p_cmd);
150}
151
152void xc_ble_set_adv_data(uint8_t actv_idx, uint16_t adv_data_length,
153 uint8_t *p_adv_data)
154{
155 struct gapm_set_adv_data_cmd *p_cmd =
156 KE_MSG_ALLOC_DYN(GAPM_SET_ADV_DATA_CMD, TASK_GAPM, TASK_APP,
157 gapm_set_adv_data_cmd, adv_data_length);
158
159 p_cmd->operation = GAPM_SET_ADV_DATA;
160 p_cmd->actv_idx = actv_idx;
161 p_cmd->length = adv_data_length;
162 memcpy(&p_cmd->data[0], p_adv_data, adv_data_length);
163
164 ke_msg_send(p_cmd);
165}
166
167void xc_ble_set_scan_rsp_data(uint8_t actv_idx, uint16_t scan_rsp_data_length,
168 uint8_t *p_scan_rsp_data)
169{
170 struct gapm_set_adv_data_cmd *p_cmd =
171 KE_MSG_ALLOC_DYN(GAPM_SET_ADV_DATA_CMD, TASK_GAPM, TASK_APP,
172 gapm_set_adv_data_cmd, scan_rsp_data_length);
173
174 p_cmd->operation = GAPM_SET_SCAN_RSP_DATA;
175 p_cmd->actv_idx = actv_idx;
176 p_cmd->length = scan_rsp_data_length;
177 memcpy(&p_cmd->data[0], p_scan_rsp_data, scan_rsp_data_length);
178
179 ke_msg_send(p_cmd);
180}
181
182void xc_ble_advertise_start(struct gapm_activity_start_cmd *adv_start_param)
183{
184 struct gapm_activity_start_cmd *p_cmd = KE_MSG_ALLOC(
185 GAPM_ACTIVITY_START_CMD, TASK_GAPM, TASK_APP, gapm_activity_start_cmd);
186
187 memcpy(p_cmd, adv_start_param, sizeof(struct gapm_activity_start_cmd));
188 p_cmd->operation = GAPM_START_ACTIVITY;
189
190 ke_msg_send(p_cmd);
191}
192
193void xc_ble_scan_create(struct gapm_activity_create_cmd *scan_creat_param)
194{
195 struct gapm_activity_create_cmd *p_cmd =
196 KE_MSG_ALLOC(GAPM_ACTIVITY_CREATE_CMD, TASK_GAPM, TASK_APP,
197 gapm_activity_create_cmd);
198
199 memcpy(p_cmd, scan_creat_param, sizeof(struct gapm_activity_create_cmd));
200 p_cmd->operation = GAPM_CREATE_SCAN_ACTIVITY;
201
202 ke_msg_send(p_cmd);
203}
204
205void xc_ble_scan_start(struct gapm_activity_start_cmd *scan_start_param)
206{
207 struct gapm_activity_start_cmd *p_cmd = KE_MSG_ALLOC(
208 GAPM_ACTIVITY_START_CMD, TASK_GAPM, TASK_APP, gapm_activity_start_cmd);
209
210 memcpy(p_cmd, scan_start_param, sizeof(struct gapm_activity_start_cmd));
211 p_cmd->operation = GAPM_START_ACTIVITY;
212
213 ke_msg_send(p_cmd);
214}
215
216void xc_ble_init_create(struct gapm_activity_create_cmd *init_creat_param)
217{
218 struct gapm_activity_create_cmd *p_cmd =
219 KE_MSG_ALLOC(GAPM_ACTIVITY_CREATE_CMD, TASK_GAPM, TASK_APP,
220 gapm_activity_create_cmd);
221
222 memcpy(p_cmd, init_creat_param, sizeof(struct gapm_activity_create_cmd));
223 p_cmd->operation = GAPM_CREATE_INIT_ACTIVITY;
224
225 ke_msg_send(p_cmd);
226}
227
228void xc_ble_init_start(struct gapm_activity_start_cmd *init_start_param)
229{
230 struct gapm_activity_start_cmd *p_cmd = KE_MSG_ALLOC(
231 GAPM_ACTIVITY_START_CMD, TASK_GAPM, TASK_APP, gapm_activity_start_cmd);
232
233 memcpy(p_cmd, init_start_param, sizeof(struct gapm_activity_start_cmd));
234 p_cmd->operation = GAPM_START_ACTIVITY;
235 p_cmd->u_param.init_param.conn_param_1m.ce_len_min = CE_LEN_MIN;
236 p_cmd->u_param.init_param.conn_param_1m.ce_len_max = CE_LEN_MAX;
237 p_cmd->u_param.init_param.conn_param_2m.ce_len_min = CE_LEN_MIN;
238 p_cmd->u_param.init_param.conn_param_2m.ce_len_max = CE_LEN_MAX;
239 p_cmd->u_param.init_param.conn_param_coded.ce_len_min = CE_LEN_MIN;
240 p_cmd->u_param.init_param.conn_param_coded.ce_len_max = CE_LEN_MAX;
241
242 ke_msg_send(p_cmd);
243}
244
245void xc_ble_activity_stop(int actv_idx)
246{
247 struct gapm_activity_stop_cmd *p_cmd = KE_MSG_ALLOC(
248 GAPM_ACTIVITY_STOP_CMD, TASK_GAPM, TASK_APP, gapm_activity_stop_cmd);
249
250 if (actv_idx >= 0) {
251 p_cmd->operation = GAPM_STOP_ACTIVITY;
252 } else {
253 p_cmd->operation = GAPM_STOP_ALL_ACTIVITIES;
254 }
255 p_cmd->actv_idx = actv_idx;
256
257 ke_msg_send(p_cmd);
258}
259
260void xc_ble_activity_delete(int actv_idx)
261{
262 struct gapm_activity_delete_cmd *p_cmd =
263 KE_MSG_ALLOC(GAPM_ACTIVITY_DELETE_CMD, TASK_GAPM, TASK_APP,
264 gapm_activity_delete_cmd);
265
266 if (actv_idx >= 0) {
267 p_cmd->operation = GAPM_DELETE_ACTIVITY;
268 } else {
269 p_cmd->operation = GAPM_DELETE_ALL_ACTIVITIES;
270 }
271 p_cmd->actv_idx = actv_idx;
272
273 ke_msg_send(p_cmd);
274}
275
276void xc_ble_disconnect(int conidx, uint32_t reason)
277{
278 struct gapc_disconnect_cmd *p_cmd =
279 KE_MSG_ALLOC(GAPC_DISCONNECT_CMD, KE_BUILD_ID(TASK_GAPC, conidx),
280 TASK_APP, gapc_disconnect_cmd);
281
282 p_cmd->operation = GAPC_DISCONNECT;
283 p_cmd->reason = reason;
284
285 ke_msg_send(p_cmd);
286}
287
288void xc_ble_update_param(int conidx, uint16_t intv_min, uint16_t intv_max,
289 uint16_t latency, uint16_t time_out)
290{
291 struct gapc_param_update_cmd *p_cmd =
292 KE_MSG_ALLOC(GAPC_PARAM_UPDATE_CMD, KE_BUILD_ID(TASK_GAPC, conidx),
293 TASK_APP, gapc_param_update_cmd);
294
295 p_cmd->operation = GAPC_UPDATE_PARAMS;
296 p_cmd->intv_min = intv_min;
297 p_cmd->intv_max = intv_max;
298 p_cmd->latency = latency;
299 p_cmd->time_out = time_out;
300 // not used by a slave device
301 p_cmd->ce_len_min = CE_LEN_MIN;
302 // p_cmd->ce_len_min = 0xFFFF;
303 p_cmd->ce_len_max = CE_LEN_MAX;
304
305 ke_msg_send(p_cmd);
306}
307
308void xc_ble_conn_cfm(int conidx, struct gapc_connection_cfm *p_cfm)
309{
310 struct gapc_connection_cfm *p_cmd =
311 KE_MSG_ALLOC(GAPC_CONNECTION_CFM, KE_BUILD_ID(TASK_GAPC, conidx),
312 TASK_APP, gapc_connection_cfm);
313
314 memcpy(p_cmd, p_cfm, sizeof(struct gapc_connection_cfm));
315
316 ke_msg_send(p_cmd);
317}
318
319void xc_ble_get_peer_info(int conidx, struct gapc_get_info_cmd *get_info)
320{
321 struct gapc_get_info_cmd *p_cmd =
322 KE_MSG_ALLOC(GAPC_GET_INFO_CMD, KE_BUILD_ID(TASK_GAPC, conidx),
323 TASK_APP, gapc_get_info_cmd);
324
325 p_cmd->operation = get_info->operation;
326
327 ke_msg_send(p_cmd);
328}
329
331 struct gapc_param_update_cfm *update_cfm)
332{
333 struct gapc_param_update_cfm *p_cmd =
334 KE_MSG_ALLOC(GAPC_PARAM_UPDATE_CFM, KE_BUILD_ID(TASK_GAPC, conidx),
335 TASK_APP, gapc_param_update_cfm);
336
337 memcpy(p_cmd, update_cfm, sizeof(struct gapc_param_update_cfm));
338 p_cmd->ce_len_min = CE_LEN_MIN;
339 p_cmd->ce_len_max = CE_LEN_MAX;
340
341 ke_msg_send(p_cmd);
342}
343
344void xc_ble_bond(int conidx, struct gapc_bond_cmd *p_param)
345{
346 struct gapc_bond_cmd *p_cmd = KE_MSG_ALLOC(
347 GAPC_BOND_CMD, KE_BUILD_ID(TASK_GAPC, conidx), TASK_APP, gapc_bond_cmd);
348
349 memcpy(p_cmd, p_param, sizeof(struct gapc_bond_cmd));
350 p_cmd->operation = GAPC_BOND;
351
352 ke_msg_send(p_cmd);
353}
354
355void xc_ble_bond_cfm(int conidx, struct gapc_bond_cfm *p_param)
356{
357 struct gapc_bond_cfm *p_cmd = KE_MSG_ALLOC(
358 GAPC_BOND_CFM, KE_BUILD_ID(TASK_GAPC, conidx), TASK_APP, gapc_bond_cfm);
359
360 memcpy(p_cmd, p_param, sizeof(struct gapc_bond_cfm));
361
362 ke_msg_send(p_cmd);
363}
364
365void xc_ble_get_dev_info_cfm(int conidx, struct gapc_get_dev_info_cfm *p_param)
366{
367 if ((p_param->req == GAPC_DEV_NAME) ||
368 (p_param->req == GAPC_DEV_APPEARANCE) ||
369 (p_param->req == GAPC_DEV_SLV_PREF_PARAMS)) {
370 struct gapc_get_dev_info_cfm *p_cmd = KE_MSG_ALLOC_DYN(
371 GAPC_GET_DEV_INFO_CFM, KE_BUILD_ID(TASK_GAPC, conidx), TASK_APP,
372 gapc_get_dev_info_cfm, DEVICE_NAME_MAX_LEN);
373
374 memcpy(p_cmd, p_param, sizeof(struct gapc_get_dev_info_cfm));
375
376 ke_msg_send(p_cmd);
377 } else {
378 // do nothing;
379 }
380}
381
382void xc_ble_set_dev_info_cfm(int conidx, struct gapc_set_dev_info_cfm *p_param)
383{
384 struct gapc_set_dev_info_cfm *p_cmd =
385 KE_MSG_ALLOC(GAPC_SET_DEV_INFO_CFM, KE_BUILD_ID(TASK_GAPC, conidx),
386 TASK_APP, gapc_set_dev_info_cfm);
387
388 memcpy(p_cmd, p_param, sizeof(struct gapc_set_dev_info_cfm));
389
390 ke_msg_send(p_cmd);
391}
392
393void xc_ble_encrypt(int conidx, struct gapc_encrypt_cmd *p_param)
394{
395 struct gapc_encrypt_cmd *p_cmd =
396 KE_MSG_ALLOC(GAPC_ENCRYPT_CMD, KE_BUILD_ID(TASK_GAPC, conidx), TASK_APP,
397 gapc_encrypt_cmd);
398
399 memcpy(p_cmd, p_param, sizeof(struct gapc_encrypt_cmd));
400 p_cmd->operation = GAPC_ENCRYPT;
401
402 ke_msg_send(p_cmd);
403}
404
406void xc_ble_encrypt_cfm(int conidx, struct gapc_encrypt_cfm *p_param)
407{
408 struct gapc_encrypt_cfm *p_cmd =
409 KE_MSG_ALLOC(GAPC_ENCRYPT_CFM, KE_BUILD_ID(TASK_GAPC, conidx), TASK_APP,
410 gapc_encrypt_cfm);
411
412 memcpy(p_cmd, p_param, sizeof(struct gapc_encrypt_cfm));
413
414 ke_msg_send(p_cmd);
415}
416
418void xc_ble_req_security(int conidx, uint8_t sec_auth)
419{
420 struct gapc_security_cmd *p_cmd =
421 KE_MSG_ALLOC(GAPC_SECURITY_CMD, KE_BUILD_ID(TASK_GAPC, conidx),
422 TASK_APP, gapc_security_cmd);
423
424 p_cmd->operation = GAPC_SECURITY_REQ;
425 p_cmd->auth = sec_auth;
426
427 ke_msg_send(p_cmd);
428}
429
430void xc_ble_set_pkt_size(int conidx, uint16_t tx_octets, uint16_t tx_time)
431{
432 struct gapc_set_le_pkt_size_cmd *p_cmd =
433 KE_MSG_ALLOC(GAPC_SET_LE_PKT_SIZE_CMD, KE_BUILD_ID(TASK_GAPC, conidx),
434 TASK_APP, gapc_set_le_pkt_size_cmd);
435
436 p_cmd->operation = GAPC_SET_LE_PKT_SIZE;
437 p_cmd->tx_octets = tx_octets;
438 p_cmd->tx_time = tx_time;
439
440 // Send the message
441 ke_msg_send(p_cmd);
442}
443
444void xc_ble_set_rx_pkt_size(int conidx, uint16_t rx_octets, uint16_t rx_time)
445{
446 struct gapc_set_max_rx_size_and_time_cmd *p_cmd = KE_MSG_ALLOC(
447 GAPC_SET_MAX_RX_SIZE_AND_TIME_CMD, KE_BUILD_ID(TASK_GAPC, conidx),
448 TASK_APP, gapc_set_max_rx_size_and_time_cmd);
449
450 p_cmd->operation = GAPC_SET_MAX_RX_SIZE_AND_TIME;
451 p_cmd->rx_octets = rx_octets;
452 p_cmd->rx_time = rx_time;
453
454 // Send the message
455 ke_msg_send(p_cmd);
456}
457
458void xc_ble_set_channel_map(struct gapm_set_channel_map_cmd *p_param)
459{
460 struct gapm_set_channel_map_cmd *p_cmd =
461 KE_MSG_ALLOC(GAPM_SET_CHANNEL_MAP_CMD, TASK_GAPM, TASK_APP,
462 gapm_set_channel_map_cmd);
463
464 memcpy(p_cmd, p_param, sizeof(struct gapm_set_channel_map_cmd));
465 p_cmd->operation = GAPM_SET_CHANNEL_MAP;
466
467 ke_msg_send(p_cmd);
468}
469
470#endif // (BLE_APP_PRESENT)
void xc_ble_gen_random_addr(struct gapm_gen_rand_addr_cmd *p_param)
Generate a random device address without starting any air operation. This can be useful for privacy i...
Definition xc_gap_api.c:60
void xc_ble_gapm_reset(void)
Called only in the app_init(). It's used to reset the device but setting device configuration is sti...
Definition xc_gap_api.c:13
void xc_ble_set_pkt_size(int conidx, uint16_t tx_octets, uint16_t tx_time)
This operation to define the preferred packet length to be used by the controller
Definition xc_gap_api.c:430
void xc_ble_update_param(int conidx, uint16_t intv_min, uint16_t intv_max, uint16_t latency, uint16_t time_out)
Update connection paramters
Definition xc_gap_api.c:288
void xc_ble_get_ral_addr(struct gapm_get_ral_addr_cmd *p_param)
Get local or peer resolvable private address
Definition xc_gap_api.c:102
void xc_ble_scan_create(struct gapm_activity_create_cmd *scan_creat_param)
Create a scanning activity.
Definition xc_gap_api.c:193
void xc_ble_bond_cfm(int conidx, struct gapc_bond_cfm *p_param)
Confirm bond request.
Definition xc_gap_api.c:355
void xc_ble_advertise_create(struct gapm_activity_create_adv_cmd *adv_creat_param)
Create an advertising activity.
Definition xc_gap_api.c:139
void xc_ble_activity_delete(int actv_idx)
Delete an activity or all activities
Definition xc_gap_api.c:260
void xc_ble_get_pub_key(void)
Read the local P-256 Public Key. This key is renewed each time this command is called by requester a...
Definition xc_gap_api.c:71
void xc_ble_conn_cfm(int conidx, struct gapc_connection_cfm *p_cfm)
Confirm connection request Set specific link security configuration and bonding data,...
Definition xc_gap_api.c:308
void xc_ble_set_white_list(uint8_t size, gap_bdaddr_t *wl_info)
Request to set the content of the White List. The current content of the indicated list will be clear...
Definition xc_gap_api.c:126
void xc_ble_set_ral_list(uint8_t size, struct gap_ral_dev_info *ral_info)
Request to set the content of the Resolving List. The current content of the indicated list will be c...
Definition xc_gap_api.c:113
void xc_ble_set_rx_pkt_size(int conidx, uint16_t rx_octets, uint16_t rx_time)
Definition xc_gap_api.c:444
void xc_ble_set_adv_data(uint8_t actv_idx, uint16_t adv_data_length, uint8_t *p_adv_data)
Set advertising data for a given previously created advertising activity identified by its activity ...
Definition xc_gap_api.c:152
void xc_ble_set_channel_map(struct gapm_set_channel_map_cmd *p_param)
This operation can be requested only by master of the link in order to set the channel map of the dev...
Definition xc_gap_api.c:458
void xc_ble_advertise_start(struct gapm_activity_start_cmd *adv_start_param)
Start an advertising activity.
Definition xc_gap_api.c:182
void xc_ble_scan_start(struct gapm_activity_start_cmd *scan_start_param)
Start a scanning activity.
Definition xc_gap_api.c:205
void xc_ble_get_dev_info_cfm(int conidx, struct gapc_get_dev_info_cfm *p_param)
Called when the peer device obtains information about the local device. Device Name,...
Definition xc_gap_api.c:365
void xc_ble_set_dev_config(struct gapm_set_dev_config_cmd *cfg_param)
Set the device configuration such as: Device role Manage device address type: Public,...
Definition xc_gap_api.c:24
void xc_ble_set_dev_info_cfm(int conidx, struct gapc_set_dev_info_cfm *p_param)
Send the write confirmation to the stack.
Definition xc_gap_api.c:382
void xc_ble_req_security(int conidx, uint8_t sec_auth)
issue from slave
Definition xc_gap_api.c:418
void xc_ble_encrypt(int conidx, struct gapc_encrypt_cmd *p_param)
This operation can be requested only by master of the link in order to initiate encryption procedure....
Definition xc_gap_api.c:393
void xc_ble_activity_stop(int actv_idx)
Stop an activity or all activities.
Definition xc_gap_api.c:245
void xc_ble_param_update_cfm(int conidx, struct gapc_param_update_cfm *update_cfm)
Used by to accept or refuse connection parameters proposed by peer device.
Definition xc_gap_api.c:330
void xc_ble_set_scan_rsp_data(uint8_t actv_idx, uint16_t scan_rsp_data_length, uint8_t *p_scan_rsp_data)
Set Scan response data for a given previously created advertising activity identified by its activit...
Definition xc_gap_api.c:167
void xc_ble_encrypt_cfm(int conidx, struct gapc_encrypt_cfm *p_param)
issue from master
Definition xc_gap_api.c:406
void xc_ble_gen_random_nb(void)
Used to generate an 8-byte random number. This can be useful to generate LTK random number before di...
Definition xc_gap_api.c:81
void xc_ble_init_start(struct gapm_activity_start_cmd *init_start_param)
Start a initiating activity.
Definition xc_gap_api.c:228
void xc_ble_set_irk(gap_sec_key_t *irk)
Command to change the current IRK for a renewed one, it can be used every time no air operation is b...
Definition xc_gap_api.c:91
void xc_ble_resolve_addr(uint8_t nb_key, gap_addr_t *addr, uint8_t *irk)
Resolve provided random address using array of Identity Resolution Key (IRK) exchanged and bonded wit...
Definition xc_gap_api.c:45
void xc_ble_bond(int conidx, struct gapc_bond_cmd *p_param)
Requested by master of the link in order to initiate the bond procedure. It contains pairing require...
Definition xc_gap_api.c:344
void xc_ble_get_dev_info(struct gapm_get_dev_info_cmd *cmd)
Get information about local device such as: Local Device Name Local Device Version Local Device Pu...
Definition xc_gap_api.c:35
void xc_ble_get_peer_info(int conidx, struct gapc_get_info_cmd *get_info)
Retrieve information about peer device or about the current active link.
Definition xc_gap_api.c:319
void xc_ble_disconnect(int conidx, uint32_t reason)
Request for disconnection of the link. This can be requested by master or slave of the connection.
Definition xc_gap_api.c:276
void xc_ble_init_create(struct gapm_activity_create_cmd *init_creat_param)
Create a initiating activity.
Definition xc_gap_api.c:216
GAP API. Copyright (c) 2022 - 2025, XinChip All rights reserved.