Is there a way to create a command that gets throughput information from a device in the ble_app_interactive example? I want to get the throughput of a peripheral device once it is connected.
Is there a way to create a command that gets throughput information from a device in the ble_app_interactive example? I want to get the throughput of a peripheral device once it is connected.
Hi,
Do you want to measure throughput for transmit or receive? You may create a new repeated timer instance with the app timer library included in the example and count the number of received/transmitted bytes per time unit. It might be easier than trying to port code from the throughput example.
Vidar,
Thank you for your reply! I am now printing the rssi value of peripheral devices in the device display command in the command-line interface. I would like to print the throughput value next to the rssi value to receive.
I understand that the devices will probably need to be connected in order to read the throughput, so should I move the rssi print to another spot with the throughput? Can I incorporate the app timer library in with the cli example?
Thanks so much, Vidar! This helps Where should I go to enable RSSI sampling while connected using the throughput example? I want the RSSI, from one semiconductor to the other, to print out underneath the final throughput value.
Glad you found it helpful:) You can call sd_ble_gap_rssi_start() when the connection has been established to enable RSSI sampling, but keep in mind that the RSSI can vary a lot between packets so I think it would make sense to print out an average RSSI value underneath the final throughput number.
Hello Ella;
Could you please tell me how can you measure the throughput and rssi at the same time, I have tried for sereval days to do this but failed,
I just use the SEGGER open the project as below, this project can do throughput test
then I put the code below (I find them on the Internet) in to the main.c
bu it doesn't work, no rssi data was printed
Maybe you've done it already but the on_ble_evt() function needs to be registered as an observer like nrf_ble_amtc_on_ble_evt and nrf_ble_amts_on_ble_evt in order for it to receive events from the Softdevice Another alternative is to use the existing BLE event handler in amts.c.
E.g., A simple approach. Print RSSI every time it changes with more than 10dB:
diff --git a/examples/ble_central_and_peripheral/experimental/ble_app_att_mtu_throughput/amts.c b/examples/ble_central_and_peripheral/experimental/ble_app_att_mtu_throughput/amts.c index 3810e21..bb3b250 100644 --- a/examples/ble_central_and_peripheral/experimental/ble_app_att_mtu_throughput/amts.c +++ b/examples/ble_central_and_peripheral/experimental/ble_app_att_mtu_throughput/amts.c @@ -66,7 +66,12 @@ static void char_notification_send(nrf_ble_amts_t * p_ctx); */ static void on_connect(nrf_ble_amts_t * p_ctx, ble_evt_t const * p_ble_evt) { + uint32_t err_code; + + err_code = sd_ble_gap_rssi_start(p_ble_evt->evt.gap_evt.conn_handle, 10, 0); + APP_ERROR_CHECK(err_code); p_ctx->conn_handle = p_ble_evt->evt.gap_evt.conn_handle; + } @@ -145,6 +150,10 @@ void nrf_ble_amts_on_ble_evt(ble_evt_t const * p_ble_evt, void * p_context) on_tx_complete(p_ctx); break; + case BLE_GAP_EVT_RSSI_CHANGED: + NRF_LOG_INFO("RSSI: %d", p_ble_evt->evt.gap_evt.params.rssi_changed.rssi); + break; + default: break; }
Thanks very much, I finally get the RSSI successfully .
Thanks very much, I finally get the RSSI successfully .