BLE5.2 1.0
开发文档说明
xc_gap_api.h
浏览该文件的文档.
1
10#ifndef __XC_GAP_API_H__
11#define __XC_GAP_API_H__
12
13#include "gapc_msg.h"
14#include "gapm_msg.h"
15#include "ke_msg.h"
16
17/*
18 * DEFINES
19 ****************************************************************************************
20 */
21
22#define CE_LEN_MIN 2
23#define CE_LEN_MAX 4
24#define DEVICE_NAME_MAX_LEN 18
25
26
27/*
28 * FUNCTION DECLARATIONS
29 ****************************************************************************************
30 */
31
43void xc_ble_gapm_reset(void);
44
65void xc_ble_set_dev_config(struct gapm_set_dev_config_cmd *cfg_param);
66
93void xc_ble_get_dev_info(struct gapm_get_dev_info_cmd *cmd);
94
113void xc_ble_resolve_addr(uint8_t nb_key,gap_addr_t *addr,uint8_t *irk);
114
127void xc_ble_gen_random_addr(struct gapm_gen_rand_addr_cmd *p_param);
128
140void xc_ble_get_pub_key(void);
141
153void xc_ble_gen_random_nb(void);
154
168void xc_ble_set_irk(gap_sec_key_t *irk);
169
187void xc_ble_get_ral_addr(struct gapm_get_ral_addr_cmd *p_param);
188
207void xc_ble_set_ral_list(uint8_t size, struct gap_ral_dev_info *ral_info);
208
227void xc_ble_set_white_list(uint8_t size, gap_bdaddr_t *wl_info);
228
243void xc_ble_advertise_create(struct gapm_activity_create_adv_cmd *adv_creat_param);
244
261void xc_ble_set_adv_data(uint8_t actv_idx, uint16_t adv_data_length, uint8_t *p_adv_data);
262
280void xc_ble_set_scan_rsp_data(uint8_t actv_idx, uint16_t scan_rsp_data_length, uint8_t *p_scan_rsp_data);
281
293void xc_ble_advertise_start(struct gapm_activity_start_cmd *adv_start_param);
294
310void xc_ble_scan_create(struct gapm_activity_create_cmd *scan_creat_param);
311
328void xc_ble_scan_start(struct gapm_activity_start_cmd *scan_start_param);
329
344void xc_ble_init_create(struct gapm_activity_create_cmd *init_create_param);
345
361void xc_ble_init_start(struct gapm_activity_start_cmd *init_start_param);
362
381void xc_ble_activity_stop(int actv_idx);
382
401void xc_ble_activity_delete(int actv_idx);
402
416void xc_ble_disconnect(int conidx, uint32_t reason);
417
433void xc_ble_update_param(int conidx, uint16_t intv_min, uint16_t intv_max,
434 uint16_t latency, uint16_t time_out);
435
461void xc_ble_conn_cfm(int conidx, struct gapc_connection_cfm *p_cfm);
462
488void xc_ble_get_peer_info(int conidx, struct gapc_get_info_cmd *get_info);
489
499void xc_ble_param_update_cfm(int conidx, struct gapc_param_update_cfm *update_cfm);
500
516void xc_ble_bond(int conidx, struct gapc_bond_cmd *p_param);
517
533void xc_ble_bond_cfm(int conidx, struct gapc_bond_cfm *p_param);
534
549void xc_ble_get_dev_info_cfm(int conidx, struct gapc_get_dev_info_cfm *p_param);
550
559void xc_ble_set_dev_info_cfm(int conidx, struct gapc_set_dev_info_cfm *p_param);
560
574void xc_ble_encrypt(int conidx, struct gapc_encrypt_cmd *p_param);
575
586void xc_ble_encrypt_cfm(int conidx, struct gapc_encrypt_cfm *p_param);
587
600void xc_ble_req_security(int conidx, uint8_t sec_auth);
601
617void xc_ble_set_pkt_size(int conidx, uint16_t tx_octets, uint16_t tx_time);
618
629void xc_ble_set_channel_map(struct gapm_set_channel_map_cmd *p_param);
630#endif // __XC_GAP_API_H__
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_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)
This operation can be requested only by slave of the link in order to initiate security request proce...
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)
Confirmation message to send after receiving a GAPC_ENCRYPT_REQ_IND message This message can is used...
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_init_create(struct gapm_activity_create_cmd *init_create_param)
Create a initiating activity.
Definition xc_gap_api.c:216
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