RF Test#
The RF Test component provides low-level APIs to produce an RF tone or a modulated packet. The RF Test component cannot run simultaneously with the Wi-SUN stack and is only meant for production calibration.
Functions#
Return the current status of the RF test plugin.
Handles RF events generated during RF tests.
Stop RF test RX reception.
Must be called before sl_wisun_rf_test_start_tx(), sl_wisun_rf_test_start_rx(), sl_wisun_start_stream() and sl_wisun_start_tone().
Start RF test RX reception on a fixed channel.
Start an RF test packet transmission sequence.
Set transmit power.
Start transmitting a random stream of characters to enable the measurement of radio modulation.
Start transmitting an unmodulated tone.
Stop a previously started stream of characters.
Stop a previously started tone.
Function Documentation#
sl_wisun_is_running_rf_test#
bool sl_wisun_is_running_rf_test ()
Return the current status of the RF test plugin.
Returns
One of the following:
True if a test is running.
False otherwise.
sl_wisun_rf_test_event_callback#
void sl_wisun_rf_test_event_callback (uint64_t events, int8_t rssi)
Handles RF events generated during RF tests.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint64_t | [in] | events | RAIL event mask associated with the RF test event |
| int8_t | [in] | rssi | RSSI in dBm; valid when SL_RAIL_EVENT_RX_PACKET_RECEIVED is set in events, otherwise SL_WISUN_RF_TEST_RSSI_NOT_AVAILABLE |
This callback updates the RF test state based on the RAIL event and should be called when an event of type SL_WISUN_LOGGER_EVENT_TYPE_RF_TEST is received by the application.
sl_wisun_rf_test_rx_stop#
sl_status_t sl_wisun_rf_test_rx_stop (void )
Stop RF test RX reception.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| void | N/A |
This API ends an active RF test RX session started with sl_wisun_rf_test_start_rx().
Returns
One of the following:
SL_STATUS_OK if the RX test stopped successfully.
SL_STATUS_INVALID_STATE if not currently receiving.
SL_STATUS_NOT_SUPPORTED if the feature is not implemented.
sl_wisun_rf_test_set_phy_config#
sl_status_t sl_wisun_rf_test_set_phy_config (sl_wisun_phy_config_t * phy_config)
Must be called before sl_wisun_rf_test_start_tx(), sl_wisun_rf_test_start_rx(), sl_wisun_start_stream() and sl_wisun_start_tone().
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| sl_wisun_phy_config_t * | [in] | phy_config | Pointer to PHY configuration structure |
Sets the phy configuration for the subsequent RF test operations.
Returns
One of the following:
SL_STATUS_OK if the PHY configuration was set successfully.
SL_STATUS_NOT_READY if called before the stack initialization.
SL_STATUS_BUSY if a test is already running.
SL_STATUS_NETWORK_UP if a connection is already established or in progress.
SL_STATUS_NOT_FOUND if the PHY configuration was not found.
sl_wisun_rf_test_start_rx#
sl_status_t sl_wisun_rf_test_start_rx (uint16_t channel, uint32_t duration)
Start RF test RX reception on a fixed channel.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint16_t | [in] | channel | Index of the physical channel to transmit on |
| uint32_t | [in] | duration | Duration in milliseconds (0 = run until stopped) |
This API puts the radio into continuous RX on the given channel for the requested duration. If duration is 0, RX continues until explicitly stopped.
Returns
One of the following:
SL_STATUS_OK if the RX test started successfully.
SL_STATUS_NOT_READY if called before the stack initialization.
SL_STATUS_BUSY if a test is already running.
SL_STATUS_NETWORK_UP if a connection is already established or in progress.
SL_STATUS_INVALID_PARAMETER if an invalid parameter is provided.
SL_STATUS_NOT_SUPPORTED if the feature is not implemented.
sl_wisun_rf_test_start_tx#
sl_status_t sl_wisun_rf_test_start_tx (uint16_t channel, uint16_t count, uint16_t data_length, uint8_t * data, uint32_t interval, bool cca_enabled)
Start an RF test packet transmission sequence.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint16_t | [in] | channel | Index of the physical channel to transmit on |
| uint16_t | [in] | count | Number of packets to transmit (must greater than 0) |
| uint16_t | [in] | data_length | Length of data in each packet (must be between 1 and 2047 - CRC length, typically 2045 for FSK, 2043 for OFDM or OQPSK) |
| uint8_t * | [in] | data | Pointer to data to transmit; if NULL a default ramp pattern is used |
| uint32_t | [in] | interval | Interval between transmissions in milliseconds (must be greater than 0) |
| bool | [in] | cca_enabled | Set true to perform a single CCA check before the initial transmit |
This API schedules repeated packet transmissions on a fixed channel using the currently configured RF test PHY (see sl_wisun_rf_test_set_phy_config()). The packets are sent at a constant interval until the total number of transmissions is reached. If cca_enabled is true, a single CCA check is performed before the initial transmit using the default single-CCA CSMA settings. To receive the packets, another application can use sl_wisun_rf_test_start_rx() on the same channel.
Returns
One of the following:
SL_STATUS_OK if the transmission started successfully.
SL_STATUS_NOT_READY if called before the stack initialization.
SL_STATUS_BUSY if a test is already running.
SL_STATUS_NETWORK_UP if a connection is already established or in progress.
SL_STATUS_INVALID_PARAMETER if an invalid parameter is provided.
SL_STATUS_NOT_SUPPORTED if the feature is not implemented.
sl_wisun_set_test_tx_power#
sl_status_t sl_wisun_set_test_tx_power (int8_t tx_power)
Set transmit power.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| int8_t | [in] | tx_power | Transmit power in units of dBm, can be negative. |
Returns
always SL_STATUS_OK
sl_wisun_start_stream#
sl_status_t sl_wisun_start_stream (uint16_t channel)
Start transmitting a random stream of characters to enable the measurement of radio modulation.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint16_t | [in] | channel | Index of the physical channel to transmit on |
Returns
One of the following:
SL_STATUS_OK if the stream transmission started successfully.
SL_STATUS_NOT_READY if called before the stack initialization.
SL_STATUS_BUSY if a test is already running.
SL_STATUS_NETWORK_UP if a connection is already established or in progress.
SL_STATUS_INVALID_PARAMETER if an invalid channel is configured.
Transmit a PN9 bytes sequence. See sl_rail_start_tx_stream() for more information.
sl_wisun_start_tone#
sl_status_t sl_wisun_start_tone (uint16_t channel)
Start transmitting an unmodulated tone.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint16_t | [in] | channel | Index of the physical channel to transmit on |
Returns
One of the following:
SL_STATUS_OK if the stream transmission started successfully.
SL_STATUS_NOT_READY if called before the stack initialization.
SL_STATUS_BUSY if a test is already running.
SL_STATUS_NETWORK_UP if a connection is already established or in progress.
SL_STATUS_INVALID_PARAMETER if an invalid channel is configured.
Transmit a PN9 bytes sequence. See sl_rail_start_tx_stream() for more information.
sl_wisun_stop_stream#
sl_status_t sl_wisun_stop_stream ()
Stop a previously started stream of characters.
Returns
One of the following:
SL_STATUS_OK if the stream transmission stopped successfully.
SL_STATUS_INVALID_STATE if while not transmitting a stream.
See sl_rail_stop_tx_stream() for more information.
sl_wisun_stop_tone#
sl_status_t sl_wisun_stop_tone ()
Stop a previously started tone.
Returns
One of the following:
SL_STATUS_OK if the tone stopped successfully.
SL_STATUS_INVALID_STATE if while not transmitting a tone.
See sl_rail_stop_tx_stream() for more information.