Throughput Test Transmitter (Peripheral) Role API#

Throughput Test Transmitter (Peripheral) Role API acts as a server and accepts connection from Throughput Test Receivers (Central) Role clients. It sends out data via notifications or indications to a registered Central node. Throughput parameters can be managed using the API calls or via CLI. The API provides interface for configuring, starting and stopping transmission. Status and result callbacks can be also registered using the API.

Modules#

throughput_peripheral_characteristic_t

throughput_peripheral_characteristic_found_t

Functions#

sl_status_t
throughput_peripheral_set_mode(throughput_mode_t mode, uint32_t amount)
sl_status_t
throughput_peripheral_set_data_size(uint8_t mtu, uint8_t ind_data, uint8_t not_data)
sl_status_t
throughput_peripheral_set_tx_power(throughput_tx_power_t tx_power, bool power_control, bool deep_sleep)
sl_status_t
throughput_peripheral_start(throughput_notification_t type)
void
sl_power_manager_on_isr_exit_t
void
throughput_peripheral_on_role_set(throughput_role_t role)
void
throughput_peripheral_on_state_change(throughput_state_t state)
void
throughput_peripheral_on_mode_change(throughput_mode_t mode)
void
throughput_peripheral_on_finish(throughput_value_t throughput, throughput_count_t count)
void
throughput_peripheral_on_finish_reception(throughput_value_t throughput, throughput_count_t count, throughput_count_t lost, throughput_count_t error, throughput_time_t time)
void
throughput_peripheral_on_power_change(throughput_tx_power_t power)
void
throughput_peripheral_on_rssi_change(throughput_rssi_t rssi)
void
void
throughput_peripheral_on_connection_settings_change(throughput_time_t interval, throughput_pdu_size_t pdu, throughput_mtu_size_t mtu, throughput_data_size_t data)
void
throughput_peripheral_on_notification_change(throughput_notification_t notification)
void
throughput_peripheral_on_indication_change(throughput_notification_t indication)

Macros#

#define
THROUGHPUT_PERIPHERAL_MODE_DEFAULT THROUGHPUT_MODE_CONTINUOUS
#define
THROUGHPUT_PERIPHERAL_FIXED_DATA_SIZE 100000
#define
THROUGHPUT_PERIPHERAL_FIXED_TIME 10000
#define
THROUGHPUT_PERIPHERAL_TX_POWER 10
#define
THROUGHPUT_PERIPHERAL_TX_POWER_CONTROL_ENABLE 0
#define
THROUGHPUT_PERIPHERAL_TX_SLEEP_ENABLE 0
#define
THROUGHPUT_PERIPHERAL_MTU_SIZE 247
#define
THROUGHPUT_PERIPHERAL_DATA_TRANSFER_SIZE_INDICATIONS 0
#define
THROUGHPUT_PERIPHERAL_DATA_TRANSFER_SIZE_NOTIFICATIONS 0
#define
THROUGHPUT_PERIPHERAL_CHARACTERISTICS_ALL 0x07

Function Documentation#

throughput_peripheral_enable#

void throughput_peripheral_enable (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Enables the transmission.


throughput_peripheral_disable#

sl_status_t throughput_peripheral_disable (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Disables the transmission.


throughput_peripheral_set_mode#

sl_status_t throughput_peripheral_set_mode (throughput_mode_t mode, uint32_t amount)
Parameters
TypeDirectionArgument NameDescription
throughput_mode_t[in]mode

the transmission mode is either of:

  • THROUGHPUT_MODE_CONTINOUS: transfer until stop

  • THROUGHPUT_MODE_FIXED_TIME: transfer data for a fixed time

  • THROUGHPUT_MODE_FIXED_DATA: a fixed amount of data to transfer

uint32_t[in]amount

the time in ms or data in bytes to transfer

Sets the the transmission mode. Returns

  • status of the operation


throughput_peripheral_set_data_size#

sl_status_t throughput_peripheral_set_data_size (uint8_t mtu, uint8_t ind_data, uint8_t not_data)
Parameters
TypeDirectionArgument NameDescription
uint8_t[in]mtu

MTU size in bytes

uint8_t[in]ind_data

indication data size (1-MTU-3)

uint8_t[in]not_data

notification data size (1-MTU-3)

Sets the the transmission sizes. Returns

  • status of the operation


throughput_peripheral_set_tx_power#

sl_status_t throughput_peripheral_set_tx_power (throughput_tx_power_t tx_power, bool power_control, bool deep_sleep)
Parameters
TypeDirectionArgument NameDescription
throughput_tx_power_t[in]tx_power

requested TX power in dBm

bool[in]power_control

enable adaptive power control

bool[in]deep_sleep

enable deep sleep during test

Sets the transmission power. Returns

  • status of the operation


throughput_peripheral_start#

sl_status_t throughput_peripheral_start (throughput_notification_t type)
Parameters
TypeDirectionArgument NameDescription
throughput_notification_t[in]type

type of the test (notification or indication)

Starts the the transmission. Returns

  • status of the operation


throughput_peripheral_stop#

sl_status_t throughput_peripheral_stop (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Stops the transmission. Returns

  • status of the operation


throughput_peripheral_on_bt_event#

void throughput_peripheral_on_bt_event (sl_bt_msg_t * evt)
Parameters
TypeDirectionArgument NameDescription
sl_bt_msg_t *[in]evt

Event coming from the Bluetooth stack.

Bluetooth stack event handler.


throughput_peripheral_step#

void throughput_peripheral_step (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Process step for throughput peripheral.


throughput_peripheral_sleep_on_isr_exit#

sl_power_manager_on_isr_exit_t throughput_peripheral_sleep_on_isr_exit (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Routine for power manager handler Returns

  • SL_POWER_MANAGER_WAKEUP if the test has been started


throughput_peripheral_is_ok_to_sleep#

bool throughput_peripheral_is_ok_to_sleep (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Checks if it is ok to sleep now Returns

  • false if the test has been started


throughput_peripheral_on_role_set#

void throughput_peripheral_on_role_set (throughput_role_t role)
Parameters
TypeDirectionArgument NameDescription
throughput_role_t[in]role

the role can be only THROUGHPUT_ROLE_PERIPHERAL

Callback to handle role settings. Note

  • To be implemented in user code.


throughput_peripheral_on_state_change#

void throughput_peripheral_on_state_change (throughput_state_t state)
Parameters
TypeDirectionArgument NameDescription
throughput_state_t[in]state

current state

Callback to handle state change. Note

  • To be implemented in user code.


throughput_peripheral_on_mode_change#

void throughput_peripheral_on_mode_change (throughput_mode_t mode)
Parameters
TypeDirectionArgument NameDescription
throughput_mode_t[in]mode

current mode

Callback to handle mode change. Note

  • To be implemented in user code.


throughput_peripheral_on_start#

void throughput_peripheral_on_start (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Callback to handle transmission start event. Note

  • To be implemented in user code.


throughput_peripheral_on_finish#

void throughput_peripheral_on_finish (throughput_value_t throughput, throughput_count_t count)
Parameters
TypeDirectionArgument NameDescription
throughput_value_t[in]throughput

throughput value in bits/second (bps)

throughput_count_t[in]count

data volume transmitted, in bytes

Callback to handle transmission finished event. Note

  • To be implemented in user code.


throughput_peripheral_on_finish_reception#

void throughput_peripheral_on_finish_reception (throughput_value_t throughput, throughput_count_t count, throughput_count_t lost, throughput_count_t error, throughput_time_t time)
Parameters
TypeDirectionArgument NameDescription
throughput_value_t[in]throughput

throughput value in bits/second (bps)

throughput_count_t[in]count

data volume received, in bytes

throughput_count_t[in]lost

number of packets lost

throughput_count_t[in]error

number of wrong packets

throughput_time_t[in]time

total measurement time

Callback to handle reception finished event. Note

  • To be implemented in user code.


throughput_peripheral_on_power_change#

void throughput_peripheral_on_power_change (throughput_tx_power_t power)
Parameters
TypeDirectionArgument NameDescription
throughput_tx_power_t[in]power

TX power in dBm

Callback to handle TX power changed event. Note

  • To be implemented in user code.


throughput_peripheral_on_rssi_change#

void throughput_peripheral_on_rssi_change (throughput_rssi_t rssi)
Parameters
TypeDirectionArgument NameDescription
throughput_rssi_t[in]rssi

RSSI value

Callback to handle RSSI changed event. Note

  • To be implemented in user code.


throughput_peripheral_on_phy_change#

void throughput_peripheral_on_phy_change (throughput_phy_t phy)
Parameters
TypeDirectionArgument NameDescription
throughput_phy_t[in]phy

PHY that is in use

Callback to handle phy changed event. Note

  • To be implemented in user code.


throughput_peripheral_on_connection_settings_change#

void throughput_peripheral_on_connection_settings_change (throughput_time_t interval, throughput_pdu_size_t pdu, throughput_mtu_size_t mtu, throughput_data_size_t data)
Parameters
TypeDirectionArgument NameDescription
throughput_time_t[in]interval

connection interval

throughput_pdu_size_t[in]pdu

PDU size in bytes

throughput_mtu_size_t[in]mtu

MTU size in bytes

throughput_data_size_t[in]data

data size in bytes

Callback to handle connection settings changes. Note

  • To be implemented in user code.


throughput_peripheral_on_notification_change#

void throughput_peripheral_on_notification_change (throughput_notification_t notification)
Parameters
TypeDirectionArgument NameDescription
throughput_notification_t[in]notification

notification status

Callback to handle notification changed event. Note

  • To be implemented in user code.


throughput_peripheral_on_indication_change#

void throughput_peripheral_on_indication_change (throughput_notification_t indication)
Parameters
TypeDirectionArgument NameDescription
throughput_notification_t[in]indication

indication status

Callback to handle indication changed event. Note

  • To be implemented in user code.