Android 6.0 Marshmallow BLE : Connection Parameters Android 6.0 Marshmallow BLE : Connection Parameters android android

Android 6.0 Marshmallow BLE : Connection Parameters


Compare method connectionParameterUpdate() from GattService.java in AOSP 6.0.1_r17 vs AOSP 5.1.1_r14. In both instances, call goes all the way to Buedroid in BTA_DmBleUpdateConnectionParams() in bta_dm_api.c with same params.

6.0:

    switch (connectionPriority)    {        case BluetoothGatt.CONNECTION_PRIORITY_HIGH:            minInterval = 9; // 11.25ms            maxInterval = 12; // 15ms            break;        case BluetoothGatt.CONNECTION_PRIORITY_LOW_POWER:            minInterval = 80; // 100ms            maxInterval = 100; // 125ms            latency = 2;            break;    }

5.1:

    switch (connectionPriority)    {        case BluetoothGatt.CONNECTION_PRIORITY_HIGH:            minInterval = 6; // 7.5ms            maxInterval = 8; // 10ms            break;        case BluetoothGatt.CONNECTION_PRIORITY_LOW_POWER:            minInterval = 80; // 100ms            maxInterval = 100; // 125ms            latency = 2;            break;    }

This might be a part of the answer to your question. Although BLE allows down to 7.5ms CI, I cannot speculate why link layer would not switch to lower CI on request by peripheral. I don't know if any part of android code controls outcome of negotiations with peripheral device.


Google has not provided any documentation about the Bluetooth LE stack changes concerning connection parameter changes even though there have clearly been some in Android 6.

My experience with it has been the same as your own, that being that 11.25ms is now the fastest connection interval allowed in Android 6+.

My educated guess as to why they don't release documentation is that many manufacturers put their own BLE stacks into their phones (the BLE on Samsung and HTC behave differently from vanilla Android).

One other observation I have made that caused a great deal of problems is that Android 6+ will change the connection parameters 2 to 6 times before settling on the requested parameters.

I observed that after requesting a connection parameter update interval of 800ms to 1100ms, I saw the initial interval come back at 7.5ms, that then jumped to 48.75ms and then jumped to the 1098.75ms I requested. Then I subscribed to notifications on one of my services and the connection interval again jumped back to 7.5ms and then back to 1098.75ms. After this, it stabilized at 1098.75ms for the duration of the connection.

These tests were run on a Nexus 6 with Android 6.0.1

Obviously, some very strange things are happening on the Android 6 BLE stack.


11.25 ms is the new minimum connection interval. The reason they don't allow 7.5 ms anymore is because if you stream audio over bluetooth at the same time the audio might became choppy.