Modules#
throughput_central_characteristic_t
throughput_central_characteristic_found_t
Throughput Test Receiver (Central) Role API#
Throughput Test Receiver (Central) Role API opens connection to Throughput Test Transmitter (Peripheral) Role nodes, registers to notifications or indications. 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.
Functions#
Macros#
Function Documentation#
throughput_central_allowlist_add#
bool throughput_central_allowlist_add (uint8_t * address)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t * | [in] | address | BT address in 6 byte format |
Add an address to the allowlist. Returns
true if adding the address was successful
81
of file common/throughput_central/throughput_central.h
throughput_central_allowlist_clear#
bool throughput_central_allowlist_clear (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Clear the allowlist Returns
true if adding the clear was succesful
87
of file common/throughput_central/throughput_central.h
throughput_central_enable#
void throughput_central_enable (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Enable receiver.
92
of file common/throughput_central/throughput_central.h
throughput_central_disable#
sl_status_t throughput_central_disable (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Disable receiver.
97
of file common/throughput_central/throughput_central.h
throughput_central_set_mode#
sl_status_t throughput_central_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 |
Set receiver mode. Returns
status of the operation
108
of file common/throughput_central/throughput_central.h
throughput_central_set_mtu_size#
sl_status_t throughput_central_set_mtu_size (uint8_t mtu)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | mtu | MTU size in bytes |
Set data sizes for reception. Returns
status of the operation
116
of file common/throughput_central/throughput_central.h
throughput_central_set_tx_power#
sl_status_t throughput_central_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 |
Set transmission power. Returns
status of the operation
125
of file common/throughput_central/throughput_central.h
throughput_central_set_connection_parameters#
sl_status_t throughput_central_set_connection_parameters (throughput_time_t min_interval, throughput_time_t max_interval, throughput_time_t latency, throughput_time_t timeout)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_time_t | [in] | min_interval | Minimum connection interval (in 1.25 ms steps) |
throughput_time_t | [in] | max_interval | Maximum connection interval (in 1.25 ms steps) |
throughput_time_t | [in] | latency | Responder latency (in connection intervals) |
throughput_time_t | [in] | timeout | Supervision timeout (in 10 ms steps) |
Set connection parameters. Returns
status of the operation
137
of file common/throughput_central/throughput_central.h
throughput_central_set_type#
sl_status_t throughput_central_set_type (throughput_notification_t type)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_notification_t | [in] | type | type of the test (notification or indication) |
Set type of transmission. Returns
status of the operation
147
of file common/throughput_central/throughput_central.h
throughput_central_start#
sl_status_t throughput_central_start (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Start transmission on remote side. Returns
status of the operation
153
of file common/throughput_central/throughput_central.h
throughput_central_stop#
sl_status_t throughput_central_stop (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Stop transmission on remote side. Returns
status of the operation
159
of file common/throughput_central/throughput_central.h
throughput_central_set_scan_phy#
sl_status_t throughput_central_set_scan_phy (throughput_scan_phy_t phy)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_scan_phy_t | [in] | phy | PHY used for scanning |
Set PHY used for scanning. Returns
status of the operation
166
of file common/throughput_central/throughput_central.h
throughput_central_set_connection_phy#
sl_status_t throughput_central_set_connection_phy (throughput_phy_t phy)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_phy_t | [in] | phy | PHY used for the connection |
Set PHY used for connection. Returns
status of the operation
173
of file common/throughput_central/throughput_central.h
throughput_central_change_phy#
sl_status_t throughput_central_change_phy (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Change PHY to next one.
In case of scanning, it is used for changing between CODED and 1M PHY
In a connection, it is used to change between 1M, 2M and CODED PHYs Returns
status of the operation
181
of file common/throughput_central/throughput_central.h
throughput_central_step#
void throughput_central_step (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Process step for throughput central.
186
of file common/throughput_central/throughput_central.h
bt_on_event_central#
void bt_on_event_central (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.
192
of file common/throughput_central/throughput_central.h
throughput_central_on_role_set#
void throughput_central_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.
219
of file common/throughput_central/throughput_central.h
throughput_central_on_state_change#
void throughput_central_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.
226
of file common/throughput_central/throughput_central.h
throughput_central_on_mode_change#
void throughput_central_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.
233
of file common/throughput_central/throughput_central.h
throughput_central_on_start#
void throughput_central_on_start (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Callback to handle transmission start event. Note
To be implemented in user code.
239
of file common/throughput_central/throughput_central.h
throughput_central_on_finish#
void throughput_central_on_finish (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 transmitted, 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 transmission finished event. Note
To be implemented in user code.
250
of file common/throughput_central/throughput_central.h
throughput_central_on_transmit_power_change#
void throughput_central_on_transmit_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.
261
of file common/throughput_central/throughput_central.h
throughput_central_on_rssi_change#
void throughput_central_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.
268
of file common/throughput_central/throughput_central.h
throughput_central_on_phy_change#
void throughput_central_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.
275
of file common/throughput_central/throughput_central.h
throughput_central_on_notification_change#
void throughput_central_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.
282
of file common/throughput_central/throughput_central.h
throughput_central_on_indication_change#
void throughput_central_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.
289
of file common/throughput_central/throughput_central.h
throughput_central_on_result_indication_change#
void throughput_central_on_result_indication_change (throughput_notification_t result)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_notification_t | [in] | result | result indication status |
Callback to handle result indication changed event. Note
To be implemented in user code.
296
of file common/throughput_central/throughput_central.h
throughput_central_on_data_size_change#
void throughput_central_on_data_size_change (throughput_pdu_size_t data_size)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_pdu_size_t | [in] | data_size | Data size in bytes |
Callback to handle data size change when receiving data. Note
To be implemented in user code.
303
of file common/throughput_central/throughput_central.h
throughput_central_on_connection_settings_change#
void throughput_central_on_connection_settings_change (throughput_pdu_size_t pdu, throughput_mtu_size_t mtu)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_pdu_size_t | [in] | pdu | PDU size in bytes |
throughput_mtu_size_t | [in] | mtu | MTU size in bytes |
Callback to handle connection parameter changes. Note
To be implemented in user code.
311
of file common/throughput_central/throughput_central.h
throughput_central_on_connection_timings_change#
void throughput_central_on_connection_timings_change (throughput_time_t interval, throughput_time_t latency, throughput_time_t timeout)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_time_t | [in] | interval | Connection interval (in 1.25 ms steps) |
throughput_time_t | [in] | latency | Responder latency (in connection intervals) |
throughput_time_t | [in] | timeout | Supervision timeout (in 10 ms steps) |
Callback to handle connection timing changes. Note
To be implemented in user code.
321
of file common/throughput_central/throughput_central.h
throughput_central_on_characteristics_found#
void throughput_central_on_characteristics_found (throughput_central_characteristic_found_t characteristics)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_central_characteristic_found_t | [in] | characteristics | Found characteristics |
Callback to handle characteristic found event. Note
To be implemented in user code.
330
of file common/throughput_central/throughput_central.h
throughput_central_on_discovery_state_change#
void throughput_central_on_discovery_state_change (throughput_discovery_state_t state)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_discovery_state_t | [in] | state | State of the discovery |
Callback to handle discovery state change. Note
To be implemented in user code.
338
of file common/throughput_central/throughput_central.h
throughput_central_calculate#
float throughput_central_calculate (throughput_value_t * throughput)
Type | Direction | Argument Name | Description |
---|---|---|---|
throughput_value_t * | [out] | throughput | calculated throughput value |
Calculate throughput. Returns
the elapsed time in seconds since measurement started
346
of file common/throughput_central/throughput_central.h
throughput_central_decode_address#
bool throughput_central_decode_address (char * addess_str, uint8_t * address)
Type | Direction | Argument Name | Description |
---|---|---|---|
char * | [in] | addess_str | Address string |
uint8_t * | [out] | address | address byte array |
Convert address string to address data bytes. Returns
true if operation was successful
354
of file common/throughput_central/throughput_central.h
waiting_indication#
void waiting_indication (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
ASCII graphics for indicating wait status
45
of file common/throughput_central/throughput_central_interface.h
timer_start#
void timer_start ()
Start timer
50
of file common/throughput_central/throughput_central_interface.h
timer_end#
float timer_end ()
Timer end. The return value of this function shall be the time passed form the timer_start() call in seconds.
56
of file common/throughput_central/throughput_central_interface.h
timer_refresh_rssi_start#
void timer_refresh_rssi_start (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Start RSSI refresh timer
61
of file common/throughput_central/throughput_central_interface.h
timer_refresh_rssi_stop#
void timer_refresh_rssi_stop (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Stop RSSI refresh timer
66
of file common/throughput_central/throughput_central_interface.h
timer_on_refresh_rssi#
void timer_on_refresh_rssi (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Event handler
71
of file common/throughput_central/throughput_central_interface.h