Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

BLE Performance Issue – Increased Latency When Running Scan Algorithm via iPad

I'm developing an application in Swift using Xcode on an iPad Pro. The app communicates over BLE with a custom hardware board.

The board runs a scan algorithm in response to commands from the iPad application. When testing the scan algorithm on the board independently, it completes in approximately 35 ms. However, when triggered via BLE communication from the iPad, the same algorithm takes around 150 ms to complete (roughly equivalent to 3 BLE messages).

Is this level of latency expected when using BLE on iOS, or is there a way to reduce it? I’d appreciate any guidance on improving the performance.

Thank you!

It is unclear from your description what exactly is taking too long. What is this scan?

Are you scanning for a BLE peripheral? Time to discovery is determined by the scan window and advertising intervals. If it is something else, I can't comment on that.

In any case, whether such a scan is triggered by a BLE command or a button on the board should not make a difference. You need to debug your board's code to make sure the settings and the path taken by the code is not adding a latency based on what the trigger is for the scan function.

If you find that the command that triggers the function is taking too long, first you should isolate the delay of sending the command and receipt by your board to determine how long exactly (if any) is due to BLE transmission of the command.

Once you are certain the delay is being caused by the BLE transmission, then you can try to optimize your time by playing around with the connection parameters.

The parameters your board can request (not guaranteed to be accepted) are Latency, Timeout, Connection Interval.

Although, iOS/iPadOS may reject the parameters and use default values if the requested parameters do not match the following rules:

Connection parameter requests may be rejected if they do not meet the guidelines in this section. General connection parameter request guidelines:

  • Peripheral Latency ≤ 30 connection intervals.
  • Supervision Timeout from 6 seconds to 18 seconds.
  • Interval Min ≥ 15 ms.
  • Interval Min ≤ 2 seconds.
  • Interval Min is a multiple of 15 ms.
  • One of the following:
    • Interval Max at least 15 ms greater than Interval Min.
    • Interval Max and Interval Min are both 15 ms.
  • Interval Max * (Peripheral Latency + 1) of 6 seconds or less.
  • Supervision Timeout greater than Interval Max * (Peripheral Latency + 1) * 3.

If at the time of sending the command, the board is not connected, and sending the command includes first connecting to the board by the app, then there will also be a delay in establishing a connection. In that case, to decrease the time to connect, you need to decrease the advertising interval. An advertising interval of 20ms will give you the best results.


Argun Tekant /  DTS Engineer / Core Technologies

BLE Performance Issue – Increased Latency When Running Scan Algorithm via iPad
 
 
Q