![]() |
Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
|
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... | |
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.
[in] | gap_cb | A callback function registered with this function. |
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:
|
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
Events
Support library type
Message Sequence Chart
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.
void |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_STATE(0x0008) | Host stack hasn't been initialized. |
Events
Support library type
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 | - |
[in] | conn_hdl | Connection handle identifying the link to be updated. | ||||||
[in] | mode | Connection parameter update request or response.
| ||||||
[in] | accept | When 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.
| ||||||
[in] | p_conn_updt_param | Connection 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. |
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.
|
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
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.
[in] | conn_hdl | Connection handle identifying the link whose the transmission packet size or the transmission time to be changed. |
[in] | tx_octets | Maximum transmission packet size. Valid range is 0x001B - 0x00FB. |
[in] | tx_time | Maximum transmission time(us). Valid range is 0x0148 - 0x4290. |
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
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.
[in] | conn_hdl | Connection handle identifying the link to be disconnected. |
[in] | reason | The 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". |
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
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().
[in] | conn_hdl | Connection handle identifying the link whose PHY to be updated. |
[in] | p_phy_param | PHY preferences. |
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
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.
[in] | p_def_phy_param | The PHY preference which a remote device may change. |
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
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.
[in] | p_addr | An array of identity address of the remote device to set privacy mode. The number of elements is specified by device_num. | ||||||
[in] | p_privacy_mode | An 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.
| ||||||
[in] | device_num | The number of devices to set privacy mode. Valid range is 1 - BLE_GAP_RSLV_LIST_MAX_ENTRY. |
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.
|
BLE_ERR_INVALID_STATE(0x0008) | The reason for this error is as follows:
|
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
Events
Support library type
Message Sequence Chart
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.
Clear White List.
The total number of White List entries is defined as BLE_GAP_WHITE_LIST_MAX_ENTRY.
The result of this API call is notified in BLE_GAP_EVENT_WHITE_LIST_CONF_COMP event.
[in] | op_code | The operation for White List.
| ||||||||
[in] | p_addr | An 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_num | The 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. |
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:
|
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | There are no memories for operating the White List. |
Events
Support library type
Message Sequence Chart
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.
void |
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
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.
[in] | conn_hdl | Connection handle identifying the link whose PHY settings to be acquired. |
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
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.
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.
[in] | op_code | The operation for Resolving List.
| ||||||||
[in] | p_addr | An 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_irk | The 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_num | The 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. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The reason for this error is as follows:
|
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:
|
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | There are no memories for operating the Resolving List. |
Events
Support library type
Message Sequence Chart
ble_status_t R_BLE_GAP_EnableRpa | ( | uint8_t | enable | ) |
This function enables or disables RPA functionality. The RPA functionality includes the following.
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.
[in] | enable | Enable or disable address resolution function.
|
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
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.
[in] | rpa_timeout | Time interval to update resolvable private address in seconds. Valid range is 0x003C - 0xA1B8. Default is 900s. |
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
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.
[in] | p_addr | Identity address registered in Resolving List. |
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.
|
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | Insufficient memory is needed to generate this function. |
Events
Support library type
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.
[in] | conn_hdl | Connection handle identifying the link whose RSSI to be acquired. |
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
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.
[in] | conn_hdl | Connection handle identifying the link whose channel map to be acquired. |
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
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.
[in] | p_random_addr | Static address or non-resolvable private address. The BD address setting format is little endian. |
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
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.
[in] | p_adv_param | Advertising parameters. |
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.
|
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
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().
The result of this API call is notified in BLE_GAP_EVENT_ADV_DATA_UPD_COMP event.
[in] | p_adv_srsp_data | Advertising data/scan response data/periodic advertising data. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The reason for this error is as follows:
|
BLE_ERR_INVALID_ARG(0x0003) | The following field in p_adv_srsp_data parameter 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
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.
.
[in] | adv_hdl | The advertising handle pointing to the advertising set which starts advertising. The valid range is 0x00 - 0x03. |
[in] | duration | The 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_evts | The 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. |
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
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.
.
[in] | adv_hdl | The advertising handle pointing to the advertising set which stops advertising. The valid range is 0x00 - 0x03. |
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
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.
[in] | p_perd_adv_param | Periodic advertising parameters. |
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
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.
[in] | adv_hdl | Advertising handle identifying the advertising set which starts periodic advertising. |
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
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.
[in] | adv_hdl | Specify the handle of Advertising Set to stop Periodic Advertising. |
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
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.
[out] | p_remain_adv_data_size | The free buffer size of Controller to which advertising data/scan response data can be currently set. |
[out] | p_remain_perd_adv_data_size | The free buffer size of Controller to which periodic advertising data can be currently set. |
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
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.
[in] | op_code | The operation for delete or clear.
| ||||||
[in] | adv_hdl | Advertising handle identifying the advertising set deleted. If op_code is BLE_GAP_RMV_ADV_SET_CLR_OP, adv_hdl is ignored. |
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
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.
[in] | p_param | Connection parameters. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The reason for this error is as follows:
|
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
Message Sequence Chart
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.
void |
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
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.
[in] | p_channel_map | Channel map. |
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
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.
Scanning continues until R_BLE_GAP_StopScan() is called.
If scan duration is zero, scan period is ignored. Scanning continues until R_BLE_GAP_StopScan() is called.
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.
[in] | p_scan_param | Scan 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_enable | Scan period, scan duration, duplicate filter and procedure type. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The reason for this error is as follows:
|
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
Message Sequence Chart
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.
none |
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
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.
[in] | p_addr | The 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_sid | Advertising SID. When p_addr is specified as NULL, adv_sid is ignored. Valid range is 0x00 - 0x0F. |
[in] | skip | The number of consecutive periodic advertising packets that local device may skip after receiving a periodic advertising packet. Valid range is 0x0000 - 0x01F3. |
[in] | sync_to | The 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. |
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.
|
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
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.
void |
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
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.
[in] | sync_hdl | Sync handle identifying the periodic sync to be terminated. |
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
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.
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.
[in] | op_code | The operation for Periodic Advertiser List.
| ||||||||
[in] | p_addr | An 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_set | An 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_num | The 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. |
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:
|
BLE_ERR_MEM_ALLOC_FAILED(0x000C) | There are no memories for operating periodic advertiser. |
Events
Support library type
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.
[in] | conn_hdl | Connection handle identifying the remote device to be authorized or not by user. | ||||||
[in] | author_flag | Authorize or not the remote device.
|
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
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.
[in] | conn_hdl | Connection handle identifying the remote device whose information to be acquired. |
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
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.
.
[in] | p_pair_param | Pairing parameters. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_ARG(0x0003) | The following field in p_pair_param is out of range.
|
Events
none
Support library type
Message Sequence Chart
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.
[in] | p_lc_id_addr | Identity address to be registered in host stack. |
[in] | p_lc_irk | IRK to be registered in host stack. |
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
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.
[in] | p_local_csrk | CSRK to be registered in host stack. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | p_local_csrk is specified as NULL. |
Events
none
Support library type
Message Sequence Chart
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.
[in] | conn_hdl | Connection handle identifying the remote device which local device starts pairing with. |
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
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.
[in] | conn_hdl | Connection handle identifying the remote device which local device starts pairing with. | ||||||
[in] | response | Accept or reject the pairing request from the remote device.
|
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
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.
[in] | conn_hdl | Connection handle identifying the link which is encrypted. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_STATE(0x0008) | The reason for this error is as follows:
|
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
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.
[in] | conn_hdl | Connection handle identifying the remote device which the reply to passkey entry is sent. | ||||||
[in] | passkey | Passkey. The valid range is 000000 - 999999 in decimal. | ||||||
[in] | response | Active or negative reply to passkey entry.
|
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
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.
[in] | conn_hdl | Connection handle identifying the remote device which the reply to Numeric Comparison is sent. | ||||||
[in] | response | Active or negative reply in Numeric Comparison.
|
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
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.
[in] | conn_hdl | Connection handle identifying the remote device to which the key notification is sent. | ||||||||||||
[in] | key_press | Input key type.
|
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
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.
[in] | conn_hdl | Connection handle identifying the remote device whose bonding information is acquired. |
[in] | p_sec_info | Return the security information which has been negotiated in pairing. |
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
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.
[in] | conn_hdl | Connection handle identifying the remote device to which the key is distributed. |
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
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.
[in] | p_addr | The address of the remote device whose bonding information in host stack is discarded. |
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. |
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.
[in] | p_addr | The remote device address. | ||||||
[in] | oob_data_flag | This parameter indicates whether the local device has received the OOB data from the remote device or not.
| ||||||
[in] | p_oob | The OOB data received from the remote device. |
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
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.
void |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_STATE(0x0008) | The reason for this error is as follows:
|
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
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.
[in] | p_bond_info | An array of bonding information. The number of elements is specified by device_num. |
[in] | device_num | The number of the devices of which host stack registers bonding information. |
[in] | p_set_num | The number of the devices whose bonding information was registered in host stack. |
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
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.
[in] | local | The type of the local bonding information to be deleted.
| ||||||||||
[in] | remote | The type of the remote bonding information to be deleted.
| ||||||||||
[in] | p_addr | p_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_cb | This 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. |
none |
Events
none
Support library type
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.
.
[in] | conn_hdl | Connection handle identifying the remote device which sent the LTK request. | ||||||
[in] | ediv | Ediv notified in BLE_GAP_EVENT_LTK_REQ event. | ||||||
[in] | p_peer_rand | Rand notified in BLE_GAP_EVENT_LTK_REQ event. | ||||||
[in] | response | Response to the LTK request. If BLE_GAP_LTK_REQ_ACCEPT is specified, when no LTK has been exchanged in pairing, reject the LTK request.
|
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