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

Advertising Interval for Android

As noted here, a lower interval will give quicker connection - but at the expense of power consumption.

With a 4s interval, it seems that it is likely to take several "Scan" attempts (as in the Nordic demo apps) before the device will actually be "seen".

Is there any guidance on how the Advertising Interval affects the time to connect?

(I'm using nRF8001, but I guess that's not particularly relevant here?)

  • Hi awneil,

    The time to connect is not directly correlated to the advertising interval but it is very related. The main issue is how frequently the Android device actually scans for BLE peripherals and how long the scan window remains open. As a developer, you don't have control over these parameters on Android, at least, not that I am aware of unless it changed with Marshmallow.

    A bit more detail: If the device is advertising every 4 seconds and the Android device scans every second for 100 milliseconds, then it may take quite a while for the scan window to actual capture one of the advertising packets from the advertising device. Hopefully that helps make more sense as to why it can take a while. I don't know the exact scanning parameters for any given Android device, so the above is simply an example.

    In my experience with Android and iOS apps, I find that advertising intervals over 2.5 seconds cause a rather long discovery time; even 2.5 seconds causes a long discovery time. Apple provides guidelines with suggested advertising intervals for BLE connectivity with iOS devices. I am not sure that Android devices provide similar suggestions. This is likely due to the very wide variety of Android devices and Bluetooth stacks on those devices. My suggestion is to perform an experiment to help determine the slowest advertising rate that still provides a fast enough discovery but also keeps battery power low. This is a tradeoff you have to make with BLE based designs.

    Cheers,

    Eric

Related