Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
Functions

Detailed Description

Functions

ble_status_t R_BLE_GAP_Init (ble_gap_app_cb_t gap_cb)
 Host stack is initialized with this function. Before using All the R_BLE APIs, it's necessary to call this function.
A callback function is registered with this function. In order to receive the GAP event, it's necessary to register a callback function.
The result of this API call is notified in BLE_GAP_EVENT_STACK_ON event. More...
 
ble_status_t R_BLE_GAP_Terminate (void)
 Host stack is terminated with this function.
In order to reset all the Bluetooth functions, it's necessary to call this function.
The result of this API call is notified in BLE_GAP_EVENT_STACK_OFF event. More...
 
ble_status_t R_BLE_GAP_UpdConn (uint16_t conn_hdl, uint8_t mode, uint16_t accept, st_ble_gap_conn_param_t *p_conn_updt_param)
 This function updates the connection parameters or replies a request for updating connection parameters notified by BLE_GAP_EVENT_CONN_PARAM_UPD_REQ event.
When the connection parameters has been updated, BLE_GAP_EVENT_CONN_PARAM_UPD_COMP event is notified to the application layer.
This function sends the following request or response packet depending on the role(master/slave) and the remote device Connection Parameters Request Procedure feature.
. More...
 
ble_status_t R_BLE_GAP_SetDataLen (uint16_t conn_hdl, uint16_t tx_octets, uint16_t tx_time)
 This function requests for changing the maximum transmission packet size and the maximum packet transmission time.
When Controller has received the request from host stack, BLE_GAP_EVENT_SET_DATA_LEN_COMP event is notified to the application layer.
When the transmission packet size or the transmission time has been changed, BLE_GAP_EVENT_DATA_LEN_CHG event is notified to the application layer. More...
 
ble_status_t R_BLE_GAP_Disconnect (uint16_t conn_hdl, uint8_t reason)
 This function disconnects a link.
When the link has disconnected, BLE_GAP_EVENT_DISCONN_IND event is notified to the application layer. More...
 
ble_status_t R_BLE_GAP_SetPhy (uint16_t conn_hdl, st_ble_gap_set_phy_param_t *p_phy_param)
 This function sets the PHY preferences for the connection.
The result of this API call is notified in BLE_GAP_EVENT_PHY_SET_COMP event.
When the PHY has been updated, BLE_GAP_EVENT_PHY_UPD event is notified to the application layer. More...
 
ble_status_t R_BLE_GAP_SetDefPhy (st_ble_gap_set_def_phy_param_t *p_def_phy_param)
 This function sets the PHY preferences which a remote device may change.
The result of this API call is notified in BLE_GAP_EVENT_DEF_PHY_SET_COMP event. More...
 
ble_status_t R_BLE_GAP_SetPrivMode (st_ble_dev_addr_t *p_addr, uint8_t *p_privacy_mode, uint8_t device_num)
 This function sets privacy mode for the remote device registered in Resolving List.
By default, Network Privacy Mode is set.
The result of this API call is notified in BLE_GAP_EVENT_PRIV_MODE_SET_COMP event. More...
 
ble_status_t R_BLE_GAP_ConfWhiteList (uint8_t op_code, st_ble_dev_addr_t *p_addr, uint8_t device_num)
 This function supports the following operations regarding White List. More...
 
ble_status_t R_BLE_GAP_GetVerInfo (void)
 This function gets the version information of local device.
The result of this API call is notified in BLE_GAP_EVENT_LOC_VER_INFO event. More...
 
ble_status_t R_BLE_GAP_ReadPhy (uint16_t conn_hdl)
 This function gets the PHY settings for the connection.
The result of this API call is notified in BLE_GAP_EVENT_PHY_RD_COMP event. More...
 
ble_status_t R_BLE_GAP_ConfRslvList (uint8_t op_code, st_ble_dev_addr_t *p_addr, st_ble_gap_rslv_list_key_set_t *p_peer_irk, uint8_t device_num)
 This function supports the following operations regarding Resolving List. More...
 
ble_status_t R_BLE_GAP_EnableRpa (uint8_t enable)
 This function enables or disables RPA functionality. The RPA functionality includes the following. More...
 
ble_status_t R_BLE_GAP_SetRpaTo (uint16_t rpa_timeout)
 This function sets the time interval to update the resolvable private address.
The result of this API call is notified in BLE_GAP_EVENT_SET_RPA_TO_COMP event. More...
 
ble_status_t R_BLE_GAP_ReadRpa (st_ble_dev_addr_t *p_addr)
 This function gets the local resolvable private address.
Before getting the address, enable the resolvable private address function by R_BLE_GAP_EnableRpa().
The result of this API call is notified in BLE_GAP_EVENT_RD_RPA_COMP event. More...
 
ble_status_t R_BLE_GAP_ReadRssi (uint16_t conn_hdl)
 This function gets RSSI.
The result of this API call is notified in BLE_GAP_EVENT_RSSI_RD_COMP event. More...
 
ble_status_t R_BLE_GAP_ReadChMap (uint16_t conn_hdl)
 This function gets the channel map.
The result of this API call is notified in BLE_GAP_EVENT_CH_MAP_RD_COMP event. More...
 
ble_status_t R_BLE_GAP_SetRandAddr (uint8_t *p_random_addr)
 This function sets static address or non-resolvable private address to the device.
Refer to Core Specification Vol 6, PartB, "1.3.2 Random Device Address" regarding the format of the random address.
Resolvable private address cannot set by this API.
The result of this API call is notified in BLE_GAP_EVENT_RAND_ADDR_SET_COMP event. More...
 
ble_status_t R_BLE_GAP_SetAdvParam (st_ble_gap_adv_param_t *p_adv_param)
 This function sets advertising parameters. It's possible to do advertising where the advertising parameters are different every each advertising set. Each advertising set is identified with advertising handle (0x00-0x03). The number of advertising set in the Controller is defined as BLE_MAX_NO_OF_ADV_SETS_SUPPORTED. Create an advertising set with this function before start advertising, setting periodic advertising parameters, start periodic advertising, setting advertising data/scan response data/periodic advertising data. More...
 
ble_status_t R_BLE_GAP_SetAdvSresData (st_ble_gap_adv_data_t *p_adv_srsp_data)
 This function sets advertising data/scan response data/periodic advertising data to the advertising set. It is necessary to create an advertising set by R_BLE_GAP_SetAdvParam(), before calling this function. Set advertising data/scan response data/periodic advertising data, after allocating the memory for the data. More...
 
ble_status_t R_BLE_GAP_StartAdv (uint8_t adv_hdl, uint16_t duration, uint8_t max_extd_adv_evts)
 This function starts advertising.
Create the advertising set specified with adv_hdl by R_BLE_GAP_SetAdvParam(), before calling this function.
The result of this API call is notified in BLE_GAP_EVENT_ADV_ON event.
. More...
 
ble_status_t R_BLE_GAP_StopAdv (uint8_t adv_hdl)
 This function stops advertising.
The result of this API call is notified in BLE_GAP_EVENT_ADV_OFF event.
. More...
 
ble_status_t R_BLE_GAP_SetPerdAdvParam (st_ble_gap_perd_adv_param_t *p_perd_adv_param)
 This function sets periodic advertising parameters.
Create the advertising set which supports Non-Connectable, Non-Scannable advertising by R_BLE_GAP_SetAdvParam() before setting periodic advertising parameters.
The result of this API call is notified in BLE_GAP_EVENT_PERD_ADV_PARAM_SET_COMP event. More...
 
ble_status_t R_BLE_GAP_StartPerdAdv (uint8_t adv_hdl)
 This function starts periodic advertising.
Set periodic advertising parameters to the advertising set, before starting periodic advertising.
The result of this API call is notified in BLE_GAP_EVENT_PERD_ADV_ON event. More...
 
ble_status_t R_BLE_GAP_StopPerdAdv (uint8_t adv_hdl)
 This function stops periodic advertising.
If the return value of this API is BLE_SUCCESS, the result is notified in BLE_GAP_EVENT_PERD_ADV_OFF event. More...
 
ble_status_t R_BLE_GAP_GetRemainAdvBufSize (uint16_t *p_remain_adv_data_size, uint16_t *p_remain_perd_adv_data_size)
 This function gets the total size of advertising data/scan response data/periodic advertising data which can be currently set to Controller(all of the advertising sets).
The application layer gets the data sizes via the parameters.
By this API function call, no events occur. More...
 
ble_status_t R_BLE_GAP_RemoveAdvSet (uint8_t op_code, uint8_t adv_hdl)
 This function deletes an advertising set or deletes all the advertising sets.
The result of this API call is notified in BLE_GAP_EVENT_ADV_SET_REMOVE_COMP event. More...
 
ble_status_t R_BLE_GAP_CreateConn (st_ble_gap_create_conn_param_t *p_param)
 This function sends a connection request to a remote device to create a link.
When Controller has received a request for establishment of a link from host stack, BLE_GAP_EVENT_CREATE_CONN_COMP event is notified to the application layer.
When the link is established, BLE_GAP_EVENT_CONN_IND event is notified to the application layer. More...
 
ble_status_t R_BLE_GAP_CancelCreateConn (void)
 This function cancels a request for establishing a link.
When Controller has received the cancel request from host stack, BLE_GAP_EVENT_CONN_CANCEL_COMP event is notified to the application layer. When the cancel procedure has completed, BLE_GAP_EVENT_CONN_IND event is notified to the application layer. More...
 
ble_status_t R_BLE_GAP_SetChMap (uint8_t *p_channel_map)
 This function sets the channel map.
The result of this API call is notified in BLE_GAP_EVENT_CH_MAP_SET_COMP event. More...
 
ble_status_t R_BLE_GAP_StartScan (st_ble_gap_scan_param_t *p_scan_param, st_ble_gap_scan_on_t *p_scan_enable)
 This function starts scanning.
When scanning for the first time, set the p_scan_param.
Setting scan parameters can be omitted by specifying p_scan_param as NULL after next time.
The result of this API call is notified in BLE_GAP_EVENT_SCAN_ON event.
Advertising report is notified in BLE_GAP_EVENT_ADV_REPT_IND event.
The following figures show the relationship between scan period, scan duration, scan interval and scan window. More...
 
ble_status_t R_BLE_GAP_StopScan (void)
 This function stops scanning.
The result of this API call is notified in BLE_GAP_EVENT_SCAN_OFF event. More...
 
ble_status_t R_BLE_GAP_CreateSync (st_ble_dev_addr_t *p_addr, uint8_t adv_sid, uint16_t skip, uint16_t sync_to)
 This function sends a request for establishment of a periodic sync to a advertiser.
In order to create a periodic sync, scan needs to be starting by R_BLE_GAP_StartScan().
When Controller has received the request from host stack, BLE_GAP_EVENT_CREATE_SYNC_COMP event is notified to the application layer.
When the periodic sync is established, BLE_GAP_EVENT_SYNC_EST event is notified to the application layer. More...
 
ble_status_t R_BLE_GAP_CancelCreateSync (void)
 This function cancels a request for establishing a periodic sync.
The result of this API call is notified in BLE_GAP_EVENT_SYNC_CREATE_CANCEL_COMP event. More...
 
ble_status_t R_BLE_GAP_TerminateSync (uint16_t sync_hdl)
 This function terminates a periodic sync.
The result of this API call is notified in BLE_GAP_EVENT_SYNC_TERM event. More...
 
ble_status_t R_BLE_GAP_ConfPerdAdvList (uint8_t op_code, st_ble_dev_addr_t *p_addr, uint8_t *p_adv_sid_set, uint8_t device_num)
 This function supports the following operations regarding Periodic Advertiser List. More...
 
ble_status_t R_BLE_GAP_AuthorizeDev (uint16_t conn_hdl, uint8_t author_flag)
 User authorizes a remote device by this function.
This function is used when a remote device accesses a GATT Characteristic in local device which requests user authorization.
The result of this API call is returned by a return value. More...
 
ble_status_t R_BLE_GAP_GetRemDevInfo (uint16_t conn_hdl)
 This function gets information about the remote device.
The information includes BD_ADDR, the version number and LE features.
The result of this API call is notified in BLE_GAP_EVENT_GET_REM_DEV_INFO event. More...
 
ble_status_t R_BLE_GAP_SetPairingParams (st_ble_gap_pairing_param_t *p_pair_param)
 This function sets the parameters used in pairing.
The parameters set by this API are sent to the remote device when pairing occurred.
The result of this API call is returned by a return value.
. More...
 
ble_status_t R_BLE_GAP_SetLocIdInfo (st_ble_dev_addr_t *p_lc_id_addr, uint8_t *p_lc_irk)
 This function registers local IRK and identity address of local device in host stack.
The IRK and the identity address are distributed to a remote device in pairing.
The result of this API call is returned by a return value. More...
 
ble_status_t R_BLE_GAP_SetLocCsrk (uint8_t *p_local_csrk)
 This function registers local CSRK in host stack.
The CSRK is distributed to a remote device in pairing.
The result of this API call is returned by a return value. More...
 
ble_status_t R_BLE_GAP_StartPairing (uint16_t conn_hdl)
 This function starts pairing with a remote device.
The result of this API call is returned by a return value.
The result of pairing is notified in BLE_GAP_EVENT_PAIRING_COMP event. More...
 
ble_status_t R_BLE_GAP_ReplyPairing (uint16_t conn_hdl, uint8_t response)
 This function replies to the pairing request from the remote device.
The pairing request from the remote device is notified in BLE_GAP_EVENT_PAIRING_REQ event.
The result of this API call is returned by a return value.
The result of pairing is notified in BLE_GAP_EVENT_PAIRING_COMP event. More...
 
ble_status_t R_BLE_GAP_StartEnc (uint16_t conn_hdl)
 This function starts encryption of the link.
In case of master device, the local device requests for the encryption to a remote device.
In case of slave device, the local device sends a Security Request to a remote device.
After receiving the Security Request, the remote device requests for the encryption to the local device.
The result of the encryption is returned in BLE_GAP_EVENT_ENC_CHG event. More...
 
ble_status_t R_BLE_GAP_ReplyPasskeyEntry (uint16_t conn_hdl, uint32_t passkey, uint8_t response)
 When BLE_GAP_EVENT_PASSKEY_ENTRY_REQ event is notified, the response to passkey entry is sent by this function.
The result of this API call is returned by a return value. More...
 
ble_status_t R_BLE_GAP_ReplyNumComp (uint16_t conn_hdl, uint8_t response)
 When BLE_GAP_EVENT_NUM_COMP_REQ event is notified, the response to Numeric Comparison is sent by this function.
The result of this API call is returned by a return value. More...
 
ble_status_t R_BLE_GAP_NotifyKeyPress (uint16_t conn_hdl, uint8_t key_press)
 This function notifies the input key type to the remote device in passkey entry.
The result is returned from this API. More...
 
ble_status_t R_BLE_GAP_GetDevSecInfo (uint16_t conn_hdl, st_ble_gap_auth_info_t *p_sec_info)
 This function gets the parameters which has been negotiated with the remote device in pairing.
The parameters can be acquired after pairing.
The result is returned by p_sec_info. More...
 
ble_status_t R_BLE_GAP_ReplyExKeyInfoReq (uint16_t conn_hdl)
 When key exchange request is notified by BLE_GAP_EVENT_EX_KEY_REQ event at pairing, keys of the local device are distributed.
The result is returned from this API. More...
 
ble_status_t R_BLE_GAP_MarkDevUntructed (st_ble_dev_addr_t *p_addr)
 Delete the bonding information about the remote device from security database. More...
 
ble_status_t R_BLE_GAP_SetRemOobData (st_ble_dev_addr_t *p_addr, uint8_t oob_data_flag, st_ble_gap_oob_data_t *p_oob)
 This function registers the OOB data received from a remote device.
When oob_data_flag indicates that the OOB data has been received, the setting regarding OOB data is reflected in pairing.
In order to do OOB pairing, set the OOB data received from the remote device before pairing.
The result is returned from this API. More...
 
ble_status_t R_BLE_GAP_CreateScOobData (void)
 This function generates the OOB data distributed to a remote device in Secure Connections. The result of this API call is notified in BLE_GAP_EVENT_SC_OOB_CREATE_COMP event. More...
 
ble_status_t R_BLE_GAP_SetBondInfo (st_ble_gap_bond_info_t *p_bond_info, uint8_t device_num, uint8_t *p_set_num)
 Set the bonding information of the remote device in the host stack.
After power re-supply, when the remote device bonding information stored in non-volatile memory is set to host stack, this function is used.
Host stack can be set the number specified by the device_num parameter of bonding information. More...
 
void R_BLE_GAP_DeleteBondInfo (int32_t local, int32_t remote, st_ble_dev_addr_t *p_addr, ble_gap_del_bond_cb_t gap_del_bond_cb)
 This function deletes the bonding information in Host Stack.
When a function for deleting the bonding information stored in non-volatile area is registered by the gap_del_bond_cb parameter, it is deleted as well as the bonding information in Host Stack. More...
 
ble_status_t R_BLE_GAP_ReplyLtkReq (uint16_t conn_hdl, uint16_t ediv, uint8_t *p_peer_rand, uint8_t response)
 This function replies to the LTK request in BLE_GAP_EVENT_LTK_REQ event from a remote device.
The result of the LTK reply is returned in BLE_GAP_EVENT_LTK_RSP_COMP event.
When the link encryption has completed, BLE_GAP_EVENT_ENC_CHG event is notified.
. More...
 

Function Documentation

◆ R_BLE_GAP_Init()

ble_status_t R_BLE_GAP_Init ( ble_gap_app_cb_t  gap_cb)

Host stack is initialized with this function. Before using All the R_BLE APIs, it's necessary to call this function.
A callback function is registered with this function. In order to receive the GAP event, it's necessary to register a callback function.
The result of this API call is notified in BLE_GAP_EVENT_STACK_ON event.

Parameters
[in]gap_cbA callback function registered with this function.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)gap_cb is specified as NULL.
BLE_ERR_INVALID_STATE(0x0008)The reason for this error is as follows:
  • Host Stack was already initialized.
  • The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_Terminate()

ble_status_t R_BLE_GAP_Terminate ( void  )

Host stack is terminated with this function.
In order to reset all the Bluetooth functions, it's necessary to call this function.
The result of this API call is notified in BLE_GAP_EVENT_STACK_OFF event.

Parameters
void
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_STATE(0x0008)Host stack hasn't been initialized.

Events

Support library type

◆ R_BLE_GAP_UpdConn()

ble_status_t R_BLE_GAP_UpdConn ( uint16_t  conn_hdl,
uint8_t  mode,
uint16_t  accept,
st_ble_gap_conn_param_t p_conn_updt_param 
)

This function updates the connection parameters or replies a request for updating connection parameters notified by BLE_GAP_EVENT_CONN_PARAM_UPD_REQ event.
When the connection parameters has been updated, BLE_GAP_EVENT_CONN_PARAM_UPD_COMP event is notified to the application layer.
This function sends the following request or response packet depending on the role(master/slave) and the remote device Connection Parameters Request Procedure feature.
.

Request or Response Local device role Remote device Connection Parameters Request Procedure feature
Support Not Support
Request master LL_CONNECTION_PARAM_REQ LL_CONECTION_UPDATE_IND
slave L2CAP CONNECTION PARAMETER UPDATE REQUEST
Response master LL_CONECTION_UPDATE_IND L2CAP CONNECTION PARAMETER UPDATE RESPONSE
slave LL_CONNECTION_PARAM_RSP -
Parameters
[in]conn_hdlConnection handle identifying the link to be updated.

[in]modeConnection parameter update request or response.
macro description
BLE_GAP_CONN_UPD_MODE_REQ (0x01) Request for updating the connection parameters.
BLE_GAP_CONN_UPD_MODE_RSP (0x02) Reply a connection parameter update request.


[in]acceptWhen mode is BLE_GAP_CONN_UPD_MODE_RSP, accept or reject the connection parameters update request.
If mode is BLE_GAP_CONN_UPD_MODE_REQ, accept is ignored.
macro description
BLE_GAP_CONN_UPD_ACCEPT (0x0000) Accept the update request.
BLE_GAP_CONN_UPD_REJECT (0x0001) Reject the update request.


[in]p_conn_updt_paramConnection parameters to be updated.
When mode is BLE_GAP_CONN_UPD_MODE_RSP and accept is BLE_GAP_CONN_UPD_REJECT, p_conn_updt_param is ignored.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)When accept is BLE_GAP_CONN_UPD_ACCEPT, p_conn_updt_param is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)One of the following is out of range.
  • mode
  • accept
  • conn_intv_min field in p_conn_updt_param
  • conn_intv_max field in p_conn_updt_param
  • conn_latency in p_conn_updt_param
  • sup_to in p_conn_updt_param
  • conn_hdl
BLE_ERR_INVALID_STATE(0x0008)Not connected with the remote device.
BLE_ERR_CONTEXT_FULL(0x000B)Sending a L2CAP command, an error occurred.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_SetDataLen()

ble_status_t R_BLE_GAP_SetDataLen ( uint16_t  conn_hdl,
uint16_t  tx_octets,
uint16_t  tx_time 
)

This function requests for changing the maximum transmission packet size and the maximum packet transmission time.
When Controller has received the request from host stack, BLE_GAP_EVENT_SET_DATA_LEN_COMP event is notified to the application layer.
When the transmission packet size or the transmission time has been changed, BLE_GAP_EVENT_DATA_LEN_CHG event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the link whose the transmission packet size or the transmission time to be changed.

[in]tx_octetsMaximum transmission packet size.
Valid range is 0x001B - 0x00FB.

[in]tx_timeMaximum transmission time(us).
Valid range is 0x0148 - 0x4290.

Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_Disconnect()

ble_status_t R_BLE_GAP_Disconnect ( uint16_t  conn_hdl,
uint8_t  reason 
)

This function disconnects a link.
When the link has disconnected, BLE_GAP_EVENT_DISCONN_IND event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the link to be disconnected.

[in]reasonThe reason for disconnection.
Usually, set 0x13 which indicates that a user disconnects the link.
If setting other than 0x13, refer the error code described in Core Specification Vol.2 Part D ,"2 Error Code Descriptions".
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)conn_hdl is out of range.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_SetPhy()

ble_status_t R_BLE_GAP_SetPhy ( uint16_t  conn_hdl,
st_ble_gap_set_phy_param_t p_phy_param 
)

This function sets the PHY preferences for the connection.
The result of this API call is notified in BLE_GAP_EVENT_PHY_SET_COMP event.
When the PHY has been updated, BLE_GAP_EVENT_PHY_UPD event is notified to the application layer.

After PHY update, the PHY accept configuration of local device is the same as the values in BLE_GAP_EVENT_PHY_UPD event.
For example, after calling R_BLE_GAP_SetPhy(), if tx_phy, rx_phy by BLE_GAP_EVENT_PHY_UPD event are updated to 2M PHY, the PHY accept configuration is 2M PHY only.
Therefore after receiving BLE_GAP_EVENT_PHY_UPD event, if local device wants to accept the other PHY configuration, it needs to call R_BLE_GAP_SetPhy() with the desired PHY accept configuration.

Because the maximum transmission packet size or the maximum transmission time might be updated by PHY update, if the same packet size or transmission time as the previous one is desired, change the maximum transmission packet size or the maximum transmission time by R_BLE_GAP_SetDataLen().

Parameters
[in]conn_hdlConnection handle identifying the link whose PHY to be updated.

[in]p_phy_paramPHY preferences.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_phy_param is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)conn_hdl or option field in p_phy_param is out of range.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_SetDefPhy()

ble_status_t R_BLE_GAP_SetDefPhy ( st_ble_gap_set_def_phy_param_t p_def_phy_param)

This function sets the PHY preferences which a remote device may change.
The result of this API call is notified in BLE_GAP_EVENT_DEF_PHY_SET_COMP event.

Parameters
[in]p_def_phy_paramThe PHY preference which a remote device may change.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_def_phy_param is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)tx_phys or tx_phys field in p_def_phy_param is out of range.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

◆ R_BLE_GAP_SetPrivMode()

ble_status_t R_BLE_GAP_SetPrivMode ( st_ble_dev_addr_t p_addr,
uint8_t *  p_privacy_mode,
uint8_t  device_num 
)

This function sets privacy mode for the remote device registered in Resolving List.
By default, Network Privacy Mode is set.
The result of this API call is notified in BLE_GAP_EVENT_PRIV_MODE_SET_COMP event.

Parameters
[in]p_addrAn array of identity address of the remote device to set privacy mode.
The number of elements is specified by device_num.

[in]p_privacy_modeAn array of privacy mode to set to remote device.
The number of elements is specified by device_num.
The following value is set as the privacy mode.
macro description
BLE_GAP_NET_PRIV_MODE (0x00) Network Privacy Mode.
BLE_GAP_DEV_PRIV_MODE (0x01) Device Privacy Mode.


[in]device_numThe number of devices to set privacy mode.
Valid range is 1 - BLE_GAP_RSLV_LIST_MAX_ENTRY.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_addr or p_privacy_mode is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The following parameter is out of range.
  • The address type in p_addr.
  • The privacy mode specified by p_privacy_mode.
  • device_num
BLE_ERR_INVALID_STATE(0x0008)The reason for this error is as follows:
  • While configuring privacy mode, this function was called.
  • The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_ConfWhiteList()

ble_status_t R_BLE_GAP_ConfWhiteList ( uint8_t  op_code,
st_ble_dev_addr_t p_addr,
uint8_t  device_num 
)

This function supports the following operations regarding White List.

Parameters
[in]op_codeThe operation for White List.
macro description
BLE_GAP_LIST_ADD_DEV(0x01) Add the device to the list.
BLE_GAP_LIST_REM_DEV(0x02) Delete the device from the list.
BLE_GAP_LIST_CLR(0x03) Clear the list.


[in]p_addrAn array of device address to add / delete to the list.
The number of elements is specified by device_num.
If op_code is BLE_GAP_LIST_CLR, p_addr is ignored.

[in]device_numThe number of devices add / delete to the list.
Valid range is 1 - BLE_GAP_WHITE_LIST_MAX_ENTRY.
If op_code is BLE_GAP_LIST_CLR, device_num is ignored.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)When op_code is BLE_GAP_LIST_ADD_DEV or BLE_GAP_LIST_REM_DEV, p_addr is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)op_code or address type field in p_addr is out of range.
BLE_ERR_INVALID_STATE(0x0008)The reason for this error is as follows:
  • While operating White List, this function was called.
  • The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)There are no memories for operating the White List.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_GetVerInfo()

ble_status_t R_BLE_GAP_GetVerInfo ( void  )

This function gets the version information of local device.
The result of this API call is notified in BLE_GAP_EVENT_LOC_VER_INFO event.

Parameters
void
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

◆ R_BLE_GAP_ReadPhy()

ble_status_t R_BLE_GAP_ReadPhy ( uint16_t  conn_hdl)

This function gets the PHY settings for the connection.
The result of this API call is notified in BLE_GAP_EVENT_PHY_RD_COMP event.

Parameters
[in]conn_hdlConnection handle identifying the link whose PHY settings to be acquired.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)conn_hdl is out of range.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

◆ R_BLE_GAP_ConfRslvList()

ble_status_t R_BLE_GAP_ConfRslvList ( uint8_t  op_code,
st_ble_dev_addr_t p_addr,
st_ble_gap_rslv_list_key_set_t p_peer_irk,
uint8_t  device_num 
)

This function supports the following operations regarding Resolving List.

  • Add the device to Resolving List.
  • Delete the device from Resolving List.
  • Clear Resolving List.

    In order to generate a resolvable private address, a local IRK needs to be registered by R_BLE_GAP_SetLocIdInfo().
    If communicating with the identity address, register all-zero IRK as local IRK.
    In order to resolve resolvable private address of the remote device, the IRK distributed from the remote device needs to be added to Resolving List.

    The total number of Resolving List entries is defined as BLE_GAP_RSLV_LIST_MAX_ENTRY.
    The result of this API call is notified in BLE_GAP_EVENT_RSLV_LIST_CONF_COMP event.

Parameters
[in]op_codeThe operation for Resolving List.
macro description
BLE_GAP_LIST_ADD_DEV(0x01) Add the device to the list.
BLE_GAP_LIST_REM_DEV(0x02) Delete the device from the list.
BLE_GAP_LIST_CLR(0x03) Clear the list.


[in]p_addrAn array of Identity Addresses to add / delete to the list.
The number of elements is specified by device_num.
If op_code is BLE_GAP_LIST_CLR, p_addr is ignored.

[in]p_peer_irkThe remote IRK and the type of local IRK added to Resolving List.
If op_code is other than BLE_GAP_LIST_ADD_DEV, p_peer_irk is ignored.
The number of elements is specified by device_num.

[in]device_numThe number of devices add / delete to the list.
Valid range is 1 - BLE_GAP_RSLV_LIST_MAX_ENTRY.
If op_code is BLE_GAP_LIST_CLR, device_num is ignored.

Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows:
  • When added to or deleted from the list, p_addr is specified as NULL.
  • When added to the list, p_peer_irk is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The reason for this error is as follows:
BLE_ERR_INVALID_STATE(0x0008)The reason for this error is as follows:
  • While operating Resolving List, this function was called.
  • The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)There are no memories for operating the Resolving List.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_EnableRpa()

ble_status_t R_BLE_GAP_EnableRpa ( uint8_t  enable)

This function enables or disables RPA functionality. The RPA functionality includes the following.

  • Generation of local resolvable private address
  • Resolution of remote resolvable private address

In order to do advertising, scanning or creating a link with local resolvable private address, the RPA functionality needs to be enabled.
After enabling the RPA functionality and the identity address of remote device and the IRKs of local/remote device is registered, local device can generate own resolvable private address in the time interval set by R_BLE_GAP_SetRpaTo(), and can resolve a resolvable private address of a remote device.

It is recommended that the RPA functionality is called immediately after the initialization by R_BLE_GAP_Init().
The result of this API call is notified in BLE_GAP_EVENT_RPA_EN_COMP event.

Parameters
[in]enableEnable or disable address resolution function.
macro description
BLE_GAP_RPA_DISABLED(0x00) Disable RPA generation/resolution.
BLE_GAP_RPA_ENABLED(0x01) Enable RPA generation/resolution.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)enable is out of range.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_SetRpaTo()

ble_status_t R_BLE_GAP_SetRpaTo ( uint16_t  rpa_timeout)

This function sets the time interval to update the resolvable private address.
The result of this API call is notified in BLE_GAP_EVENT_SET_RPA_TO_COMP event.

Parameters
[in]rpa_timeoutTime interval to update resolvable private address in seconds. Valid range is 0x003C - 0xA1B8. Default is 900s.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_ReadRpa()

ble_status_t R_BLE_GAP_ReadRpa ( st_ble_dev_addr_t p_addr)

This function gets the local resolvable private address.
Before getting the address, enable the resolvable private address function by R_BLE_GAP_EnableRpa().
The result of this API call is notified in BLE_GAP_EVENT_RD_RPA_COMP event.

Parameters
[in]p_addrIdentity address registered in Resolving List.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_addr is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)Address type in p_addr is out of range.
BLE_ERR_INVALID_STATE(0x0008)The reason for this error is as follows.
  • When retrieving the local resolvable private address, this function was called.
  • The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

◆ R_BLE_GAP_ReadRssi()

ble_status_t R_BLE_GAP_ReadRssi ( uint16_t  conn_hdl)

This function gets RSSI.
The result of this API call is notified in BLE_GAP_EVENT_RSSI_RD_COMP event.

Parameters
[in]conn_hdlConnection handle identifying the link whose RSSI to be acquired.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)conn_hdl is out of range.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

◆ R_BLE_GAP_ReadChMap()

ble_status_t R_BLE_GAP_ReadChMap ( uint16_t  conn_hdl)

This function gets the channel map.
The result of this API call is notified in BLE_GAP_EVENT_CH_MAP_RD_COMP event.

Parameters
[in]conn_hdlConnection handle identifying the link whose channel map to be acquired.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)conn_hdl is out of range.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

◆ R_BLE_GAP_SetRandAddr()

ble_status_t R_BLE_GAP_SetRandAddr ( uint8_t *  p_random_addr)

This function sets static address or non-resolvable private address to the device.
Refer to Core Specification Vol 6, PartB, "1.3.2 Random Device Address" regarding the format of the random address.
Resolvable private address cannot set by this API.
The result of this API call is notified in BLE_GAP_EVENT_RAND_ADDR_SET_COMP event.

Parameters
[in]p_random_addrStatic address or non-resolvable private address.
The BD address setting format is little endian.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_random_addr is specified as NULL.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

◆ R_BLE_GAP_SetAdvParam()

ble_status_t R_BLE_GAP_SetAdvParam ( st_ble_gap_adv_param_t p_adv_param)

This function sets advertising parameters. It's possible to do advertising where the advertising parameters are different every each advertising set. Each advertising set is identified with advertising handle (0x00-0x03). The number of advertising set in the Controller is defined as BLE_MAX_NO_OF_ADV_SETS_SUPPORTED. Create an advertising set with this function before start advertising, setting periodic advertising parameters, start periodic advertising, setting advertising data/scan response data/periodic advertising data.

The result of this API call is notified in BLE_GAP_EVENT_ADV_PARAM_SET_COMP event.

Parameters
[in]p_adv_paramAdvertising parameters.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_adv_param is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The below p_adv_param field value is out of range.
  • adv_handle
  • adv_intv_min/adv_intv_max
  • adv_ch_map
  • o_addr_type
  • p_addr_type
  • adv_phy
  • sec_adv_phy
  • scan_req_ntf_flag
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_SetAdvSresData()

ble_status_t R_BLE_GAP_SetAdvSresData ( st_ble_gap_adv_data_t p_adv_srsp_data)

This function sets advertising data/scan response data/periodic advertising data to the advertising set. It is necessary to create an advertising set by R_BLE_GAP_SetAdvParam(), before calling this function. Set advertising data/scan response data/periodic advertising data, after allocating the memory for the data.

The following shall be applied regarding the adv_prop_type field and the data_type field in st_ble_gap_adv_param_t parameter specified in R_BLE_GAP_SetAdvParam().

  • When adv_prop_type is Legacy Advertising PDU type,
    • it's possible to set advertising data/scan response data up to 31 bytes.
    • advertising data/scan response data can be updated by this function in advertising.
  • When adv_prop_type is Extended Advertising PDU type,
    • it's possible to set at most 1650 bytes of data as advertising data/scan response data per 1 advertising set.
    • the total buffer size in Controller for advertising data/scan response data is 4250 bytes. Therefore please note that more than 4250 bytes of advertising data/scan response data can not be set to all the advertising sets. Please refer to Figure 1.1 and Figure 1.2 about examples of setting advertising data/scan response data.
    • it's possible to update advertising data/scan response data in advertising, if the data_length field in st_ble_gap_adv_data_t parameter is up to 251 bytes.
      adv_data_alloc_fail_en.svg
      Figure 1.1
      adv_data_alloc_success_en.svg
      Figure 1.2
  • When periodic advertising data is set,
    • At most 1650 bytes of data can be set to 1 advertising set.
    • The total buffer size in Controller for periodic advertising data is 4306 bytes. Therefore please note that more than 4306 bytes of periodic advertising data can not be set to all the advertising sets.
    • it's possible to update periodic advertising data in advertising, if the data_length field in st_ble_gap_adv_data_t parameter is up to 252 bytes.

The result of this API call is notified in BLE_GAP_EVENT_ADV_DATA_UPD_COMP event.

Parameters
[in]p_adv_srsp_dataAdvertising data/scan response data/periodic advertising data.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows:
  • p_adv_srsp_data is specified as NULL.
  • data_length field in p_adv_srsp_data parameter is not 0 and p_data field is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The following field in p_adv_srsp_data parameter is out of range.
  • adv_hdl
  • data_type
  • data_length
  • zero_length_flag
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_StartAdv()

ble_status_t R_BLE_GAP_StartAdv ( uint8_t  adv_hdl,
uint16_t  duration,
uint8_t  max_extd_adv_evts 
)

This function starts advertising.
Create the advertising set specified with adv_hdl by R_BLE_GAP_SetAdvParam(), before calling this function.
The result of this API call is notified in BLE_GAP_EVENT_ADV_ON event.
.

Note
If the "Balance" or "Compact" library is used, all the following parameters are ignored.
Parameters
[in]adv_hdlThe advertising handle pointing to the advertising set which starts advertising.
The valid range is 0x00 - 0x03.

[in]durationThe duration for which the advertising set identified by adv_hdl is enabled.
Time = duration * 10ms. When the duration expires, BLE_GAP_EVENT_ADV_OFF event notifies that advertising is stopped.
The valid range is 0x0000 - 0xFFFF.
The duration parameter is ignored when the value is set to 0x0000.

[in]max_extd_adv_evtsThe maximum number of advertising events that be sent during advertising.
When all the advertising events(max_extd_adv_evts) have been sent,
BLE_GAP_EVENT_ADV_OFF event notifies that advertising is stopped.
The max_extd_adv_evts parameter is ignored when the value is set to 0x00.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)adv_hdl is out of range.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_StopAdv()

ble_status_t R_BLE_GAP_StopAdv ( uint8_t  adv_hdl)

This function stops advertising.
The result of this API call is notified in BLE_GAP_EVENT_ADV_OFF event.
.

Note
If the "Balance" or "Compact" library is used, the following parameter is ignored.
Parameters
[in]adv_hdlThe advertising handle pointing to the advertising set which stops advertising.
The valid range is 0x00 - 0x03.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)adv_hdl is out of range.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_SetPerdAdvParam()

ble_status_t R_BLE_GAP_SetPerdAdvParam ( st_ble_gap_perd_adv_param_t p_perd_adv_param)

This function sets periodic advertising parameters.
Create the advertising set which supports Non-Connectable, Non-Scannable advertising by R_BLE_GAP_SetAdvParam() before setting periodic advertising parameters.
The result of this API call is notified in BLE_GAP_EVENT_PERD_ADV_PARAM_SET_COMP event.

Parameters
[in]p_perd_adv_paramPeriodic advertising parameters.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_perd_adv_param is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The following field in the p_perd_adv_param parameter is out of range.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_StartPerdAdv()

ble_status_t R_BLE_GAP_StartPerdAdv ( uint8_t  adv_hdl)

This function starts periodic advertising.
Set periodic advertising parameters to the advertising set, before starting periodic advertising.
The result of this API call is notified in BLE_GAP_EVENT_PERD_ADV_ON event.

Parameters
[in]adv_hdlAdvertising handle identifying the advertising set which starts periodic advertising.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)adv_hdl is out of range.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_StopPerdAdv()

ble_status_t R_BLE_GAP_StopPerdAdv ( uint8_t  adv_hdl)

This function stops periodic advertising.
If the return value of this API is BLE_SUCCESS, the result is notified in BLE_GAP_EVENT_PERD_ADV_OFF event.

Parameters
[in]adv_hdlSpecify the handle of Advertising Set to stop Periodic Advertising.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)adv_hdl is out of range.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_GetRemainAdvBufSize()

ble_status_t R_BLE_GAP_GetRemainAdvBufSize ( uint16_t *  p_remain_adv_data_size,
uint16_t *  p_remain_perd_adv_data_size 
)

This function gets the total size of advertising data/scan response data/periodic advertising data which can be currently set to Controller(all of the advertising sets).
The application layer gets the data sizes via the parameters.
By this API function call, no events occur.

Parameters
[out]p_remain_adv_data_sizeThe free buffer size of Controller to which advertising data/scan response data can be currently set.

[out]p_remain_perd_adv_data_sizeThe free buffer size of Controller to which periodic advertising data can be currently set.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_remain_adv_data_size or p_remain_perd_adv_data_size is specified as NULL.

Events
none

Support library type

◆ R_BLE_GAP_RemoveAdvSet()

ble_status_t R_BLE_GAP_RemoveAdvSet ( uint8_t  op_code,
uint8_t  adv_hdl 
)

This function deletes an advertising set or deletes all the advertising sets.
The result of this API call is notified in BLE_GAP_EVENT_ADV_SET_REMOVE_COMP event.

Parameters
[in]op_codeThe operation for delete or clear.
macro description
BLE_GAP_RMV_ADV_SET_REM_OP(0x01) Delete an advertising set.
BLE_GAP_RMV_ADV_SET_CLR_OP(0x02) Delete all the advertising sets.


[in]adv_hdlAdvertising handle identifying the advertising set deleted.
If op_code is BLE_GAP_RMV_ADV_SET_CLR_OP, adv_hdl is ignored.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)The reason for this error is as follows:
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

◆ R_BLE_GAP_CreateConn()

ble_status_t R_BLE_GAP_CreateConn ( st_ble_gap_create_conn_param_t p_param)

This function sends a connection request to a remote device to create a link.
When Controller has received a request for establishment of a link from host stack, BLE_GAP_EVENT_CREATE_CONN_COMP event is notified to the application layer.
When the link is established, BLE_GAP_EVENT_CONN_IND event is notified to the application layer.

Parameters
[in]p_paramConnection parameters.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows:
  • p_param is specified as NULL.
  • p_conn_param_1M field and p_conn_param_2M and p_conn_param_coded field in p_param are specified as NULL.
  • When creating a link with 1M PHY, p_conn_param in p_conn_param_1M field in p_param is specified as NULL.
  • When creating a link with 2M PHY, p_conn_param in p_conn_param_2M field in p_param is specified as NULL.
  • When creating a link with coded MPHY, p_conn_param in p_conn_param_coded field in p_param is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The reason for this error is as follows:
  • init_filter_policy in p_param is out of range.
  • remote_bd_addr_type field or own_addr_type address field in p_param is out of range.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_CancelCreateConn()

ble_status_t R_BLE_GAP_CancelCreateConn ( void  )

This function cancels a request for establishing a link.
When Controller has received the cancel request from host stack, BLE_GAP_EVENT_CONN_CANCEL_COMP event is notified to the application layer. When the cancel procedure has completed, BLE_GAP_EVENT_CONN_IND event is notified to the application layer.

Parameters
void
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_SetChMap()

ble_status_t R_BLE_GAP_SetChMap ( uint8_t *  p_channel_map)

This function sets the channel map.
The result of this API call is notified in BLE_GAP_EVENT_CH_MAP_SET_COMP event.

Parameters
[in]p_channel_mapChannel map.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_channel_map is specified as NULL.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

◆ R_BLE_GAP_StartScan()

ble_status_t R_BLE_GAP_StartScan ( st_ble_gap_scan_param_t p_scan_param,
st_ble_gap_scan_on_t p_scan_enable 
)

This function starts scanning.
When scanning for the first time, set the p_scan_param.
Setting scan parameters can be omitted by specifying p_scan_param as NULL after next time.
The result of this API call is notified in BLE_GAP_EVENT_SCAN_ON event.
Advertising report is notified in BLE_GAP_EVENT_ADV_REPT_IND event.
The following figures show the relationship between scan period, scan duration, scan interval and scan window.

scan_period_non-zero_duration_non-zero.svg
Figure 1.3 : scan period, scan duration, scan interval, scan window where scan period and scan duration are non-zero.

Scanning continues until R_BLE_GAP_StopScan() is called.

scan_period_0_duration_non-zero.svg
Figure 1.4 : scan period, scan duration, scan interval, scan window where scan duration is zero.

If scan duration is zero, scan period is ignored. Scanning continues until R_BLE_GAP_StopScan() is called.

scan_period_0_duration_0.svg
Figure 1.5 : scan period, scan duration, scan interval, scan window where scan period is zero and scan duration is non-zero.

When scan duration is non-zero, scan period is zero and scan duration expires, BLE_GAP_EVENT_SCAN_TO event is notified to the application layer and scanning stops.

Parameters
[in]p_scan_paramScan parameter.
When p_scan_param is specified as NULL,
host stack doesn't set scan parameters and start scanning with the previous parameters.

[in]p_scan_enableScan period, scan duration, duplicate filter and procedure type.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows:
  • p_scan_enable is specified as NULL.
  • p_phy_param_1M field and p_phy_param_coded field in p_scan_param are specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The reason for this error is as follows:
  • proc_type field in p_scan_enable is out of range.
  • filter_dups in p_scan_enable is out of range.
  • o_addr_type in p_scan_param is out of range.
  • filter_policy in p_scan_param is out of range.
  • scan_type of p_scan_param's p_phy_param_1M or p_phy_param_coded is out of range.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_StopScan()

ble_status_t R_BLE_GAP_StopScan ( void  )

This function stops scanning.
The result of this API call is notified in BLE_GAP_EVENT_SCAN_OFF event.

Parameters
none
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_CreateSync()

ble_status_t R_BLE_GAP_CreateSync ( st_ble_dev_addr_t p_addr,
uint8_t  adv_sid,
uint16_t  skip,
uint16_t  sync_to 
)

This function sends a request for establishment of a periodic sync to a advertiser.
In order to create a periodic sync, scan needs to be starting by R_BLE_GAP_StartScan().
When Controller has received the request from host stack, BLE_GAP_EVENT_CREATE_SYNC_COMP event is notified to the application layer.
When the periodic sync is established, BLE_GAP_EVENT_SYNC_EST event is notified to the application layer.

Parameters
[in]p_addrThe address of periodic advertiser.When p_addr is specified as NULL, local device creates a periodic sync with the advertiser registered in Periodic Advertiser List.

[in]adv_sidAdvertising SID. When p_addr is specified as NULL, adv_sid is ignored.
Valid range is 0x00 - 0x0F.

[in]skipThe number of consecutive periodic advertising packets that local device may skip after receiving a periodic advertising packet.
Valid range is 0x0000 - 0x01F3.

[in]sync_toThe maximum permitted time between successful receives.When sync_to expires, the periodic sync is lost.
Time(ms) = sync_to * 10.
Valid range is 0x000A - 0x4000.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_addr is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The following parameter is out of range.
  • address type in p_addr
  • adv_sid
  • skip
  • sync_to
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_CancelCreateSync()

ble_status_t R_BLE_GAP_CancelCreateSync ( void  )

This function cancels a request for establishing a periodic sync.
The result of this API call is notified in BLE_GAP_EVENT_SYNC_CREATE_CANCEL_COMP event.

Parameters
void
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

◆ R_BLE_GAP_TerminateSync()

ble_status_t R_BLE_GAP_TerminateSync ( uint16_t  sync_hdl)

This function terminates a periodic sync.
The result of this API call is notified in BLE_GAP_EVENT_SYNC_TERM event.

Parameters
[in]sync_hdlSync handle identifying the periodic sync to be terminated.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)sync_hdl is out of range.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_ConfPerdAdvList()

ble_status_t R_BLE_GAP_ConfPerdAdvList ( uint8_t  op_code,
st_ble_dev_addr_t p_addr,
uint8_t *  p_adv_sid_set,
uint8_t  device_num 
)

This function supports the following operations regarding Periodic Advertiser List.

  • Add the device to Periodic Advertiser List.
  • Delete the device from Periodic Advertiser List.
  • Clear Periodic Advertiser List.

    The total number of Periodic Advertiser List entries is defined as BLE_GAP_PERD_LIST_MAX_ENTRY. The result of this API call is notified in BLE_GAP_EVENT_PERD_LIST_CONF_COMP event.

Parameters
[in]op_codeThe operation for Periodic Advertiser List.
macro description
BLE_GAP_LIST_ADD_DEV(0x01) Add the device to the list.
BLE_GAP_LIST_REM_DEV(0x02) Delete the device from the list.
BLE_GAP_LIST_CLR(0x03) Clear the list.


[in]p_addrAn array of device address to add / delete to the list.
The number of elements is specified by device_num.
If op_code is BLE_GAP_LIST_CLR, p_addr is ignored.

[in]p_adv_sid_setAn array of SID of the advertiser to add / delete to the list.
The number of elements is specified by device_num.
If op_code is BLE_GAP_LIST_CLR, p_adv_sid_set is ignored.

[in]device_numThe number of devices add / delete to the list.
Valid range is 1 - BLE_GAP_PERD_LIST_MAX_ENTRY.
If op_code is BLE_GAP_LIST_CLR, device_num is ignored.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)When op_code is BLE_GAP_LIST_ADD_DEV or BLE_GAP_LIST_REM_DEV, p_addr or p_adv_sid_set is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)op_code or address type field in p_addr or p_adv_sid_set or device_num is out of range.
BLE_ERR_UNSUPPORTED(0x0007)Not supported.
BLE_ERR_INVALID_STATE(0x0008)The reason for this error is as follows:
  • While operating Periodic Advertiser List, this function was called.
  • The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)There are no memories for operating periodic advertiser.

Events

Support library type

◆ R_BLE_GAP_AuthorizeDev()

ble_status_t R_BLE_GAP_AuthorizeDev ( uint16_t  conn_hdl,
uint8_t  author_flag 
)

User authorizes a remote device by this function.
This function is used when a remote device accesses a GATT Characteristic in local device which requests user authorization.
The result of this API call is returned by a return value.

Parameters
[in]conn_hdlConnection handle identifying the remote device to be authorized or not by user.

[in]author_flagAuthorize or not the remote device.
macro description
BLE_GAP_NOT_AUTHORIZED(0x00) Not authorize the remote device.
BLE_GAP_AUTHORIZED(0x01) Authorize the remote device.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)author_flag is out of range.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.

Events
none

Support library type

◆ R_BLE_GAP_GetRemDevInfo()

ble_status_t R_BLE_GAP_GetRemDevInfo ( uint16_t  conn_hdl)

This function gets information about the remote device.
The information includes BD_ADDR, the version number and LE features.
The result of this API call is notified in BLE_GAP_EVENT_GET_REM_DEV_INFO event.

Parameters
[in]conn_hdlConnection handle identifying the remote device whose information to be acquired.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events
none

Support library type

◆ R_BLE_GAP_SetPairingParams()

ble_status_t R_BLE_GAP_SetPairingParams ( st_ble_gap_pairing_param_t p_pair_param)

This function sets the parameters used in pairing.
The parameters set by this API are sent to the remote device when pairing occurred.
The result of this API call is returned by a return value.
.

Parameters
[in]p_pair_paramPairing parameters.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)The following field in p_pair_param is out of range.
  • iocap
  • max_key_size
  • mitm
  • bonding
  • key_notf
  • sec_conn_only

Events
none

Support library type

Message Sequence Chart

◆ R_BLE_GAP_SetLocIdInfo()

ble_status_t R_BLE_GAP_SetLocIdInfo ( st_ble_dev_addr_t p_lc_id_addr,
uint8_t *  p_lc_irk 
)

This function registers local IRK and identity address of local device in host stack.
The IRK and the identity address are distributed to a remote device in pairing.
The result of this API call is returned by a return value.

Parameters
[in]p_lc_id_addrIdentity address to be registered in host stack.

[in]p_lc_irkIRK to be registered in host stack.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_lc_id_addr or p_lc_irk is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)Address type field in p_lc_id_addr is out of range.

Events
none

Support library type

Message Sequence Chart

◆ R_BLE_GAP_SetLocCsrk()

ble_status_t R_BLE_GAP_SetLocCsrk ( uint8_t *  p_local_csrk)

This function registers local CSRK in host stack.
The CSRK is distributed to a remote device in pairing.
The result of this API call is returned by a return value.

Parameters
[in]p_local_csrkCSRK to be registered in host stack.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_local_csrk is specified as NULL.

Events
none

Support library type

Message Sequence Chart

◆ R_BLE_GAP_StartPairing()

ble_status_t R_BLE_GAP_StartPairing ( uint16_t  conn_hdl)

This function starts pairing with a remote device.
The result of this API call is returned by a return value.
The result of pairing is notified in BLE_GAP_EVENT_PAIRING_COMP event.

Parameters
[in]conn_hdlConnection handle identifying the remote device which local device starts pairing with.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_STATE(0x0008)While generating OOB data, this function was called.
BLE_ERR_CONTEXT_FULL(0x000B)While pairing, this function was called.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_ReplyPairing()

ble_status_t R_BLE_GAP_ReplyPairing ( uint16_t  conn_hdl,
uint8_t  response 
)

This function replies to the pairing request from the remote device.
The pairing request from the remote device is notified in BLE_GAP_EVENT_PAIRING_REQ event.
The result of this API call is returned by a return value.
The result of pairing is notified in BLE_GAP_EVENT_PAIRING_COMP event.

Parameters
[in]conn_hdlConnection handle identifying the remote device which local device starts pairing with.

[in]responseAccept or reject the pairing request from the remote device.
macro description
BLE_GAP_PAIRING_ACCEPT(0x00) Accept the pairing request.
BLE_GAP_PAIRING_REJECT(0x01) Reject the pairing request.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)response is out of range.
BLE_ERR_INVALID_STATE(0x0008)While generating OOB data, this function was called.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.
BLE_ERR_NOT_YET_READY(0x0012)When this function was called, host stack has not yet received BLE_GAP_EVENT_PAIRING_REQ event.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_StartEnc()

ble_status_t R_BLE_GAP_StartEnc ( uint16_t  conn_hdl)

This function starts encryption of the link.
In case of master device, the local device requests for the encryption to a remote device.
In case of slave device, the local device sends a Security Request to a remote device.
After receiving the Security Request, the remote device requests for the encryption to the local device.
The result of the encryption is returned in BLE_GAP_EVENT_ENC_CHG event.

Parameters
[in]conn_hdlConnection handle identifying the link which is encrypted.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_STATE(0x0008)The reason for this error is as follows:
  • Pairing has not been completed.
  • The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_ReplyPasskeyEntry()

ble_status_t R_BLE_GAP_ReplyPasskeyEntry ( uint16_t  conn_hdl,
uint32_t  passkey,
uint8_t  response 
)

When BLE_GAP_EVENT_PASSKEY_ENTRY_REQ event is notified, the response to passkey entry is sent by this function.
The result of this API call is returned by a return value.

Parameters
[in]conn_hdlConnection handle identifying the remote device which the reply to passkey entry is sent.

[in]passkeyPasskey.
The valid range is 000000 - 999999 in decimal.

[in]responseActive or negative reply to passkey entry.
macro description
BLE_GAP_PAIRING_ACCEPT(0x00) Accept the passkey entry pairing.
BLE_GAP_PAIRING_REJECT(0x01) Reject the passkey entry pairing.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)passkey or response is out of range.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.
BLE_ERR_NOT_YET_READY(0x0012)When this function was called, pairing has not yet started.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_ReplyNumComp()

ble_status_t R_BLE_GAP_ReplyNumComp ( uint16_t  conn_hdl,
uint8_t  response 
)

When BLE_GAP_EVENT_NUM_COMP_REQ event is notified, the response to Numeric Comparison is sent by this function.
The result of this API call is returned by a return value.

Parameters
[in]conn_hdlConnection handle identifying the remote device which the reply to Numeric Comparison is sent.

[in]responseActive or negative reply in Numeric Comparison.
macro description
BLE_GAP_PAIRING_ACCEPT(0x00) The number displayed in the local is the same as the one of the remote.
BLE_GAP_PAIRING_REJECT(0x01) The number displayed in the local is differs from the one of the remote.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)response is out of range.
BLE_ERR_INVALID_STATE(0x0008)When this function was called, host stack has not yet received BLE_GAP_EVENT_NUM_COMP_REQ event.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.
BLE_ERR_NOT_YET_READY(0x0012)When this function was called, pairing has not yet started.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_NotifyKeyPress()

ble_status_t R_BLE_GAP_NotifyKeyPress ( uint16_t  conn_hdl,
uint8_t  key_press 
)

This function notifies the input key type to the remote device in passkey entry.
The result is returned from this API.

Parameters
[in]conn_hdlConnection handle identifying the remote device to which the key notification is sent.

[in]key_pressInput key type.
macro description
BLE_GAP_LESC_PASSKEY_ENTRY_STARTED(0x00) Notify that passkey entry started.
BLE_GAP_LESC_PASSKEY_DIGIT_ENTERED(0x01) Notify that passkey digit entered.
BLE_GAP_LESC_PASSKEY_DIGIT_ERASED(0x02) Notify that passkey digit erased.
BLE_GAP_LESC_PASSKEY_CLEARED(0x03) Notify that passkey cleared.
BLE_GAP_LESC_PASSKEY_ENTRY_COMPLETED(0x04) Notify that passkey entry completed.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)key_press parameter is out of range.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.
BLE_ERR_NOT_YET_READY(0x0012)When this function was called, pairing has not yet started.

Events
none

Support library type

Message Sequence Chart

◆ R_BLE_GAP_GetDevSecInfo()

ble_status_t R_BLE_GAP_GetDevSecInfo ( uint16_t  conn_hdl,
st_ble_gap_auth_info_t p_sec_info 
)

This function gets the parameters which has been negotiated with the remote device in pairing.
The parameters can be acquired after pairing.
The result is returned by p_sec_info.

Parameters
[in]conn_hdlConnection handle identifying the remote device whose bonding information is acquired.

[in]p_sec_infoReturn the security information which has been negotiated in pairing.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_sec_info is specified as NULL.
BLE_ERR_INVALID_STATE(0x0008)The remote device bonding information has not been set to host stack.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.

Events
none

Support library type

◆ R_BLE_GAP_ReplyExKeyInfoReq()

ble_status_t R_BLE_GAP_ReplyExKeyInfoReq ( uint16_t  conn_hdl)

When key exchange request is notified by BLE_GAP_EVENT_EX_KEY_REQ event at pairing, keys of the local device are distributed.
The result is returned from this API.

Parameters
[in]conn_hdlConnection handle identifying the remote device to which the key is distributed.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.
BLE_ERR_NOT_YET_READY(0x0012)When this function was called, pairing has not yet started.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_MarkDevUntructed()

ble_status_t R_BLE_GAP_MarkDevUntructed ( st_ble_dev_addr_t p_addr)

Delete the bonding information about the remote device from security database.

This function discards the remote device bonding information in host stack. The result is returned from this API.

Parameters
[in]p_addrThe address of the remote device whose bonding information in host stack is discarded.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_addr is specified as NULL.
BLE_ERR_INVALID_STATE(0x0008)Encryption of the link is enabled.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by p_addr is not found.

◆ R_BLE_GAP_SetRemOobData()

ble_status_t R_BLE_GAP_SetRemOobData ( st_ble_dev_addr_t p_addr,
uint8_t  oob_data_flag,
st_ble_gap_oob_data_t p_oob 
)

This function registers the OOB data received from a remote device.
When oob_data_flag indicates that the OOB data has been received, the setting regarding OOB data is reflected in pairing.
In order to do OOB pairing, set the OOB data received from the remote device before pairing.
The result is returned from this API.

Parameters
[in]p_addrThe remote device address.

[in]oob_data_flagThis parameter indicates whether the local device has received the OOB data from the remote device or not.
macro description
BLE_GAP_OOB_DATA_NOT_PRESENT(0x00) Reply that No OOB data has been received when pairing.
BLE_GAP_OOB_DATA_PRESENT(0x01) Reply that the OOB data has been received when pairing.


[in]p_oobThe OOB data received from the remote device.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows.
BLE_ERR_INVALID_ARG(0x0003)oob_data_flag is out of range.
BLE_ERR_CONTEXT_FULL(0x000B)There is no room to register the OOB data received from a remote device.

Events
none

Support library type

Message Sequence Chart

◆ R_BLE_GAP_CreateScOobData()

ble_status_t R_BLE_GAP_CreateScOobData ( void  )

This function generates the OOB data distributed to a remote device in Secure Connections. The result of this API call is notified in BLE_GAP_EVENT_SC_OOB_CREATE_COMP event.

Parameters
void
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_STATE(0x0008)The reason for this error is as follows:
  • This function was called in pairing.
  • The task for host stack is not running.
BLE_ERR_ALREADY_IN_PROGRESS(0x000A)This function was called in creating OOB data.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.

Events

Support library type

Message Sequence Chart

◆ R_BLE_GAP_SetBondInfo()

ble_status_t R_BLE_GAP_SetBondInfo ( st_ble_gap_bond_info_t p_bond_info,
uint8_t  device_num,
uint8_t *  p_set_num 
)

Set the bonding information of the remote device in the host stack.
After power re-supply, when the remote device bonding information stored in non-volatile memory is set to host stack, this function is used.
Host stack can be set the number specified by the device_num parameter of bonding information.

Parameters
[in]p_bond_infoAn array of bonding information.
The number of elements is specified by device_num.

[in]device_numThe number of the devices of which host stack registers bonding information.

[in]p_set_numThe number of the devices whose bonding information was registered in host stack.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_bond_info or p_set_num is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)device_num is out of range.
BLE_ERR_CONTEXT_FULL(0x000B)Host stack already has the maximum number of bonding information.

Events
none

Support library type

Message Sequence Chart

◆ R_BLE_GAP_DeleteBondInfo()

void R_BLE_GAP_DeleteBondInfo ( int32_t  local,
int32_t  remote,
st_ble_dev_addr_t p_addr,
ble_gap_del_bond_cb_t  gap_del_bond_cb 
)

This function deletes the bonding information in Host Stack.
When a function for deleting the bonding information stored in non-volatile area is registered by the gap_del_bond_cb parameter, it is deleted as well as the bonding information in Host Stack.

Parameters
[in]localThe type of the local bonding information to be deleted.
macro description
BLE_GAP_SEC_DEL_LOC_NONE(0x00) Delete no local keys.
BLE_GAP_SEC_DEL_LOC_IRK(0x01) Delete local IRK and identity address.
BLE_GAP_SEC_DEL_LOC_CSRK(0x02) Delete local CSRK.
BLE_GAP_SEC_DEL_LOC_ALL(0x03) Delete all local keys.


[in]remoteThe type of the remote bonding information to be deleted.
macro description
BLE_GAP_SEC_DEL_REM_NONE(0x00) Delete no remote device keys.
BLE_GAP_SEC_DEL_REM_SA(0x01) Delete the keys specified by the p_addr parameter.
BLE_GAP_SEC_DEL_REM_NOT_CONN(0x02) Delete keys of not connected remote devices.
BLE_GAP_SEC_DEL_REM_ALL(0x03) Delete all remote device keys.


[in]p_addrp_addr is specified as the address of the remote device whose keys are deleted when the rem_info parameter is set to BLE_GAP_SEC_DEL_REM_SA(0x01).

[in]gap_del_bond_cbThis parameter is a callback function which deletes the bonding information stored in non-volatile area.
After deleting the bonding information stored in Host Stack, the callback function is called. If no bonding information is stored in non-volatile area, specify the parameter as NULL.
Return values
none

Events
none

Support library type

◆ R_BLE_GAP_ReplyLtkReq()

ble_status_t R_BLE_GAP_ReplyLtkReq ( uint16_t  conn_hdl,
uint16_t  ediv,
uint8_t *  p_peer_rand,
uint8_t  response 
)

This function replies to the LTK request in BLE_GAP_EVENT_LTK_REQ event from a remote device.
The result of the LTK reply is returned in BLE_GAP_EVENT_LTK_RSP_COMP event.
When the link encryption has completed, BLE_GAP_EVENT_ENC_CHG event is notified.
.

Parameters
[in]conn_hdlConnection handle identifying the remote device which sent the LTK request.

[in]edivEdiv notified in BLE_GAP_EVENT_LTK_REQ event.

[in]p_peer_randRand notified in BLE_GAP_EVENT_LTK_REQ event.

[in]responseResponse to the LTK request. If BLE_GAP_LTK_REQ_ACCEPT is specified, when no LTK has been exchanged in pairing, reject the LTK request.
macro description
BLE_GAP_LTK_REQ_ACCEPT(0x00) Reply for the LTK request.
BLE_GAP_LTK_REQ_DENY(0x01) Reject the LTK request.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)p_peer_rand is specified as NULL in case of legacy pairing.
BLE_ERR_INVALID_ARG(0x0003)response is out of range.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl is not found.

Events

Support library type