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)
[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 )
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 )
N/A |
Enable receiver.
92
of file common/throughput_central/throughput_central.h
throughput_central_disable#
sl_status_t throughput_central_disable (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)
[in] | mode | the transmission mode is either of:
|
[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)
[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)
[in] | tx_power | requested tx power in dBm |
[in] | power_control | enable adaptive power control |
[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)
[in] | min_interval | Minimum connection interval (in 1.25 ms steps) |
[in] | max_interval | Maximum connection interval (in 1.25 ms steps) |
[in] | latency | Responder latency (in connection intervals) |
[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)
[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 )
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 )
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)
[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)
[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 )
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 )
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)
[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)
[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)
[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)
[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 )
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)
[in] | throughput | throughput value in bits/second (bps) |
[in] | count | data volume transmitted, in bytes |
[in] | lost | number of packets lost |
[in] | error | number of wrong packets |
[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)
[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)
[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)
[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)
[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)
[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)
[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)
[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)
[in] | pdu | PDU size in bytes |
[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)
[in] | interval | Connection interval (in 1.25 ms steps) |
[in] | latency | Responder latency (in connection intervals) |
[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)
[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)
[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)
[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)
[in] | addess_str | Address string |
[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 )
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 )
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 )
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 )
N/A |
Event handler
71
of file common/throughput_central/throughput_central_interface.h
Macro Definition Documentation#
THROUGHPUT_CENTRAL_TEST_TYPE#
#define THROUGHPUT_CENTRAL_TEST_TYPEValue:
sl_bt_gatt_notification
19
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_MODE_DEFAULT#
#define THROUGHPUT_CENTRAL_MODE_DEFAULTValue:
THROUGHPUT_MODE_CONTINUOUS
26
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_FIXED_DATA_SIZE#
#define THROUGHPUT_CENTRAL_FIXED_DATA_SIZEValue:
100000
30
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_FIXED_TIME#
#define THROUGHPUT_CENTRAL_FIXED_TIMEValue:
10000
34
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_MTU_SIZE#
#define THROUGHPUT_CENTRAL_MTU_SIZEValue:
247
42
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_DEFAULT_SCAN_PHY#
#define THROUGHPUT_DEFAULT_SCAN_PHYValue:
sl_bt_scanner_scan_phy_1m
48
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_DEFAULT_PHY#
#define THROUGHPUT_DEFAULT_PHYValue:
sl_bt_gap_phy_coding_1m_uncoded
56
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_CONNECTION_INTERVAL_MIN#
#define THROUGHPUT_CENTRAL_CONNECTION_INTERVAL_MINValue:
32
64
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_CONNECTION_INTERVAL_MAX#
#define THROUGHPUT_CENTRAL_CONNECTION_INTERVAL_MAXValue:
32
68
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_CONNECTION_RESPONDER_LATENCY#
#define THROUGHPUT_CENTRAL_CONNECTION_RESPONDER_LATENCYValue:
0
72
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_CONNECTION_TIMEOUT#
#define THROUGHPUT_CENTRAL_CONNECTION_TIMEOUTValue:
1000
76
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_TX_POWER#
#define THROUGHPUT_CENTRAL_TX_POWERValue:
10
84
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_POWER_CONTROL_ENABLE#
#define THROUGHPUT_CENTRAL_POWER_CONTROL_ENABLEValue:
0
88
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_SLEEP_ENABLE#
#define THROUGHPUT_CENTRAL_SLEEP_ENABLEValue:
0
92
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_ALLOWLIST_ENABLE#
#define THROUGHPUT_CENTRAL_ALLOWLIST_ENABLEValue:
0
98
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_1_ENABLE#
#define THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_1_ENABLEValue:
0
102
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_1#
#define THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_1Value:
"00:00:00:00:00:00"
106
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_2_ENABLE#
#define THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_2_ENABLEValue:
0
112
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_2#
#define THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_2Value:
"00:00:00:00:00:00"
116
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_3_ENABLE#
#define THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_3_ENABLEValue:
0
122
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_3#
#define THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_3Value:
"00:00:00:00:00:00"
126
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_4_ENABLE#
#define THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_4_ENABLEValue:
0
132
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_4#
#define THROUGHPUT_CENTRAL_ALLOWLIST_SLOT_4Value:
"00:00:00:00:00:00"
136
of file common/throughput_central/config/throughput_central_config.h
THROUGHPUT_CENTRAL_CHARACTERISTICS_ALL#
#define THROUGHPUT_CENTRAL_CHARACTERISTICS_ALLValue:
0x0F
51
of file common/throughput_central/throughput_central.h
ADR_LEN#
#define ADR_LENValue:
6
52
of file common/throughput_central/throughput_central.h
THROUGHPUT_CENTRAL_REFRESH_TIMER_PERIOD#
#define THROUGHPUT_CENTRAL_REFRESH_TIMER_PERIODValue:
1000
40
of file common/throughput_central/throughput_central_interface.h