BLE5.2 1.0
开发文档说明
函数
xc_gap_api.c 文件参考

GAP APIs source code Copyright (c) 2022 - 2025, XinChip All rights reserved. 更多...

浏览源代码.

函数

void xc_ble_gapm_reset (void)
 Called only in the app_init(). It's used to reset the device but setting
device configuration is still required to use host stack.
Software reset: This will initialize the RW-BLE Host stack – rearrange to default settings the ATT, GAP, GATT,
L2CAP and SMP blocks. Furthermore, this will cause the host to send a reset command down to the link
layer part. Platform reset: Use platform mechanism to reset hardware.
 
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, Private static or Generated for Privacy
Internal IRK used to generate resolvable random address.
Set Internal GAP / GATT service start.
Set specific write permissions on the appearance and name attributes in internal GAP database.
Manage presence of some attribute.
Configure Data Length Extension features.
The set device configuration first resets the device to close all active link and configured profiles.
This command must be sent before adding profiles and start air activities.
 
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 Public BD Address
Data Length Extension parameters
Antenna information
 
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 with
devices during pairing operations.
Operation will complete successfully if address has been correctly resolved and GAPM_ADDR_SOLVED_IND
message will be triggered to inform which key has been used to perform resolution.
Else operation complete with GAP_ERR_NOT_FOUND error status code.
 
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 in order
to generate the reconnection address on demand.
 
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 and so each pairing using secure connection.
 
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 distributing it.
 
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 being performed.
 
void xc_ble_get_ral_addr (struct gapm_get_ral_addr_cmd *p_param)
 Get local or peer resolvable private address
 
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 cleared
and replaced by the indicated content.
If number of addresses to be added in the list is greater than list size, a GAP_ERR_INSUFF_RESOURCES status
is returned in the GAPM_CMP_EVT message.
A device can be present only once in the list. If not the case a GAP_ERR_INVALID_PARAM status is returned.
 
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 cleared
and replaced by the indicated content.
If number of addresses to be added in the list is greater than list size, a GAP_ERR_INSUFF_RESOURCES status
is returned in the GAPM_CMP_EVT message.
A device can be present only once in the list. If not the case a GAP_ERR_INVALID_PARAM status is returned.
 
void xc_ble_advertise_create (struct gapm_activity_create_adv_cmd *adv_creat_param)
 Create an advertising activity.
 
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 identifier.
 
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
activity identifier.
 
void xc_ble_advertise_start (struct gapm_activity_start_cmd *adv_start_param)
 Start an advertising activity.
 
void xc_ble_scan_create (struct gapm_activity_create_cmd *scan_creat_param)
 Create a scanning activity.
 
void xc_ble_scan_start (struct gapm_activity_start_cmd *scan_start_param)
 Start a scanning activity.
 
void xc_ble_init_create (struct gapm_activity_create_cmd *init_creat_param)
 Create a initiating activity.
 
void xc_ble_init_start (struct gapm_activity_start_cmd *init_start_param)
 Start a initiating activity.
 
void xc_ble_activity_stop (int actv_idx)
 Stop an activity or all activities.
 
void xc_ble_activity_delete (int actv_idx)
 Delete an activity or all activities
 
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.
 
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
 
void xc_ble_conn_cfm (int conidx, struct gapc_connection_cfm *p_cfm)
 Confirm connection request
Set specific link security configuration and bonding data,
Set connection bond data,
Authentication and authorization link configuration.
This confirmation message shall be sent by application after receiving a GAPC_CONNECTION_REQ_IND in
order to enables local attribute tasks and security manager for the connection.
It can be resent later if peer device information is retrieved later (for instance when a master initiates an
encryption, information of the LTK can be used to identify peer device). In fact, when encryption is initiated
by master device, it uses a couple of encryption diversifier (ediv) and random number (rand_nb) that can be
used to retrieve corresponding encryption Long Term Key (LTK) that has been exchanged during a previous
connection. By retrieving the LTK, we retrieve a known device and in that case before terminating encryption
procedure, application shall update connection parameters.
 
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.
 
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.
 
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 requirement of initiator.
 
void xc_ble_bond_cfm (int conidx, struct gapc_bond_cfm *p_param)
 Confirm bond request.
 
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,

Device Appearance,
Icon Device Slave preferred parameters,
Device Central address resolution,
Device database hash value,
Resolvable Private address only after bond.

 
void xc_ble_set_dev_info_cfm (int conidx, struct gapc_set_dev_info_cfm *p_param)
 Send the write confirmation to the stack.
 
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. It
contains Long Term Key that should be used during the encryption.
 
void xc_ble_encrypt_cfm (int conidx, struct gapc_encrypt_cfm *p_param)
 issue from master
 
void xc_ble_req_security (int conidx, uint8_t sec_auth)
 issue from slave
 
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

 
void xc_ble_set_rx_pkt_size (int conidx, uint16_t rx_octets, uint16_t rx_time)
 
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 device.

 

详细描述

GAP APIs source code Copyright (c) 2022 - 2025, XinChip All rights reserved.

在文件 xc_gap_api.c 中定义.

函数说明

◆ xc_ble_activity_delete()

void xc_ble_activity_delete ( int  actv_idx)

Delete an activity or all activities

注解
Request the host to delete either an activity identified by its activity identifier or all currently existing
activities.
If selected activity is not stopped (GAPM_DELETE_ACTIVITY operation) or if at least one activity is still
running (GAPM_DELETE_ALL_ACTIVITIES), a GAP_ERR_COMMAND_DISALLOWED status will be returned in the
GAPM_CMP_EVT message.
GAPM_CMP_EVT: When operation has been completed, operation is GAPM_DELETE_ACTIVITY or GAPM_DELETE_ALL_ACTIVITIES.
参数
[in]actv_idxActivity index , If less than 0, stop all activities. activities

在文件 xc_gap_api.c260 行定义.

◆ xc_ble_activity_stop()

void xc_ble_activity_stop ( int  actv_idx)

Stop an activity or all activities.

注解
Request the host to stop a started activity identified by its activity identifier.
If the requested activity does not exist, GAPM_CMP_EVT message is returned with a
GAP_ERR_INVALID_PARAM status. If the activity exists but was not started, error GAP_ERR_COMMAND_DISALLOWED
is and no GAPM_ACTIVITY_STOPPED_IND message is sent.
GAPM_ACTIVITY_STOPPED_IND: Once the requested activity has been successfully stopped.
GAPM_CMP_EVT: When operation has been completed, operation is GAPM_ACTIVITY_START_CMD or GAPM_STOP_ALL_ACTIVITIES.
参数
[in]actv_idxActivity index ,If less than 0, stop all activities

在文件 xc_gap_api.c245 行定义.

◆ xc_ble_advertise_create()

void xc_ble_advertise_create ( struct gapm_activity_create_adv_cmd *  adv_creat_param)

Create an advertising activity.

注解
The number of activities that can be created in parallel is limited. If the limit has been reached and a new
activity cannot be created, a GAP_ERR_INSUFF_RESOURCES status will be returned in the GAPM_CMT_EVT message.
GAPM_ACTIVITY_CREATED_IND: Once the requested activity has been successfully created.
GAPM_CMP_EVT: When operation has been completed, operation is GAPM_CREATE_ADV_ACTIVITY.
参数
[in]adv_creat_paramPointer to activity create structure.

在文件 xc_gap_api.c139 行定义.

◆ xc_ble_advertise_start()

void xc_ble_advertise_start ( struct gapm_activity_start_cmd *  adv_start_param)

Start an advertising activity.

注解
Several advertising activities can be started in parallel.
GAPM_CMP_EVT: When operation has well been started or if an error has been detected, operation is GAPM_START_ACTIVITY.
参数
[in]adv_start_paramPointer to activity start structure.

在文件 xc_gap_api.c182 行定义.

◆ xc_ble_bond()

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 requirement of initiator.

注解
GAPC_BOND_REQ_IND: Triggered if some information should be provided by device during the pairing.
GAPC_BOND_IND: Triggered in order to receive key exchanged by peer device and get pairing status.
GAPC_CMP_EVT: When operation completed, operation is GAPC_BOND.
参数
[in]conidxConnection index
[in]p_bondPointer to pairing requirement of initiator.

在文件 xc_gap_api.c344 行定义.

◆ xc_ble_bond_cfm()

void xc_ble_bond_cfm ( int  conidx,
struct gapc_bond_cfm *  p_param 
)

Confirm bond request.

注解

Confirmation message to send after receiving a GAPC_BOND_REQ_IND message
This message can contain:
Slave pairing information
Pairing temporary key (TK)
Key to provide to the peer device during key exchange.
参数
[in]conidxConnection index
[in]p_cfmPointer to bond confirm data structure.

在文件 xc_gap_api.c355 行定义.

◆ xc_ble_conn_cfm()

void xc_ble_conn_cfm ( int  conidx,
struct gapc_connection_cfm *  p_cfm 
)

Confirm connection request
Set specific link security configuration and bonding data,
Set connection bond data,
Authentication and authorization link configuration.
This confirmation message shall be sent by application after receiving a GAPC_CONNECTION_REQ_IND in
order to enables local attribute tasks and security manager for the connection.
It can be resent later if peer device information is retrieved later (for instance when a master initiates an
encryption, information of the LTK can be used to identify peer device). In fact, when encryption is initiated
by master device, it uses a couple of encryption diversifier (ediv) and random number (rand_nb) that can be
used to retrieve corresponding encryption Long Term Key (LTK) that has been exchanged during a previous
connection. By retrieving the LTK, we retrieve a known device and in that case before terminating encryption
procedure, application shall update connection parameters.

注解
This is to response to the event "GAP_EVT_CONN_REQ". Application can
call this API in the call back.
If authentication parameter is marked has “Not Bonded”, other parameters are ignored and peer
device is considered as an unknown device.
参数
[in]conidxConnection index
[in]p_cfmPointer to comfirm parameters structure.

在文件 xc_gap_api.c308 行定义.

◆ xc_ble_disconnect()

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.

注解

Reason of disconnection shall be a valid disconnection reason
参见
enum co_error
注解

Either master or slave can call this function.
参数
[in]conidxConnection index.
[in]reasonReason of disconnection, 0x13:User on the remote device terminated the connnection

在文件 xc_gap_api.c276 行定义.

◆ xc_ble_encrypt()

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. It
contains Long Term Key that should be used during the encryption.

注解
GAPC_ENCRYPT_IND: Triggered if encryption operation succeed.
GAPC_CMP_EVT: When operation completed. operation is GAPC_ENCRYPT.
参数
[in]conidxConnection index
[in]p_paramPointer to data structure.

在文件 xc_gap_api.c393 行定义.

◆ xc_ble_encrypt_cfm()

void xc_ble_encrypt_cfm ( int  conidx,
struct gapc_encrypt_cfm *  p_param 
)

issue from master

Confirmation message to send after receiving a GAPC_ENCRYPT_REQ_IND message
This message can is used to inform if encryption key has been found, if yes found Long Term Key and its size
shall be provided.

在文件 xc_gap_api.c406 行定义.

◆ xc_ble_gapm_reset()

void xc_ble_gapm_reset ( void  )

Called only in the app_init(). It's used to reset the device but setting
device configuration is still required to use host stack.
Software reset: This will initialize the RW-BLE Host stack – rearrange to default settings the ATT, GAP, GATT,
L2CAP and SMP blocks. Furthermore, this will cause the host to send a reset command down to the link
layer part. Platform reset: Use platform mechanism to reset hardware.

注解
Trigger GAPM_CMP_EVT, operation is GAPM_RESET

在文件 xc_gap_api.c13 行定义.

◆ xc_ble_gen_random_addr()

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 in order
to generate the reconnection address on demand.

注解
GAPM_DEV_BDADDR_IND: triggered when address generated.
GAPM_CMP_EVT: When operation completed, operation is GAPM_GEN_RAND_ADDR.
参数
[in]p_paramrandom address type.
参见
enum random_addr_type

在文件 xc_gap_api.c60 行定义.

◆ xc_ble_gen_random_nb()

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 distributing it.

注解
GAPM_GEN_RAND_NB_IND: triggered when random number is generated.
GAPM_CMP_EVT: When operation completed, operation is GAPM_GEN_RAND_NB.

在文件 xc_gap_api.c81 行定义.

◆ xc_ble_get_dev_info()

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 Public BD Address
Data Length Extension parameters
Antenna information

注解
operation is:
GAPM_DEV_VERSION_IND: If local device version is requested.
GAPM_DEV_BDADDR_IND: if local device public BD Address is requested.
GAPM_DEV_ADV_TX_POWER_IND: If advertising TX power level is requested.
GAPM_DBG_MEM_INFO_IND: if memory information are requested (DEBUG ONLY).
GAPM_SUGG_DFLT_DATA_LEN_IND: if suggested Default Data Length is requested.
GAPM_MAX_DATA_LEN_IND: if Maximum Data Length is requested.
GAPM_NB_ADV_SETS_IND: if number of advertising sets is requested.
GAPM_MAX_ADV_DATA_LEN_IND: if maximum advertising data length is requested.
GAPM_ANTENNA_INF_IND: if antenna information requested.
GAPM_CMP_EVT: When operation completed.
参数
[in]cmdCommand for information

在文件 xc_gap_api.c35 行定义.

◆ xc_ble_get_dev_info_cfm()

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,

Device Appearance,
Icon Device Slave preferred parameters,
Device Central address resolution,
Device database hash value,
Resolvable Private address only after bond.

参数
[in]conidxConnection index
[in]p_paramPointer to data structure.

在文件 xc_gap_api.c365 行定义.

◆ xc_ble_get_peer_info()

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.

注解

Getting rssi information about peer device:
operation is : GAPC_PEER_ATT_INFO_IND: Event triggered when peer device attribute DB info such as device name,
appearance, slave preferred parameters or address resolution supported is requested.
GAPC_PEER_VERSION_IND: Event triggered when peer device version is requested
GAPC_PEER_FEATURES_IND: Event triggered when peer device features are requested
GAPC_CON_RSSI_IND: Event triggered when connection RSSI is requested
GAPC_CON_CHANNEL_MAP_IND: Event triggered when connection channel map is requested
GAPC_LE_PING_TO_VAL_IND: Event triggered when LE Ping timeout value is requested
GAPC_LE_PHY_IND: Event triggered when RX/TX PHYs are requested
GAPC_CHAN_SEL_ALGO_IND: Event triggered when current channel selection algorithm is requested.
GAPC_LOC_TX_PWR_IND: Event trigger when reading local TX power value
GAPC_PEER_TX_PWR_IND: Event trigger when reading peer TX power value
GAPC_CMP_EVT: When operation completed.
参数
[in]conidxConnection index
[in]get_infoPointer to parameters structure operation

在文件 xc_gap_api.c319 行定义.

◆ xc_ble_get_pub_key()

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 and so each pairing using secure connection.

注解
GAPM_PUB_KEY_IND: triggered when P-256 Public Key properly read
GAPM_CMP_EVT: When operation completed, operation is GAPM_GET_PUB_KEY.

在文件 xc_gap_api.c71 行定义.

◆ xc_ble_get_ral_addr()

void xc_ble_get_ral_addr ( struct gapm_get_ral_addr_cmd *  p_param)

Get local or peer resolvable private address

注解
operation is:
GAPM_GET_RAL_LOC_ADDR: Get resolving local address
GAPM_GET_RAL_PEER_ADDR: Get resolving peer address
GAPM_RAL_ADDR_IND: Return requested address.
GAPM_CMP_EVT: When operation has been completed.
参数
[in]p_paramPointer Read local or peer address cmd ptr.

在文件 xc_gap_api.c102 行定义.

◆ xc_ble_init_create()

void xc_ble_init_create ( struct gapm_activity_create_cmd *  init_create_param)

Create a initiating activity.

注解
GAPM_ACTIVITY_CREATED_IND: Once the requested activity has been successfully created.
GAPM_CMP_EVT: When operation has been completed, operation is GAPM_CREATE_INIT_ACTIVITY.
The number of activities that can be created in parallel is limited. If the limit has been reached and a new
activity cannot be created, a GAP_ERR_INSUFF_RESOURCES status will be returned in the GAPM_CMT_EVT message.
参数
[in]init_creat_paramPointer to activity create structure.

在文件 xc_gap_api.c216 行定义.

◆ xc_ble_init_start()

void xc_ble_init_start ( struct gapm_activity_start_cmd *  init_start_param)

Start a initiating activity.

注解
GAPM_CMP_EVT: When operation has well been started or if an error has been detected, operation is GAPM_ACTIVITY_START_CMD.
it is not possible to start several scanning or
several initiating activities as controller only supports one scanning and one initiating procedure to be run in parallel.
It is then application responsibility to decide which scanning/initiating activity can be started.
If this rule is not respected, GAPM_CMP_EVT message will be returned with a
GAP_ERR_COMMAND_DISALLOWED status.
参数
[in]init_start_paramPointer to activity start structure.

在文件 xc_gap_api.c228 行定义.

◆ xc_ble_param_update_cfm()

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.

参数
[in]conidxConnection index
[in]update_cfmPointer to parameters structure.

在文件 xc_gap_api.c330 行定义.

◆ xc_ble_req_security()

void xc_ble_req_security ( int  conidx,
uint8_t  sec_auth 
)

issue from slave

This operation can be requested only by slave of the link in order to initiate security request procedure. It
contains authentication level requested by current device.

在文件 xc_gap_api.c418 行定义.

◆ xc_ble_resolve_addr()

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 with
devices during pairing operations.
Operation will complete successfully if address has been correctly resolved and GAPM_ADDR_SOLVED_IND
message will be triggered to inform which key has been used to perform resolution.
Else operation complete with GAP_ERR_NOT_FOUND error status code.

注解
GAPM_ADDR_SOLVED_IND: triggered if address correctly resolved.
GAPM_CMP_EVT: When operation completed, operation is GAPM_RESOLV_ADDR.
参数
[in]nb_keyNumber of provided IRK (sahlle be > 0).
[in]addrPointer to resolvable random address to solve.
[in]irkPointer to array of IRK used for address resolution (MSB -> LSB).

在文件 xc_gap_api.c45 行定义.

◆ xc_ble_scan_create()

void xc_ble_scan_create ( struct gapm_activity_create_cmd *  scan_creat_param)

Create a scanning activity.

注解

The number of activities that can be created in parallel is limited. If the limit has been reached and a new
activity cannot be created, a GAP_ERR_INSUFF_RESOURCES status will be returned in the GAPM_CMT_EVT message.
GAPM_ACTIVITY_CREATED_IND: Once the requested activity has been successfully created.
GAPM_CMP_EVT: When operation has been completed, operation is GAPM_CREATE_SCAN_ACTIVITY.
参数
[in]scan_creat_paramPointer to activity create structure.

在文件 xc_gap_api.c193 行定义.

◆ xc_ble_scan_start()

void xc_ble_scan_start ( struct gapm_activity_start_cmd *  scan_start_param)

Start a scanning activity.

注解
it is not possible to start several scanning or several initiating activities as controller only
supports one scanning and one initiating procedure to be run in parallel.
It is then application responsibility to decide which scanning/initiating activity can be started.
If this rule is not respected, GAPM_CMP_EVT message will be returned with a
GAP_ERR_COMMAND_DISALLOWED status.
GAPM_CMP_EVT: When operation has well been started or if an error has been detected, operation is GAPM_START_ACTIVITY.
参数
[in]scan_start_paramPointer to activity start structure.

在文件 xc_gap_api.c205 行定义.

◆ xc_ble_set_adv_data()

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 identifier.

注解
If the provided identifier appears not to identify an existing advertising activity, GAPM_CMP_EVT message
will be returned with a GAP_ERR_INVALID_PARAM status.
GAPM_CMP_EVT: When operation completed, operation is GAPM_SET_ADV_DATA.
参数
[in]actv_idxActivity identifier
[in]adv_data_lengthADV data length
[in]p_adv_dataPointer to adv data

在文件 xc_gap_api.c152 行定义.

◆ xc_ble_set_channel_map()

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 device.

注解
GAPC_CMP_EVT: When operation completed. operation is GAPC_SECURITY_REQ.
参数
[in]p_paramPointer to data structure.

在文件 xc_gap_api.c458 行定义.

◆ xc_ble_set_dev_config()

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, Private static or Generated for Privacy
Internal IRK used to generate resolvable random address.
Set Internal GAP / GATT service start.
Set specific write permissions on the appearance and name attributes in internal GAP database.
Manage presence of some attribute.
Configure Data Length Extension features.
The set device configuration first resets the device to close all active link and configured profiles.
This command must be sent before adding profiles and start air activities.

注解
Trigger GAPM_CMP_EVT, operation is GAPM_SET_DEV_CONFIG.
参数
[in]cfg_paramPointer to the device configurtion structure.

在文件 xc_gap_api.c24 行定义.

◆ xc_ble_set_dev_info_cfm()

void xc_ble_set_dev_info_cfm ( int  conidx,
struct gapc_set_dev_info_cfm *  p_param 
)

Send the write confirmation to the stack.

参数
[in]conidxConnection index
[in]p_paramPointer to data structure.

在文件 xc_gap_api.c382 行定义.

◆ xc_ble_set_irk()

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 being performed.

注解
GAPM_CMP_EVT: When operation completed,
This can only be called during no air operation, operation is GAPM_SET_IRK.
参数
[out]p_paramPointer to a security key data structure.

在文件 xc_gap_api.c91 行定义.

◆ xc_ble_set_pkt_size()

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

注解
GAPC_CMP_EVT: When operation completed. operation is GAPC_SECURITY_REQ. GAPC_LE_PKT_SIZE_IND: Event triggered with the new values
参数
[in]conidxConnection index
[in]tx_octetsPreferred maximum number of payload octets that the local Controller should include in
a single Link Layer Data Channel PDU.
[in]tx_timePreferred maximum number of microseconds that the local Controller should use to transmit
a single Link Layer Data Channel PDU

在文件 xc_gap_api.c430 行定义.

◆ xc_ble_set_ral_list()

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 cleared
and replaced by the indicated content.
If number of addresses to be added in the list is greater than list size, a GAP_ERR_INSUFF_RESOURCES status
is returned in the GAPM_CMP_EVT message.
A device can be present only once in the list. If not the case a GAP_ERR_INVALID_PARAM status is returned.

注解
GAPM_CMP_EVT: When operation has been completed, operation is GAPM_SET_RAL.
This will overwrite the current resolving list.
参数
[in]sizeNumber of entries to be added in the list. 0 means that list content has to be cleared.
[in]ral_infoPointer to list of entries to be added in the list.

在文件 xc_gap_api.c113 行定义.

◆ xc_ble_set_rx_pkt_size()

void xc_ble_set_rx_pkt_size ( int  conidx,
uint16_t  rx_octets,
uint16_t  rx_time 
)

在文件 xc_gap_api.c444 行定义.

◆ xc_ble_set_scan_rsp_data()

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
activity identifier.

注解
If the provided identifier appears not to identify an existing advertising activity, GAPM_CMP_EVT message
will be returned with a GAP_ERR_INVALID_PARAM status.
GAPM_CMP_EVT: When operation completed, operation is GAPM_SET_SCAN_RSP_DATA.
参数
[in]actv_idxActivity identifier
[in]scan_rsp_data_lengthScan response data length
[in]p_scan_rsp_dataPointer to scan response data.

在文件 xc_gap_api.c167 行定义.

◆ xc_ble_set_white_list()

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 cleared
and replaced by the indicated content.
If number of addresses to be added in the list is greater than list size, a GAP_ERR_INSUFF_RESOURCES status
is returned in the GAPM_CMP_EVT message.
A device can be present only once in the list. If not the case a GAP_ERR_INVALID_PARAM status is returned.

注解
GAPM_CMP_EVT: When operation has been completed, operation is GAPM_SET_WL.
This will overwrite the current white list.
参数
[in]sizeNumber of entries to be added in the list. 0 means that list content has to be cleared.
[in]wl_infoPointer to list of entries to be added in the list.

在文件 xc_gap_api.c126 行定义.

◆ xc_ble_update_param()

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

注解
GAPC_PARAM_UPDATED_IND: event triggered if connection parameters are updated.
GAPC_CMP_EVT: When operation completed, operation is GAPC_UPDATE_PARAMS.
: Can be used by both master and slave
参数
[in]conidxConnection index
[in]p_conn_paramPointer to update parameters structure.

在文件 xc_gap_api.c288 行定义.