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)

Function Documentation#

throughput_peripheral_enable#

void throughput_peripheral_enable (void )
Parameters
N/A

Enables the transmission.


Definition at line 70 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_disable#

sl_status_t throughput_peripheral_disable (void )
Parameters
N/A

Disables the transmission.


Definition at line 75 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_set_mode#

sl_status_t throughput_peripheral_set_mode (throughput_mode_t mode, uint32_t amount)
Parameters
[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

[in]amount

the time in ms or data in bytes to transfer

Sets the the transmission mode. Returns

  • status of the operation


Definition at line 86 of file common/throughput_peripheral/throughput_peripheral.h

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
[in]mtu

MTU size in bytes

[in]ind_data

indication data size (1-MTU-3)

[in]not_data

notification data size (1-MTU-3)

Sets the the transmission sizes. Returns

  • status of the operation


Definition at line 96 of file common/throughput_peripheral/throughput_peripheral.h

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
[in]tx_power

requested TX power in dBm

[in]power_control

enable adaptive power control

[in]deep_sleep

enable deep sleep during test

Sets the transmission power. Returns

  • status of the operation


Definition at line 107 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_start#

sl_status_t throughput_peripheral_start (throughput_notification_t type)
Parameters
[in]type

type of the test (notification or indication)

Starts the the transmission. Returns

  • status of the operation


Definition at line 116 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_stop#

sl_status_t throughput_peripheral_stop (void )
Parameters
N/A

Stops the transmission. Returns

  • status of the operation


Definition at line 122 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_bt_event#

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

Event coming from the Bluetooth stack.

Bluetooth stack event handler.


Definition at line 128 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_step#

void throughput_peripheral_step (void )
Parameters
N/A

Process step for throughput peripheral.


Definition at line 133 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_sleep_on_isr_exit#

sl_power_manager_on_isr_exit_t throughput_peripheral_sleep_on_isr_exit (void )
Parameters
N/A

Routine for power manager handler Returns

  • SL_POWER_MANAGER_WAKEUP if the test has been started


Definition at line 139 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_is_ok_to_sleep#

bool throughput_peripheral_is_ok_to_sleep (void )
Parameters
N/A

Checks if it is ok to sleep now Returns

  • false if the test has been started


Definition at line 145 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_role_set#

void throughput_peripheral_on_role_set (throughput_role_t role)
Parameters
[in]role

the role can be only THROUGHPUT_ROLE_PERIPHERAL

Callback to handle role settings. Note

  • To be implemented in user code.


Definition at line 156 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_state_change#

void throughput_peripheral_on_state_change (throughput_state_t state)
Parameters
[in]state

current state

Callback to handle state change. Note

  • To be implemented in user code.


Definition at line 163 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_mode_change#

void throughput_peripheral_on_mode_change (throughput_mode_t mode)
Parameters
[in]mode

current mode

Callback to handle mode change. Note

  • To be implemented in user code.


Definition at line 170 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_start#

void throughput_peripheral_on_start (void )
Parameters
N/A

Callback to handle transmission start event. Note

  • To be implemented in user code.


Definition at line 176 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_finish#

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

throughput value in bits/second (bps)

[in]count

data volume transmitted, in bytes

Callback to handle transmission finished event. Note

  • To be implemented in user code.


Definition at line 184 of file common/throughput_peripheral/throughput_peripheral.h

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
[in]throughput

throughput value in bits/second (bps)

[in]count

data volume received, in bytes

[in]lost

number of packets lost

[in]error

number of wrong packets

[in]time

total measurement time

Callback to handle reception finished event. Note

  • To be implemented in user code.


Definition at line 196 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_power_change#

void throughput_peripheral_on_power_change (throughput_tx_power_t power)
Parameters
[in]power

TX power in dBm

Callback to handle TX power changed event. Note

  • To be implemented in user code.


Definition at line 207 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_rssi_change#

void throughput_peripheral_on_rssi_change (throughput_rssi_t rssi)
Parameters
[in]rssi

RSSI value

Callback to handle RSSI changed event. Note

  • To be implemented in user code.


Definition at line 214 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_phy_change#

void throughput_peripheral_on_phy_change (throughput_phy_t phy)
Parameters
[in]phy

PHY that is in use

Callback to handle phy changed event. Note

  • To be implemented in user code.


Definition at line 221 of file common/throughput_peripheral/throughput_peripheral.h

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
[in]interval

connection interval

[in]pdu

PDU size in bytes

[in]mtu

MTU size in bytes

[in]data

data size in bytes

Callback to handle connection settings changes. Note

  • To be implemented in user code.


Definition at line 231 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_notification_change#

void throughput_peripheral_on_notification_change (throughput_notification_t notification)
Parameters
[in]notification

notification status

Callback to handle notification changed event. Note

  • To be implemented in user code.


Definition at line 241 of file common/throughput_peripheral/throughput_peripheral.h

throughput_peripheral_on_indication_change#

void throughput_peripheral_on_indication_change (throughput_notification_t indication)
Parameters
[in]indication

indication status

Callback to handle indication changed event. Note

  • To be implemented in user code.


Definition at line 248 of file common/throughput_peripheral/throughput_peripheral.h

Macro Definition Documentation#

THROUGHPUT_PERIPHERAL_MODE_DEFAULT#

#define THROUGHPUT_PERIPHERAL_MODE_DEFAULT
Value:
THROUGHPUT_MODE_CONTINUOUS

Definition at line 20 of file common/throughput_peripheral/config/throughput_peripheral_config.h

THROUGHPUT_PERIPHERAL_FIXED_DATA_SIZE#

#define THROUGHPUT_PERIPHERAL_FIXED_DATA_SIZE
Value:
100000

Definition at line 24 of file common/throughput_peripheral/config/throughput_peripheral_config.h

THROUGHPUT_PERIPHERAL_FIXED_TIME#

#define THROUGHPUT_PERIPHERAL_FIXED_TIME
Value:
10000

Definition at line 28 of file common/throughput_peripheral/config/throughput_peripheral_config.h

THROUGHPUT_PERIPHERAL_TX_POWER#

#define THROUGHPUT_PERIPHERAL_TX_POWER
Value:
10

Definition at line 36 of file common/throughput_peripheral/config/throughput_peripheral_config.h

THROUGHPUT_PERIPHERAL_TX_POWER_CONTROL_ENABLE#

#define THROUGHPUT_PERIPHERAL_TX_POWER_CONTROL_ENABLE
Value:
0

Definition at line 40 of file common/throughput_peripheral/config/throughput_peripheral_config.h

THROUGHPUT_PERIPHERAL_TX_SLEEP_ENABLE#

#define THROUGHPUT_PERIPHERAL_TX_SLEEP_ENABLE
Value:
0

Definition at line 44 of file common/throughput_peripheral/config/throughput_peripheral_config.h

THROUGHPUT_PERIPHERAL_MTU_SIZE#

#define THROUGHPUT_PERIPHERAL_MTU_SIZE
Value:
247

Definition at line 52 of file common/throughput_peripheral/config/throughput_peripheral_config.h

THROUGHPUT_PERIPHERAL_DATA_TRANSFER_SIZE_INDICATIONS#

#define THROUGHPUT_PERIPHERAL_DATA_TRANSFER_SIZE_INDICATIONS
Value:
0

Definition at line 57 of file common/throughput_peripheral/config/throughput_peripheral_config.h

THROUGHPUT_PERIPHERAL_DATA_TRANSFER_SIZE_NOTIFICATIONS#

#define THROUGHPUT_PERIPHERAL_DATA_TRANSFER_SIZE_NOTIFICATIONS
Value:
0

Definition at line 61 of file common/throughput_peripheral/config/throughput_peripheral_config.h

THROUGHPUT_PERIPHERAL_CHARACTERISTICS_ALL#

#define THROUGHPUT_PERIPHERAL_CHARACTERISTICS_ALL
Value:
0x07

Definition at line 44 of file common/throughput_peripheral/throughput_peripheral.h