2

I want to make sure the latency between my app and the bluetooth headphones is accounted for, but I have absolutely no idea how I can get this value. The closest thing I found was: BluetoothLEPreferredConnectionParameters.ConnectionLatency which is only available on Windows 11... Otherwise there isn't much to go on.

Any help would be appreciated.

Thanks, Peter

1 Answer 1

3

It's very difficult to get the exact latency because it is affected by many parameters - but you're on the right track by guessing that the connection parameters are a factor of this equation. I don't have much knowledge on UWP, but I can give you the general parameters that affect the speed/latency, and then you can check their availability in the API or even contact Windows technical team to see if these are supported.

When you make a connection with a remote device, the following factors impact the speed/latency of the connection:-

  • Connection Interval: this specifies the interval at which the packets are sent during a connection. The lower the value, the higher the speed. The minimum value as per the Bluetooth spec is 7.5ms.
  • Slave Latency: this is the value you originally mentioned - it specifies the number of packets that can be missed before a connection is considered lost. A value of 0 means that you have the fastest most robust connection.
  • Connection PHY: this is the modulation on which the packets are sent. If both devices support 2MPHY, then the connection should be quicker.
  • Data Length/MTU Extension: these are two separate features but I am looping them together becuase the effect is the same - more bytes are sent per packet, which results in a higher throughput. The maximum value is 251 bytes per packet.

You can find more information about these parameters here:-

And below are some other links that might help you understand what is supported on UWP:-

1
  • 1
    Thanks for your reply Youssif. Appreciate it. I'll definitely take a look at these sources. My boss used iOS and says that there's a precalculated parameter that you can use that tells you the latency and you can simply calculate it in. Was hoping UWP would provide something like this but if not then I'll be trying to access as many of these properties as I can. I'll keep you posted.
    – pma07pg
    Commented Jan 19, 2022 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.