diff options
| author | 2018-02-04 01:22:41 +0000 | |
|---|---|---|
| committer | 2018-02-04 01:22:41 +0000 | |
| commit | f0b64acdeddc46b15179d876e45b43492fc2703d (patch) | |
| tree | 2fe8efd2de80b03e6ff42cc8ec69a661d926d507 | |
| parent | 8c04bd60a70cac35d49aef011afb652c67726823 (diff) | |
| parent | 1f3b4644711f20cb6a6ff80ab1dc6e3c35e28b0e (diff) | |
Merge "Merge "Add function to update LE connection parameters" am: 853628db72 am: c3afcfc38c am: a4c600cb03"
| -rw-r--r-- | core/java/android/bluetooth/BluetoothGatt.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java index a2af3422eaec..3df433643b00 100644 --- a/core/java/android/bluetooth/BluetoothGatt.java +++ b/core/java/android/bluetooth/BluetoothGatt.java @@ -1507,6 +1507,38 @@ public final class BluetoothGatt implements BluetoothProfile { } /** + * Request an LE connection parameter update. + * + * <p>This function will send an LE connection parameters update request to the remote device. + * + * @return true, if the request is send to the Bluetooth stack. + * @hide + */ + public boolean requestLeConnectionUpdate(int minConnectionInterval, + int maxConnectionInterval, + int slaveLatency, int supervisionTimeout) { + if (DBG) { + Log.d(TAG, "requestLeConnectionUpdate() - min=(" + minConnectionInterval + + ")" + (1.25 * minConnectionInterval) + + "msec, max=(" + maxConnectionInterval + ")" + + (1.25 * maxConnectionInterval) + "msec, latency=" + slaveLatency + + ", timeout=" + supervisionTimeout + "msec"); + } + if (mService == null || mClientIf == 0) return false; + + try { + mService.leConnectionUpdate(mClientIf, mDevice.getAddress(), + minConnectionInterval, maxConnectionInterval, + slaveLatency, supervisionTimeout); + } catch (RemoteException e) { + Log.e(TAG, "", e); + return false; + } + + return true; + } + + /** * Not supported - please use {@link BluetoothManager#getConnectedDevices(int)} * with {@link BluetoothProfile#GATT} as argument * |