public interface ConnectionPriorityCallback
On Android, requesting connection parameters is available since Android Lollipop using
BluetoothGatt.requestConnectionPriority(int). There are 3 options
available: BluetoothGatt.CONNECTION_PRIORITY_LOW_POWER,
BluetoothGatt.CONNECTION_PRIORITY_BALANCED and
BluetoothGatt.CONNECTION_PRIORITY_HIGH. See
Request.newConnectionPriorityRequest(int) for details.
Until Android 8.0 Oreo, there was no callback indicating whether the change has succeeded,
or not. Also, when a Central or Peripheral requested connection parameters change without
explicit calling of this method, the application was not aware of it.
Android Oreo added a hidden callback to BluetoothGattCallback
notifying about connection parameters change. Those values will be reported with this callback.
| Modifier and Type | Method and Description |
|---|---|
void |
onConnectionUpdated(android.bluetooth.BluetoothDevice device,
int interval,
int latency,
int timeout)
Callback indicating the connection parameters were updated.
|
void onConnectionUpdated(@NonNull
android.bluetooth.BluetoothDevice device,
int interval,
int latency,
int timeout)
device - the target device.interval - Connection interval used on this connection, 1.25ms unit. Valid range is from
6 (7.5ms) to 3200 (4000ms).latency - Slave latency for the connection in number of connection events. Valid range
is from 0 to 499.timeout - Supervision timeout for this connection, in 10ms unit. Valid range is from 10
(100 ms = 0.1s) to 3200 (32s).