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#
Macros#
Function Documentation#
throughput_peripheral_enable#
void throughput_peripheral_enable (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Enables the transmission.
throughput_peripheral_disable#
sl_status_t throughput_peripheral_disable (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Disables the transmission.
throughput_peripheral_set_mode#
sl_status_t throughput_peripheral_set_mode (throughput_mode_t mode, uint32_t amount)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_mode_t | [in] | mode | the transmission mode is either of:
|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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 )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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)
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_bt_msg_t * | [in] | evt | Event coming from the Bluetooth stack. |
Bluetooth stack event handler.
throughput_peripheral_step#
void throughput_peripheral_step (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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 )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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 )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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 )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_notification_t | [in] | indication | indication status |
Callback to handle indication changed event. Note
To be implemented in user code.