Hi,
I am a beginner in nRF52840, I am using 802.15.4 example to calculate the speed of 802.15.4 radio driver.
As per nrf_802154_received_timestamp we can get the timestamp when the last symbol of the frame was received (in us).
and nrf_802154_first_symbol_timestamp_get we can get the timestamp of the beginning of the first preamble symbol of a given frame (in us).
By calculating the timestamp difference can be we calculate the throughput of 802.15.4 radio driver.
I have used the below code in the receiver application to calculate throughput. Please verify it.
void nrf_802154_received_timestamp(uint8_t * p_data, uint8_t length, int8_t power, uint8_t lqi, uint32_t time)
{
(void)length;
(void)power;
(void)lqi;
(void)time;
uint32_t first_symbol_timestamp;
float time_duration_us;
float speed_in_kbps;
first_symbol_timestamp = nrf_802154_first_symbol_timestamp_get(time, length);
NRF_LOG_INFO("time %x first_symbol_timestamp = %x ", time, first_symbol_timestamp);
time_duration_us = (float)(time - first_symbol_timestamp);
speed_in_kbps = (float)(((length*8*1000000)/time_duration_us)/1000);
NRF_LOG_INFO("speed_in_kbps = " NRF_LOG_FLOAT_MARKER " kbps\n", NRF_LOG_FLOAT(speed_in_kbps));
nrf_802154_buffer_free(p_data);
}