RA Flexible Software Package Documentation  Release v5.2.0

 

Functions

ble_status_t R_BLE_VS_Init (ble_vs_app_cb_t vs_cb)
 This function initializes Vendor Specific API and registers a callback function for Vendor Specific Event. More...
 
ble_status_t R_BLE_VS_StartTxTest (st_ble_vs_tx_test_param_t *p_tx_test_param)
 This function starts extended Transmitter Test. More...
 
ble_status_t R_BLE_VS_StartRxTest (st_ble_vs_rx_test_param_t *p_rx_test_param)
 This function starts extended Receiver Test. More...
 
ble_status_t R_BLE_VS_EndTest (void)
 This function terminates the extended transmitter or receiver test. More...
 
ble_status_t R_BLE_VS_SetTxPower (uint16_t conn_hdl, uint8_t tx_power)
 This function configures transmit power. More...
 
ble_status_t R_BLE_VS_GetTxPower (uint16_t conn_hdl)
 This function gets transmit power. More...
 
ble_status_t R_BLE_VS_SetCodingScheme (uint8_t coding_scheme)
 This function configure default Coding scheme(S=8 or S=2) that is used in the case of selecting Coded PHY in Primary advertising PHY or Secondary advertising PHY advertising or request for link establishment. More...
 
ble_status_t R_BLE_VS_SetRfControl (st_ble_vs_set_rf_ctrl_param_t *p_rf_ctrl)
 This function performs power control on RF. More...
 
ble_status_t R_BLE_VS_SetBdAddr (uint8_t area, st_ble_dev_addr_t *p_addr)
 This function sets public/random address of local device to the area specified by the parameter. More...
 
ble_status_t R_BLE_VS_GetBdAddr (uint8_t area, uint8_t addr_type)
 This function gets currently configured public/random address. More...
 
ble_status_t R_BLE_VS_GetRand (uint8_t rand_size)
 This function generates 4-16 bytes of random number used in creating keys. More...
 
ble_status_t R_BLE_VS_StartTxFlowEvtNtf (void)
 This function starts the notification(BLE_VS_EVENT_TX_FLOW_STATE_CHG event) of the state transition of TxFlow. More...
 
ble_status_t R_BLE_VS_StopTxFlowEvtNtf (void)
 This function stops the notification(BLE_VS_EVENT_TX_FLOW_STATE_CHG event) of the state transition of TxFlow. More...
 
ble_status_t R_BLE_VS_GetTxBufferNum (uint32_t *p_buffer_num)
 This function retrieves the number of the available transmission packet buffers. More...
 
ble_status_t R_BLE_VS_SetTxLimit (uint32_t tx_queue_lwm, uint32_t tx_queue_hwm)
 This function sets the threshold for notifying the application layer of the TxFlow state. More...
 
ble_status_t R_BLE_VS_SetScanChMap (uint16_t ch_map)
 This function sets the scan channel map. More...
 
ble_status_t R_BLE_VS_GetScanChMap (void)
 This function gets currently scan channel map. More...
 
ble_status_t R_BLE_VS_StartFirmwareUpdate (void)
 This function starts the firmware update procedure. More...
 
ble_status_t R_BLE_VS_SendFirmwareData (uint16_t index, uint16_t length, uint8_t const *const p_data)
 This function sends a firmware update data frame. More...
 
ble_status_t R_BLE_VS_EndFirmwareUpdate (uint16_t end_index)
 This function ends the firmware update procedure. More...
 
ble_status_t R_BLE_VS_GetFirmwareVersion (void)
 This function requests the BLE module firmware version. More...
 
ble_status_t R_BLE_VS_RestartModule (void)
 This function restarts the module. More...
 

Detailed Description

Data Structures

struct  st_ble_vs_tx_test_param_t
 This is the extended transmitter test parameters used in R_BLE_VS_StartTxTest(). More...
 
struct  st_ble_vs_rx_test_param_t
 This is the extended receiver test parameters used in R_BLE_VS_StartRxTest(). More...
 
struct  st_ble_vs_set_rf_ctrl_param_t
 This is the RF parameters used in R_BLE_VS_SetRfControl(). More...
 
struct  st_ble_vs_test_end_evt_t
 This structure notifies that the extended test has been terminated. More...
 
struct  st_ble_vs_set_tx_pwr_comp_evt_t
 This structure notifies that tx power has been set. More...
 
struct  st_ble_vs_get_tx_pwr_comp_evt_t
 This structure notifies that tx power has been retrieved. More...
 
struct  st_ble_vs_set_rf_ctrl_comp_evt_t
 This structure notifies that RF has been configured. More...
 
struct  st_ble_vs_get_bd_addr_comp_evt_t
 This structure notifies that BD_ADDR has been retrieved. More...
 
struct  st_ble_vs_get_rand_comp_evt_t
 This structure notifies that random number has been generated. More...
 
struct  st_ble_vs_tx_flow_chg_evt_t
 This structure notifies that the state transition of TxFlow has been changed. More...
 
struct  st_ble_vs_evt_data_t
 st_ble_vs_evt_data_t is the type of the data notified in a Vendor Specific Event. More...
 
struct  st_ble_vs_get_scan_ch_map_comp_evt_t
 This structure notifies that current scan channel map. More...
 
struct  st_ble_vs_get_fw_version_comp_evt_t
 This structure notifies the current firmware version. More...
 

Macros

#define BLE_VS_TX_POWER_HIGH
 High power level.
 
#define BLE_VS_TX_POWER_MID
 Middle power level.
 
#define BLE_VS_TX_POWER_LOW
 Low power level.
 
#define BLE_VS_ADDR_AREA_REG
 Address in register is written or read.
 
#define BLE_VS_ADDR_AREA_DATA_FLASH
 Address in DataFlash is written or read.
 
#define BLE_VS_EH_TX_PL_PRBS9
 PRBS9 sequence '11111111100000111101..'.
 
#define BLE_VS_EH_TX_PL_11110000
 Repeated '11110000'.
 
#define BLE_VS_EH_TX_PL_10101010
 Repeated '10101010'.
 
#define BLE_VS_EH_TX_PL_PRBS15
 PRBS15 sequence.
 
#define BLE_VS_EH_TX_PL_11111111
 Repeated '11111111'.
 
#define BLE_VS_EH_TX_PL_00000000
 Repeated '00000000'.
 
#define BLE_VS_EH_TX_PL_00001111
 Repeated '00001111'.
 
#define BLE_VS_EH_TX_PL_01010101
 Repeated '01010101'.
 
#define BLE_VS_EH_TEST_PHY_1M
 1M PHY used in Transmitter/Receiver test.
 
#define BLE_VS_EH_TEST_PHY_2M
 2M PHY used in Transmitter/Receiver test.
 
#define BLE_VS_EH_TEST_PHY_CODED
 Coded PHY used in Receiver test.
 
#define BLE_VS_EH_TEST_PHY_CODED_S_8
 Coded PHY(S=8) used in Transmitter test.
 
#define BLE_VS_EH_TEST_PHY_CODED_S_2
 Coded PHY(S=2) used in Transmitter test.
 
#define BLE_VS_RF_OFF
 RF power off.
 
#define BLE_VS_RF_ON
 RF power on.
 
#define BLE_VS_RF_INIT_PARAM_NOT_CHG
 The parameters are not changed in RF power on.
 
#define BLE_VS_RF_INIT_PARAM_CHG
 The parameters are changed in RF power on.
 
#define BLE_VS_CS_PRIM_ADV_S_8
 Coding scheme for Primary Advertising PHY(S=8).
 
#define BLE_VS_CS_PRIM_ADV_S_2
 Coding scheme for Primary Advertising PHY(S=2).
 
#define BLE_VS_CS_SECOND_ADV_S_8
 Coding scheme for Secondary Advertising PHY(S=8).
 
#define BLE_VS_CS_SECOND_ADV_S_2
 Coding scheme for Secondary Advertising PHY(S=2).
 
#define BLE_VS_CS_CONN_S_8
 Coding scheme for request for link establishment(S=8).
 
#define BLE_VS_CS_CONN_S_2
 Coding scheme for request for link establishment(S=2).
 
#define BLE_VS_TX_FLOW_CTL_ON
 It means that the number of buffer has reached the High Water Mark from flow off state.
 
#define BLE_VS_TX_FLOW_CTL_OFF
 It means that the number of buffer has reached the Low Water Mark from flow on state.
 

Typedefs

typedef void(* ble_vs_app_cb_t) (uint16_t event_type, ble_status_t event_result, st_ble_vs_evt_data_t *p_event_data)
 ble_vs_app_cb_t is the Vendor Specific Event callback function type. More...
 

Enumerations

enum  e_r_ble_vs_evt_t
 Vendor Specific Event Identifier. More...
 

Data Structure Documentation

◆ st_ble_vs_tx_test_param_t

struct st_ble_vs_tx_test_param_t

This is the extended transmitter test parameters used in R_BLE_VS_StartTxTest().

Data Fields
uint8_t ch Channel used in Tx test.
uint8_t test_data_len Length(in bytes) of the packet used in Tx Test.
uint8_t packet_payload Packet Payload.
uint8_t phy Transmitter PHY used in test.
uint8_t tx_power Tx Power Level used in DTM Tx Test.
uint8_t option Option.
uint16_t num_of_packet The number of packet to be sent.

◆ st_ble_vs_rx_test_param_t

struct st_ble_vs_rx_test_param_t

This is the extended receiver test parameters used in R_BLE_VS_StartRxTest().

Data Fields
uint8_t ch Channel used in Rx test.
uint8_t phy Receiver PHY used in the test.

◆ st_ble_vs_set_rf_ctrl_param_t

struct st_ble_vs_set_rf_ctrl_param_t

This is the RF parameters used in R_BLE_VS_SetRfControl().

Data Fields
uint8_t power RF power on/off.
uint8_t option This field indicates whether the parameters change in RF power on.
uint8_t clval RF rapid clock frequency adjust value(OSC internal CL adjust).
uint8_t slow_clock RF slow clock configurations.
uint8_t tx_power Set tx power in power on.
uint8_t rf_option Set RF option.

◆ st_ble_vs_test_end_evt_t

struct st_ble_vs_test_end_evt_t

This structure notifies that the extended test has been terminated.

Data Fields
uint16_t num_of_packet The number of packet successfully received in the receiver test.
uint16_t num_of_crc_err_packet The number of CRC error packets in the receiver test.
int8_t ave_rssi Average RSSI(dBm) in the receiver test.
int8_t max_rssi Maximum RSSI(dBm) in the receiver test.
int8_t min_rssi Minimum RSSI(dBm) in the receiver test.

◆ st_ble_vs_set_tx_pwr_comp_evt_t

struct st_ble_vs_set_tx_pwr_comp_evt_t

This structure notifies that tx power has been set.

Data Fields
uint16_t conn_hdl Connection handle that identifying the link whose tx power has been set.
int8_t curr_tx_pwr Tx power that has been set(dBm).

◆ st_ble_vs_get_tx_pwr_comp_evt_t

struct st_ble_vs_get_tx_pwr_comp_evt_t

This structure notifies that tx power has been retrieved.

Data Fields
uint16_t conn_hdl Connection handle that identifying the link whose tx power has been retrieved.
int8_t curr_tx_pwr Current tx power(dBm).
int8_t max_tx_pwr Maximum tx power(dBm).

◆ st_ble_vs_set_rf_ctrl_comp_evt_t

struct st_ble_vs_set_rf_ctrl_comp_evt_t

This structure notifies that RF has been configured.

Data Fields
uint8_t ctrl The result of RF power control.

◆ st_ble_vs_get_bd_addr_comp_evt_t

struct st_ble_vs_get_bd_addr_comp_evt_t

This structure notifies that BD_ADDR has been retrieved.

Data Fields
uint8_t area The area that public/random address has been retrieved.

value description
BLE_VS_ADDR_AREA_REG(0x00) Register.
BLE_VS_ADDR_AREA_DATA_FLASH(0x01) Data Flash.
st_ble_dev_addr_t addr The address that has been retrieved.

◆ st_ble_vs_get_rand_comp_evt_t

struct st_ble_vs_get_rand_comp_evt_t

This structure notifies that random number has been generated.

Data Fields
uint8_t rand_size Length of random number.
uint8_t * p_rand Random number.

◆ st_ble_vs_tx_flow_chg_evt_t

struct st_ble_vs_tx_flow_chg_evt_t

This structure notifies that the state transition of TxFlow has been changed.

Data Fields
uint8_t state The state of the flow control.

value description
BLE_VS_TX_FLOW_CTL_ON(0x00) The number of buffer has reached the High Water Mark from flow off state.
BLE_VS_TX_FLOW_CTL_OFF(0x01) The number of buffer has reached the Low Water Mark from flow on state.
uint32_t buffer_num The number of the current transmission buffers.

◆ st_ble_vs_evt_data_t

struct st_ble_vs_evt_data_t

st_ble_vs_evt_data_t is the type of the data notified in a Vendor Specific Event.

Data Fields
uint16_t param_len The size of Vendor Specific Event parameters.
void * p_param Vendor Specific Event parameters. This parameter differs in each Vendor Specific Event.

◆ st_ble_vs_get_scan_ch_map_comp_evt_t

struct st_ble_vs_get_scan_ch_map_comp_evt_t

This structure notifies that current scan channel map.

Data Fields
uint8_t ch_map The result of current scan channel map.

◆ st_ble_vs_get_fw_version_comp_evt_t

struct st_ble_vs_get_fw_version_comp_evt_t

This structure notifies the current firmware version.

Data Fields
uint8_t major The result of get firmware version.
uint8_t minor
uint8_t special

Typedef Documentation

◆ ble_vs_app_cb_t

ble_vs_app_cb_t

ble_vs_app_cb_t is the Vendor Specific Event callback function type.

Parameters
[in]event_typeThe type of Vendor Specific Event.
[in]event_resultThe result of API call which generates the Vendor Specific Event.
[in]p_event_dataData notified in the Vendor Specific Event.
Returns
none

Enumeration Type Documentation

◆ e_r_ble_vs_evt_t

Vendor Specific Event Identifier.

Enumerator
BLE_VS_EVENT_SET_TX_POWER 

This event notifies that the tx power has been set by R_BLE_VS_SetTxPower().

Event Code: 0x8001

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_INVALID_ARG(0x0003) The tx_power parameter specified by R_BLE_VS_SetTxPower() is out of range.
BLE_ERR_INVALID_HDL(0x000E) The link identified with the conn_hdl specified by R_BLE_VS_SetTxPower() is not found.

Event Data:

st_ble_vs_set_tx_pwr_comp_evt_t

BLE_VS_EVENT_GET_TX_POWER 

This event notifies that the tx power has been retrieved by R_BLE_VS_GetTxPower().

Event Code: 0x8002

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_INVALID_HDL(0x000E) The link identified with the conn_hdl specified by R_BLE_VS_GetTxPower() is not found.

Event Data:

st_ble_vs_get_tx_pwr_comp_evt_t

BLE_VS_EVENT_TX_TEST_START 

This event notifies that the extended transmitter test has been started by R_BLE_VS_StartTxTest().

Event Code: 0x8003

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_INVALID_ARG(0x0003) The parameter specified by R_BLE_VS_StartTxTest() is out of range.

Event Data:

none

BLE_VS_EVENT_TX_TEST_TERM 

This event notifies that the number specified by R_BLE_VS_StartTxTest() of packets has been sent.

Event Code: 0x8004

result:

BLE_SUCCESS(0x0000) Success

Event Data:

none

BLE_VS_EVENT_RX_TEST_START 

This event notifies that the extended receiver test has been started by R_BLE_VS_StartRxTest().

Event Code: 0x8005

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_INVALID_ARG(0x0003) The parameter specified by R_BLE_VS_StartRxTest() is out of range.

Event Data:

none

BLE_VS_EVENT_TEST_END 

This event notifies that the extended test has been terminated by R_BLE_VS_EndTest().

Event Code: 0x8006

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_vs_test_end_evt_t

BLE_VS_EVENT_SET_CODING_SCHEME_COMP 

This event notifies that the coding scheme has been configured by R_BLE_VS_SetCodingScheme().

Event Code: 0x8007

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_INVALID_ARG(0x0003) The coding_scheme parameter specified by R_BLE_VS_SetCodingScheme() is out of range.

Event Data:

none

BLE_VS_EVENT_RF_CONTROL_COMP 

This event notifies that the RF has been configured by R_BLE_VS_SetRfControl().

Event Code: 0x8008

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_INVALID_ARG(0x0003) The parameter specified by R_BLE_VS_SetRfControl() is out of range.
BLE_ERR_INVALID_OPERATION(0x0009) During the power on or the power off, the same power state is specified by R_BLE_VS_SetRfControl().

Event Data:

st_ble_vs_set_rf_ctrl_comp_evt_t

BLE_VS_EVENT_SET_ADDR_COMP 

This event notifies that public/random address has been set by R_BLE_VS_SetBdAddr().

Event Code: 0x8009

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_INVALID_ARG(0x0003) The area parameter or the type field in the p_addr parameter specified by R_BLE_VS_SetBdAddr() is out of range.

Event Data:

none

BLE_VS_EVENT_GET_ADDR_COMP 

This event notifies that public/random address has been retrieved by R_BLE_VS_GetBdAddr().

Event Code: 0x800A

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_INVALID_ARG(0x0003) The area parameter or the type field in the p_addr parameter specified by R_BLE_VS_GetBdAddr() is out of range.

Event Data:

st_ble_vs_get_bd_addr_comp_evt_t

BLE_VS_EVENT_GET_RAND 

This event notifies the application layer that random number has been generated by R_BLE_VS_GetRand().

Event Code: 0x800B

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_INVALID_ARG(0x0003) The rand_size parameter specified by R_BLE_VS_GetRand() is out of range.

Event Data:

st_ble_vs_get_rand_comp_evt_t

BLE_VS_EVENT_TX_FLOW_STATE_CHG 

This event notifies the application layer of the state transition of TxFlow.

Event Code: 0x800C

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_vs_tx_flow_chg_evt_t

BLE_VS_EVENT_FAIL_DETECT 

This event notifies a failure occurs in RF. After receiving the event, reset MCU or RF.

Event Code: 0x800D

result:

BLE_SUCCESS(0x0000) Success

Event Data:

None

BLE_VS_EVENT_SET_SCAN_CH_MAP 

This event notifies that scan channel map has been set by R_BLE_VS_SetScanChMap().

Event Code: 0x800E

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_INVALID_ARG(0x0003) The ch_map parameter specified by R_BLE_VS_SetScanChMap() is out of range.

Event Data:

none

BLE_VS_EVENT_GET_SCAN_CH_MAP 

This event notifies that scan channel map has been retrieved by R_BLE_VS_GetScanChMap().

Event Code: 0x800F

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_vs_get_scan_ch_map_comp_evt_t

BLE_VS_EVENT_START_FW_UPDATE_COMP 

This event notifies that START_FW_UPDATE command has completed.

Event Code: 0x072C

result:

BLE_SUCCESS(0x0000) Success

Event Data:

none

BLE_VS_EVENT_SEND_FW_DATA_COMP 

This event notifies that SEND_FW_DATA command has completed.

Event Code: 0x072D

result:

BLE_SUCCESS(0x0000) Success

Event Data:

none

BLE_VS_EVENT_END_FW_UPDATE_COMP 

This event notifies that END_FW_UPDATE command has completed.

Event Code: 0x072E

result:

BLE_SUCCESS(0x0000) Success

Event Data:

none

BLE_VS_EVENT_GET_FW_VERSION_COMP 

This event notifies that END_FW_UPDATE command has completed.

Event Code: 0x0772

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_vs_get_fw_version_comp_evt_t

BLE_VS_EVENT_MODULE_READY_COMP 

This event notifies that module is ready.

Event Code: 0x0746

result:

BLE_SUCCESS(0x0000) Success

Event Data:

none

BLE_VS_EVENT_OTA_START_NOTIFY 

This event notifies that OTA firmware update has been started.

Event Code: 0x09B0

result:

BLE_SUCCESS(0x0000) Success

Event Data:

none

BLE_VS_EVENT_OTA_END_NOTIFY 

This event notifies that OTA firmware update has been completed successfully.

Event Code: 0x09C0

result:

BLE_SUCCESS(0x0000) Success

Event Data:

none

BLE_VS_EVENT_OTA_ERROR_NOTIFY 

This event notifies that OTA firmware update has failed.

Event Code: 0x09D0

result:

BLE_SUCCESS(0x0000) Success

Event Data:

none

BLE_VS_EVENT_INVALID 

Invalid VS Event.

Event Code: 0x80FF

result:

BLE_SUCCESS(0x0000) Success

Event Data:

none

Function Documentation

◆ R_BLE_VS_Init()

ble_status_t R_BLE_VS_Init ( ble_vs_app_cb_t  vs_cb)

This function initializes Vendor Specific API and registers a callback function for Vendor Specific Event.

The result of this API call is returned by a return value.

Parameters
[in]vs_cbCallback function to be registered.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The vs_cb parameter is specified as NULL.
BLE_ERR_CONTEXT_FULL(0x000B)Callback function has already been registered.

◆ R_BLE_VS_StartTxTest()

ble_status_t R_BLE_VS_StartTxTest ( st_ble_vs_tx_test_param_t p_tx_test_param)

This function starts extended Transmitter Test.

The following extended transmitter test functions of DTM Tx are supported by this function.

  • Tx Power
  • Tx Modulation Enable/Modulation Disable
  • Tx packet transmission/continuous transmission
  • Tx packets count

The result of this API call is notified in BLE_VS_EVENT_TX_TEST_START event.
If the num_of_packet field in the p_tx_test_param parameter is other than 0x0000, BLE_VS_EVENT_TX_TEST_TERM event notifies the application layer that the number of packet has been sent.
If R_BLE_VS_EndTest() is called before the specified number of packets completions, BLE_VS_EVENT_TX_TEST_TERM event is not notified to the application layer.

The condition that phy field in the p_tx_test_param parameter is BLE_VS_EH_TEST_PHY_CODED_S_8(0x03) and option field is modulation(bit0:0) & continuous transmission(bit1:1) is not supported.

Parameters
[in]p_tx_test_paramTx Test parameters.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_tx_test_param parameter is specified as NULL.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)There are no memories for Vendor Specific Command.

◆ R_BLE_VS_StartRxTest()

ble_status_t R_BLE_VS_StartRxTest ( st_ble_vs_rx_test_param_t p_rx_test_param)

This function starts extended Receiver Test.

The result of this API call is notified in BLE_VS_EVENT_RX_TEST_START event. The following extended receiver test functions of DTM Rx are supported by this function.

  • Calculating the maximum, the minimum and the average of RSSI in the receiver test.
  • The number of CRC error packets in the receiver test.

The transmitter is configured to one of the following, the receiver can't receive the packets by this function.

  • Tx Non-Modulation Enable
  • Tx continuous transmission
    After R_BLE_VS_EndTest() has been called, the receiver test result value are notified in BLE_VS_EVENT_TEST_END event.
Parameters
[in]p_rx_test_paramThe extended receiver test parameters.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_rx_test_param parameter is specified as NULL.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)There are no memories for Vendor Specific Command.

◆ R_BLE_VS_EndTest()

ble_status_t R_BLE_VS_EndTest ( void  )

This function terminates the extended transmitter or receiver test.

The result of this API call is notified in BLE_VS_EVENT_TEST_END event. In case of extended receiver test, this event notifies the application layer of the result of the extended receiver test.

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)There are no memories for Vendor Specific Command.

◆ R_BLE_VS_SetTxPower()

ble_status_t R_BLE_VS_SetTxPower ( uint16_t  conn_hdl,
uint8_t  tx_power 
)

This function configures transmit power.

This function configures the following transmit power.

  • The transmit power used in sending advertising PDU, scan request PDU, connection request PDU (in not connected state)
  • The transmit power used in sending PDU in connected state. When configuring the transmit power used in not connected state, set the conn_hdl parameter to BLE_GAP_INIT_CONN_HDL(0xFFFF).
    When the transmit power used in connected state is configured, set the conn_hdl parameter to the connection handle of the link.
    Select one of the following transmit power levels.
  • High
  • Middle
  • Low

Max transmit power of "High" is dependent on the configuration of the firmware. The result of this API call is notified in BLE_VS_EVENT_SET_TX_POWER event.

Parameters
[in]conn_hdlConnection handle identifying the link whose transmit power to be configured. If non connected state, set BLE_GAP_INIT_CONN_HDL(0xFFFF).
[in]tx_powerTransmission power. Select one of the following.
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)There are no memories for Vendor Specific Command.

◆ R_BLE_VS_GetTxPower()

ble_status_t R_BLE_VS_GetTxPower ( uint16_t  conn_hdl)

This function gets transmit power.

This function gets the following transmit power.

  • The transmit power used in sending advertising PDU, scan request PDU, connection request PDU (in not connected state)
  • The transmit power used in sending PDU in connected state. When getting the transmit power used in not connected state, set the conn_hdl parameter to BLE_GAP_INIT_CONN_HDL(0xFFFF).
    When the transmit power used in connected state is retrieved, set the conn_hdl parameter to the connection handle of the link. The result of this API call is notified in BLE_VS_EVENT_GET_TX_POWER event.
Parameters
[in]conn_hdlConnection handle identifying the link whose transmit power to be retrieved. If non connected state, set BLE_GAP_INIT_CONN_HDL(0xFFFF).
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)There are no memories for Vendor Specific Command.

◆ R_BLE_VS_SetCodingScheme()

ble_status_t R_BLE_VS_SetCodingScheme ( uint8_t  coding_scheme)

This function configure default Coding scheme(S=8 or S=2) that is used in the case of selecting Coded PHY in Primary advertising PHY or Secondary advertising PHY advertising or request for link establishment.

After setting the default Coding scheme by this function, configure the advertising parameters by R_BLE_GAP_SetAdvParam() or send a request for link establishment.
The result of this API call is notified in BLE_VS_EVENT_SET_CODING_SCHEME_COMP event.

Parameters
[in]coding_schemeCoding scheme for Primary advertising PHY, Secondary advertising PHY, request for link establishment.The coding_scheme field is set to a bitwise OR of the following values.
bit description
bit0 Coding scheme for Primary Advertising PHY(0:S=8/1:S=2).
bit1 Coding scheme for Secondary Advertising PHY(0:S=8/1:S=2).
bit2 Coding scheme for request for link establishment(0:S=8/1:S=2).
All other bits Reserved for future use.
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)There are no memories for Vendor Specific Command.

◆ R_BLE_VS_SetRfControl()

ble_status_t R_BLE_VS_SetRfControl ( st_ble_vs_set_rf_ctrl_param_t p_rf_ctrl)

This function performs power control on RF.

If BLE communication is not used for a long time, RF reduces the power consumption by moving to the RF Power-Down Mode.
When RF power on, RF initialization processing is executed.
After RF power off by this function, API functions other than this are not available until RF power on again.
The result of this API call is notified in BLE_VS_EVENT_RF_CONTROL_COMP event. After RF power on again with this function, call R_BLE_GAP_Terminate(), R_BLE_GAP_Init() in order to restart the host stack.

Parameters
[in]p_rf_ctrlRF parameters.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_rf_ctrl parameter is specified as NULL.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)There are no memories for Vendor Specific Command.

◆ R_BLE_VS_SetBdAddr()

ble_status_t R_BLE_VS_SetBdAddr ( uint8_t  area,
st_ble_dev_addr_t p_addr 
)

This function sets public/random address of local device to the area specified by the parameter.

If the address is written in non-volatile area, the address is used as default address on the next MCU reset.
For more information on the random address, refer to Core Specification Vol 6, PartB, "1.3.2 Random Device Address".
The result of this API call is notified in BLE_VS_EVENT_SET_ADDR_COMP event.

Parameters
[in]areaThe area that the address is to be written in.
Select one of the following.
macro description
BLE_VS_ADDR_AREA_REG(0x00) Address writing to non-volatile area is not performed.
Only the address in register is written.
BLE_VS_ADDR_AREA_DATA_FLASH(0x01) Address wiring to DataFlash area is performed.
[in]p_addrThe address to be set to the area. Set BLE_GAP_ADDR_PUBLIC(0x00) or BLE_GAP_ADDR_RAND(0x01) to the type field in the p_addr parameter.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_addr parameter is specified as NULL.
BLE_ERR_INVALID_STATE(0x0008)The task for host stack is not running.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)There are no memories for Vendor Specific Command.

◆ R_BLE_VS_GetBdAddr()

ble_status_t R_BLE_VS_GetBdAddr ( uint8_t  area,
uint8_t  addr_type 
)

This function gets currently configured public/random address.

The area parameter specifies the place where this function retrieves public/random address.
The result of this API call is notified in BLE_VS_EVENT_GET_ADDR_COMP event.

Parameters
[in]areaThe area that the address is to be retrieved.
Select one of the following.
macro description
BLE_VS_ADDR_AREA_REG(0x00) Retrieve the address in register.
BLE_VS_ADDR_AREA_DATA_FLASH(0x01) Retrieve the address in DataFlash area.
[in]addr_typeThe address type that is type of the address to be retrieved.
macro description
BLE_GAP_ADDR_PUBLIC(0x00) Public address.
BLE_GAP_ADDR_RAND(0x01) Random address.
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)There are no memories for Vendor Specific Command.

◆ R_BLE_VS_GetRand()

ble_status_t R_BLE_VS_GetRand ( uint8_t  rand_size)

This function generates 4-16 bytes of random number used in creating keys.

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

Parameters
[in]rand_sizeLength of the random number (byte).
The valid range is 4<=rand_size<=16.
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)There are no memories for Vendor Specific Command.

◆ R_BLE_VS_StartTxFlowEvtNtf()

ble_status_t R_BLE_VS_StartTxFlowEvtNtf ( void  )

This function starts the notification(BLE_VS_EVENT_TX_FLOW_STATE_CHG event) of the state transition of TxFlow.

If the number of the available transmission packet buffers is the following, BLE_VS_EVENT_TX_FLOW_STATE_CHG event notifies the application layer of the state of the TxFlow.

  • The number of the available transmission packet buffers is less than Low Water Mark.
  • The number of the available transmission packet buffers is more than High Water Mark. The result of this API call is returned by a return value.
    Return values
    BLE_SUCCESS(0x0000)Success

◆ R_BLE_VS_StopTxFlowEvtNtf()

ble_status_t R_BLE_VS_StopTxFlowEvtNtf ( void  )

This function stops the notification(BLE_VS_EVENT_TX_FLOW_STATE_CHG event) of the state transition of TxFlow.

The result of this API call is returned by a return value.

Return values
BLE_SUCCESS(0x0000)Success

◆ R_BLE_VS_GetTxBufferNum()

ble_status_t R_BLE_VS_GetTxBufferNum ( uint32_t *  p_buffer_num)

This function retrieves the number of the available transmission packet buffers.

The maximum number of the available buffers is 10.
The result of this API call is returned by a return value.

Parameters
[out]p_buffer_numThe number of the available transmission packet buffers.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_buffer_num parameter is specified as NULL.

◆ R_BLE_VS_SetTxLimit()

ble_status_t R_BLE_VS_SetTxLimit ( uint32_t  tx_queue_lwm,
uint32_t  tx_queue_hwm 
)

This function sets the threshold for notifying the application layer of the TxFlow state.

Call this function before the notification(BLE_VS_EVENT_TX_FLOW_STATE_CHG event) has been started by R_BLE_VS_StartTxFlowEvtNtf().
The result is returned from this API.
Vendor Specific API supports the flow control function(TxFlow) for the transmission on L2CAP fixed channel in Basic Mode such as GATT.
Host stack has 10 transmission packet buffers for the transmission.
When the number of the available transmission packet buffers has been less than Low Water Mark, the state of TxFlow transmits into the TxFlow OFF state from the TxFlow ON state that is the initial state and host stack notifies the application layer of timing to stop packet transmission.
When host stack has sent the transmission packets to Controller and the number of the available transmission packet buffers has been more than High Water Mark, the state of TxFlow transmits into the TxFlow ON state from the TxFlow OFF state and host stack notifies the application layer of timing to restart packet transmission.
It is possible to perform flow control on a fixed channel by using the event notification.

Parameters
[in]tx_queue_lwmLow Water Mark. Set 0-9 less than tx_queue_hwm to the parameter. When the number of the available transmission packet buffers has been less than the value specified by the tx_queue_lwm parameter, host stack notifies the application layer of the timing to stop packet transmission.
[in]tx_queue_hwmHigh Water Mark. Set 1-10 more than tx_queue_lwm to the parameter. When the number of the available transmission packet buffers has been more than the value specified by the tx_queue_hwm parameter, host stack notifies the application layer of the timing to restart packet transmission.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)The tx_queue_lwm parameter or the tx_queue_hwm parameter is out of range.

◆ R_BLE_VS_SetScanChMap()

ble_status_t R_BLE_VS_SetScanChMap ( uint16_t  ch_map)

This function sets the scan channel map.

Set specify the scan channel for use.
At least one channel must be enabled.

Note
Calling this API while Scan is already running will not change the channel map.
Parameters
[in]ch_mapSpecify the channel map for use.
bit description
bit0 Enable channel 37 for use (0:disable, 1:enable)
bit1 Enable channel 38 for use (0:disable, 1:enable)
bit2 Enable channel 39 for use (0:disable, 1:enable)
All other bits Reserved for future use.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)The ch_map parameter is out of range.

◆ R_BLE_VS_GetScanChMap()

ble_status_t R_BLE_VS_GetScanChMap ( void  )

This function gets currently scan channel map.

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

Return values
BLE_SUCCESS(0x0000)Success

◆ R_BLE_VS_StartFirmwareUpdate()

ble_status_t R_BLE_VS_StartFirmwareUpdate ( void  )

This function starts the firmware update procedure.

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

Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_MODEA command was sent from an invalid mode
BLE_ERR_UNSUPPORTEDThis API does not support

◆ R_BLE_VS_SendFirmwareData()

ble_status_t R_BLE_VS_SendFirmwareData ( uint16_t  index,
uint16_t  length,
uint8_t const *const  p_data 
)

This function sends a firmware update data frame.

Parameters
[in]indexThe index of the current data frame.
[in]lengthThe length of the current data frame.
[in]p_dataA pointer to the data frame.

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

Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARGAn input parameter was invalid
BLE_ERR_INVALID_MODEA command was sent from an invalid mode
BLE_ERR_UNSUPPORTEDThis API does not support

◆ R_BLE_VS_EndFirmwareUpdate()

ble_status_t R_BLE_VS_EndFirmwareUpdate ( uint16_t  end_index)

This function ends the firmware update procedure.

Parameters
[in]end_indexThe index of the last data frame.

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

Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_MODEA command was sent from an invalid mode
BLE_ERR_UNSUPPORTEDThis API does not support

◆ R_BLE_VS_GetFirmwareVersion()

ble_status_t R_BLE_VS_GetFirmwareVersion ( void  )

This function requests the BLE module firmware version.

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

Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_MODEA command was sent from an invalid mode
BLE_ERR_UNSUPPORTEDThis API does not support

◆ R_BLE_VS_RestartModule()

ble_status_t R_BLE_VS_RestartModule ( void  )

This function restarts the module.

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

Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_RSP_TIMEOUTA command did not receive a response
BLE_ERR_INVALID_MODEA command was sent from an invalid mode
BLE_ERR_UNSUPPORTEDThis API does not support