0

I want to change the Android bluetooth connection parameters to be the CONNECTION_PRIORITY_LOW_POWER from the beginning of connection between an Android phone and BLE. I have tried to add

"mBluetoothGatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_LOW_POWER)"

after the Gatt connection ("mBluetoothGatt = bluetoothDevice.connectGatt(mContext, false, callback)") or before the paring/bonding. But it seems that the commection interval when the connection starts remains to be 50ms, which is the default value set by CONNECTION_PRIORITY_BALANCED. Could you tell me to change the connection interval from the beginning of the connection?

Thanks in advance! Best regards

2 Answers 2

2

Delay your connection priority request (requestConnectionPriority()) until after discovering services.

I believe Android will request a fast connection interval for the service discovery and then switch back to a "standard" interval. It assumes the "start" of your connection is after discovering services, so you must as well.

0

According to Android docs,

boolean requestConnectionPriority (int connectionPriority)

Request a connection parameter update. This function will send a connection parameter update request to the remote device.

You shall choose to connect and immediately choose to request the connection priority even after which you can discover services and subscribe to a notification. This way you do not get notifications at undesired connection intervals.

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