Utility Functionality

Utility Functionality.

Typedefs

typedef void * sl_rtl_util_libitem
Utility library item.

Enumerations

enum sl_rtl_util_parameter { SL_RTL_UTIL_PARAMETER_AMOUNT_OF_FILTERING = 0 }
Util parameter.

Functions

enum sl_rtl_error_code sl_rtl_util_init ( sl_rtl_util_libitem *item)
enum sl_rtl_error_code sl_rtl_util_deinit ( sl_rtl_util_libitem *item)
enum sl_rtl_error_code sl_rtl_util_set_parameter ( sl_rtl_util_libitem *item, enum sl_rtl_util_parameter parameter, float value)
enum sl_rtl_error_code sl_rtl_util_filter ( sl_rtl_util_libitem *item, float value_in, float *value_out)
enum sl_rtl_error_code sl_rtl_util_rssi2distance (float tx_power, float rssi, float *distance_out)
enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_setup ( sl_rtl_util_libitem *item, uint32_t level, uint32_t num_antennas, bool raw_samples)
enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_set_parameters ( sl_rtl_util_libitem *item, uint32_t sample_rate, uint8_t sample_offset, uint8_t samples_in_slot, uint8_t number_of_channels)
enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_set_downsampling_factor ( sl_rtl_util_libitem *item, float dsf)
enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_set_data_offset ( sl_rtl_util_libitem *item, uint32_t offset)
enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_set_switch_pattern ( sl_rtl_util_libitem *item, uint32_t size, uint32_t *pattern)
enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_add_reference ( sl_rtl_util_libitem *item, uint32_t num_samples, float *i_samples, float *q_samples)
enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_add_data ( sl_rtl_util_libitem *item, uint32_t num_snapshots, float **i_samples, float **q_samples, uint8_t channel)
uint32_t sl_rtl_util_iq_sample_qa_get_results ( sl_rtl_util_libitem *item)
enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_get_details ( sl_rtl_util_libitem *item, sl_rtl_clib_iq_sample_qa_dataset_t *iq_sample_qa_results, sl_rtl_clib_iq_sample_qa_antenna_data_t *antenna_data)
enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_get_channel_details ( sl_rtl_util_libitem *item, uint8_t channel, sl_rtl_clib_iq_sample_qa_dataset_t *iq_sample_qa_results, sl_rtl_clib_iq_sample_qa_antenna_data_t *antenna_data)
char * sl_rtl_util_iq_sample_qa_code2string (char *buf, int size, uint32_t code)

Detailed Description

Utility Functionality.

These functions provide supporting functionality such as conversions, additional filtering, diagnostics, and setup.

Typedef Documentation

sl_rtl_util_libitem

typedef void* sl_rtl_util_libitem

Utility library item.

Enumeration Type Documentation

sl_rtl_util_parameter

Util parameter.

Enumerator
SL_RTL_UTIL_PARAMETER_AMOUNT_OF_FILTERING

Amount of filtering in range [0.0f, 1.0f].

Function Documentation

sl_rtl_util_init()

enum sl_rtl_error_code sl_rtl_util_init ( sl_rtl_util_libitem * item )

Initialize the Util libitem instance.

Parameters
[in] item Pointer to the libitem to be initialized.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_deinit()

enum sl_rtl_error_code sl_rtl_util_deinit ( sl_rtl_util_libitem * item )

Deinitialize a Util libitem instance.

Parameters
[in] item Pointer to the libitem to be deinitialized.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_set_parameter()

enum sl_rtl_error_code sl_rtl_util_set_parameter ( sl_rtl_util_libitem * item,
enum sl_rtl_util_parameter parameter,
float value
)

Set util parameters.

Parameters
[in] item Pointer to the initialized Util libitem.
[in] parameter Parameter to change.
[in] value Value of the parameter.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_filter()

enum sl_rtl_error_code sl_rtl_util_filter ( sl_rtl_util_libitem * item,
float value_in,
float * value_out
)

Filter a value using the moving average.

Parameters
[in] item Pointer to the initialized Util libitem.
[in] value_in Value to be fed to the filter.
[out] value_out Pointer to the filtered value.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_rssi2distance()

enum sl_rtl_error_code sl_rtl_util_rssi2distance ( float tx_power,
float rssi,
float * distance_out
)

Convert an RSSI-value to distance in meters.

Parameters
[in] item Pointer to the initialized Util libitem.
[in] tx_power Reference RSSI value of the TX-device at 1.0 m distance in dBm, for example -45.0f.
[in] rssi Measured RSSI from the receiver.
[out] distance_out Distance in meters.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_iq_sample_qa_setup()

enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_setup ( sl_rtl_util_libitem * item,
uint32_t level,
uint32_t num_antennas,
bool raw_samples
)

Set up the IQ sample quality analysis.

Parameters
[in] item Pointer to the initialized Util libitem.
[in] level Analysis level.
[in] num_antennas The number of antennas in the array.
[in] raw_samples Data contains raw samples instead of picked ones.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_iq_sample_qa_set_parameters()

enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_set_parameters ( sl_rtl_util_libitem * item,
uint32_t sample_rate,
uint8_t sample_offset,
uint8_t samples_in_slot,
uint8_t number_of_channels
)

Set up parameters for the IQ sample quality analysis.

Parameters
[in] item Pointer to the initialized Util libitem.
[in] sample_rate The sampling rate.
[in] sample_offset The offset for the picked sample in the sampling slot.
[in] samples_in_slot Number of samples in the sampling slot.
[in] number_of_channels Number of radio channels.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_iq_sample_qa_set_downsampling_factor()

enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_set_downsampling_factor ( sl_rtl_util_libitem * item,
float dsf
)

Set up IQ sample QA downsampling ratio.

Set the downsampling factor used during the antenna samples (related to the sampling rate of the reference period).

Parameters
[in] item Pointer to the initialized Util libitem.
[in] dsf The downsampling factor.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_iq_sample_qa_set_data_offset()

enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_set_data_offset ( sl_rtl_util_libitem * item,
uint32_t offset
)

Set data samples offset.

Set the offset for the data samples from the start of the reference period. The use of this function is optional and, if not given, the default values are used.

Parameters
[in] item Pointer to the initialized Util libitem.
[in] offset The data samples' offset.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_iq_sample_qa_set_switch_pattern()

enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_set_switch_pattern ( sl_rtl_util_libitem * item,
uint32_t size,
uint32_t * pattern
)

Set the switch pattern for the IQ sample quality.

Parameters
[in] item Pointer to the initialized Util libitem.
[in] size The size of the switch pattern.
[in] pattern Array of integers representing the switch pattern.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_iq_sample_qa_add_reference()

enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_add_reference ( sl_rtl_util_libitem * item,
uint32_t num_samples,
float * i_samples,
float * q_samples
)

Feed the IQ sample quality analysis the reference period data.

Parameters
[in] item Pointer to the initialized Util libitem.
[in] num_samples The size of data.
[in] i_samples I-part of the sample data.
[in] q_samples Q-part of the sample data.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_iq_sample_qa_add_data()

enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_add_data ( sl_rtl_util_libitem * item,
uint32_t num_snapshots,
float ** i_samples,
float ** q_samples,
uint8_t channel
)

Feed the IQ sample quality analysis the antenna data.

Parameters
[in] item Pointer to the initialized Util libitem.
[in] num_snapshots The size of the data.
[in] i_samples I-part of the sample data.
[in] q_samples Q-part of the sample data.
[in] channel Radio channel the packet is using.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_iq_sample_qa_get_results()

uint32_t sl_rtl_util_iq_sample_qa_get_results ( sl_rtl_util_libitem * item )

Get the overall results of the IQ sample quality analysis.

Parameters
[in] item Pointer to the initialized Util libitem.
Returns
Bitmask of the failing tests, zero if everything passed

sl_rtl_util_iq_sample_qa_get_details()

enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_get_details ( sl_rtl_util_libitem * item,
sl_rtl_clib_iq_sample_qa_dataset_t * iq_sample_qa_results,
sl_rtl_clib_iq_sample_qa_antenna_data_t * antenna_data
)

Get the detailed results of the IQ sample quality analysis.

Parameters
[in] item Pointer to the initialized Util libitem.
[out] iq_sample_qa_results The data structure with data related to the previous data packet.
[out] antenna_data The array of antenna-specific results.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_iq_sample_qa_get_channel_details()

enum sl_rtl_error_code sl_rtl_util_iq_sample_qa_get_channel_details ( sl_rtl_util_libitem * item,
uint8_t channel,
sl_rtl_clib_iq_sample_qa_dataset_t * iq_sample_qa_results,
sl_rtl_clib_iq_sample_qa_antenna_data_t * antenna_data
)

Get the detailed results of the IQ sample quality analysis for the specified radio channel.

Parameters
[in] item Pointer to the initialized Util libitem.
[in] channel Radio channel to show results for.
[out] iq_sample_qa_results The data structure with data related to the last data packet using the requested channel.
[out] antenna_data The array of antenna specific results.
Returns
SL_RTL_ERROR_SUCCESS if successful

sl_rtl_util_iq_sample_qa_code2string()

char* sl_rtl_util_iq_sample_qa_code2string ( char * buf,
int size,
uint32_t code
)

Write the IQ sample quality analysis code as human readable strings in the provided buffer.

Parameters
[in] buf Buffer for the results to be written.
[in] size Size of the buffer.
[in] code The results previously received from the sl_rtl_util_iq_sample_qa_get_results() .
Returns
pointer to the buffer containing data, or to a constant string