This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What is the latency between central and peripheral communication?

Hello, I am using ble_app_uart_c and ble_app_uart example for data transmission between central and peripheral. I am able to transmit data successfully. I would like to know the time difference between transmission and reception. Are there any methods to find this?

  • What do you mean by time difference? The basic timing constant on BLE link is connection interval. However there can be several PDU exchanged during interval (if ready in the stack before it starts) so PDUs can come faster then interval. On the other hand it's radio so any packet can be lost because of noise and interference. So there is no "exact" latency, just something average and probable. Beside that radio waves travel at speed of light so once packet is really decoded by receiver there is basically no latency between Tx and Rx. And finally to make it even more messy most of BLE stacks work asynchronously and actual delays between higher layers sending data to lower layers and Link layer sending actual PDU can be anything up to one connection interval (+ packet loss), on receiving side the connection event must end to propagate data to higher layers (so again it can take up to one connection interval) = any kind of delay from 0 to 2 connection intervals.

    Please elaborate what situation is really your concern.

  • I established connection between central and peripheral. And I am able to transmit data from central to peripheral. Lets assume that central transmitted data at time t1 and peripheral received the transmitted data at time t2. I would like to know the difference between t1 and t2. Are there any methods to achieve this?

  • Your question technically don't make sense. By "methods to achieve it" you mean method to measure it or what? On physical layer it's radio wave traveling at the speed of light. On 10 meters it means less then 0.1 microsecond. I guess we don't need to speak about this. So I assume you speak about different delta on some higher BLE stack layer but for that you will need to speak in the right language of Bluetooth specification or at least Nordic Soft Device API calls, otherwise it's impossible to answer.

Related