0
votes

I'm writing a small test application to assess a Bluetooth module.

The app is currently scanning with the aggressive match mode and low latency scan mode. We have control of the advertising interval of the Bluetooth module, and are trying to assess how many adverts are required to trigger a callback in android.

Does anyone know the interval and windows of the android BLE scans associated with the low latency, balanced, and low power scan mode settings?

I've found this (How to set BLE scan interval and windows no just choose mode in android?) SO question, however if i start my Bluetooth device advertising 5000ms after my android device starts scanning it is found within 3000ms. (which indicates the the 5000ms interval, 5000ms window is incorrect?)

1

1 Answers

2
votes

They aren't documented.

You can see the source at https://android.googlesource.com/platform/packages/apps/Bluetooth/+/master/src/com/android/bluetooth/gatt/ScanManager.java if you search under "Scan params corresponding to regular scan setting". You will need to look at the history to see how the values have been changed between different Android versions.

The current values at the time of this post are the following:

    /**
     * Scan params corresponding to regular scan setting
     */
    private static final int SCAN_MODE_LOW_POWER_WINDOW_MS = 512;
    private static final int SCAN_MODE_LOW_POWER_INTERVAL_MS = 5120;
    private static final int SCAN_MODE_BALANCED_WINDOW_MS = 1024;
    private static final int SCAN_MODE_BALANCED_INTERVAL_MS = 4096;
    private static final int SCAN_MODE_LOW_LATENCY_WINDOW_MS = 4096;
    private static final int SCAN_MODE_LOW_LATENCY_INTERVAL_MS = 4096;

You can also fetch the hci snoop log and see which scan parameters it tells the controller to use. Note that there parameters are just a suggestion, according to the specification. The controller may use different values depending on other concurrent radio activities.