summaryrefslogtreecommitdiffstats
path: root/core/java/android/bluetooth
diff options
context:
space:
mode:
authorAndre Eisenbach <eisenbach@google.com>2014-08-21 17:56:24 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-21 17:56:25 +0000
commit491cb3f578a23555c807e68f8a536a892959a73f (patch)
tree0b3298ef7f55682b7ebf5e23ea6051d381fb25c8 /core/java/android/bluetooth
parente5d7411744243889916288a1f95edbb8884b7fc4 (diff)
parent4072da041da2911dd56635b530b276671ce0199d (diff)
downloadframeworks_base-491cb3f578a23555c807e68f8a536a892959a73f.zip
frameworks_base-491cb3f578a23555c807e68f8a536a892959a73f.tar.gz
frameworks_base-491cb3f578a23555c807e68f8a536a892959a73f.tar.bz2
Merge "LE: Rename new MTU and connection paramter update APIs" into lmp-dev
Diffstat (limited to 'core/java/android/bluetooth')
-rw-r--r--core/java/android/bluetooth/BluetoothGatt.java32
-rw-r--r--core/java/android/bluetooth/BluetoothGattCallback.java6
-rw-r--r--core/java/android/bluetooth/BluetoothGattServerCallback.java2
3 files changed, 20 insertions, 20 deletions
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java
index 59d7956..d77a77b 100644
--- a/core/java/android/bluetooth/BluetoothGatt.java
+++ b/core/java/android/bluetooth/BluetoothGatt.java
@@ -96,19 +96,19 @@ public final class BluetoothGatt implements BluetoothProfile {
* Bluetooth SIG. This is the default value if no connection parameter update
* is requested.
*/
- public static final int GATT_CONNECTION_BALANCED = 0;
+ public static final int CONNECTION_PRIORITY_BALANCED = 0;
/**
* Connection paramter update - Request a high priority, low latency connection.
* An application should only request high priority connection paramters to transfer
* large amounts of data over LE quickly. Once the transfer is complete, the application
- * should request {@link BluetoothGatt#GATT_CONNECTION_BALANCED} connectoin parameters
+ * should request {@link BluetoothGatt#CONNECTION_PRIORITY_BALANCED} connectoin parameters
* to reduce energy use.
*/
- public static final int GATT_CONNECTION_HIGH_PRIORITY = 1;
+ public static final int CONNECTION_PRIORITY_HIGH = 1;
/** Connection paramter update - Request low power, reduced data rate connection parameters. */
- public static final int GATT_CONNECTION_LOW_POWER = 2;
+ public static final int CONNECTION_PRIORITY_LOW_POWER = 2;
/**
* No authentication required.
@@ -601,7 +601,7 @@ public final class BluetoothGatt implements BluetoothProfile {
return;
}
try {
- mCallback.onConfigureMTU(BluetoothGatt.this, mtu, status);
+ mCallback.onMtuChanged(BluetoothGatt.this, mtu, status);
} catch (Exception ex) {
Log.w(TAG, "Unhandled exception in callback", ex);
}
@@ -1239,20 +1239,20 @@ public final class BluetoothGatt implements BluetoothProfile {
}
/**
- * Configure the MTU used for a given connection.
+ * Request an MTU size used for a given connection.
*
* <p>When performing a write request operation (write without response),
* the data sent is truncated to the MTU size. This function may be used
- * to request a larget MTU size to be able to send more data at once.
+ * to request a larger MTU size to be able to send more data at once.
*
- * <p>A {@link BluetoothGattCallback#onConfigureMTU} callback will indicate
+ * <p>A {@link BluetoothGattCallback#onMtuChanged} callback will indicate
* whether this operation was successful.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission.
*
* @return true, if the new MTU value has been requested successfully
*/
- public boolean configureMTU(int mtu) {
+ public boolean requestMtu(int mtu) {
if (DBG) Log.d(TAG, "configureMTU() - device: " + mDevice.getAddress()
+ " mtu: " + mtu);
if (mService == null || mClientIf == 0) return false;
@@ -1274,19 +1274,19 @@ public final class BluetoothGatt implements BluetoothProfile {
* remote device.
*
* @param connectionPriority Request a specific connection priority. Must be one of
- * {@link BluetoothGatt#GATT_CONNECTION_BALANCED},
- * {@link BluetoothGatt#GATT_CONNECTION_HIGH_PRIORITY}
- * or {@link BluetoothGatt#GATT_CONNECTION_LOW_POWER}.
+ * {@link BluetoothGatt#CONNECTION_PRIORITY_BALANCED},
+ * {@link BluetoothGatt#CONNECTION_PRIORITY_HIGH}
+ * or {@link BluetoothGatt#CONNECTION_PRIORITY_LOW_POWER}.
* @throws IllegalArgumentException If the parameters are outside of their
* specified range.
*/
- public boolean requestConnectionParameterUpdate(int connectionPriority) {
- if (connectionPriority < GATT_CONNECTION_BALANCED ||
- connectionPriority > GATT_CONNECTION_LOW_POWER) {
+ public boolean requestConnectionPriority(int connectionPriority) {
+ if (connectionPriority < CONNECTION_PRIORITY_BALANCED ||
+ connectionPriority > CONNECTION_PRIORITY_LOW_POWER) {
throw new IllegalArgumentException("connectionPriority not within valid range");
}
- if (DBG) Log.d(TAG, "requestConnectionParameterUpdate() - params: " + connectionPriority);
+ if (DBG) Log.d(TAG, "requestConnectionPriority() - params: " + connectionPriority);
if (mService == null || mClientIf == 0) return false;
try {
diff --git a/core/java/android/bluetooth/BluetoothGattCallback.java b/core/java/android/bluetooth/BluetoothGattCallback.java
index 5817d68..19900ec 100644
--- a/core/java/android/bluetooth/BluetoothGattCallback.java
+++ b/core/java/android/bluetooth/BluetoothGattCallback.java
@@ -143,14 +143,14 @@ public abstract class BluetoothGattCallback {
* Callback indicating the MTU for a given device connection has changed.
*
* This callback is triggered in response to the
- * {@link BluetoothGatt#configureMTU} function, or in response to a connection
+ * {@link BluetoothGatt#requestMtu} function, or in response to a connection
* event.
*
- * @param gatt GATT client invoked {@link BluetoothGatt#configureMTU}
+ * @param gatt GATT client invoked {@link BluetoothGatt#requestMtu}
* @param mtu The new MTU size
* @param status {@link BluetoothGatt#GATT_SUCCESS} if the MTU has been changed successfully
*/
- public void onConfigureMTU(BluetoothGatt gatt, int mtu, int status) {
+ public void onMtuChanged(BluetoothGatt gatt, int mtu, int status) {
}
/**
diff --git a/core/java/android/bluetooth/BluetoothGattServerCallback.java b/core/java/android/bluetooth/BluetoothGattServerCallback.java
index 3a1b38e..b0ddc26 100644
--- a/core/java/android/bluetooth/BluetoothGattServerCallback.java
+++ b/core/java/android/bluetooth/BluetoothGattServerCallback.java
@@ -141,7 +141,7 @@ public abstract class BluetoothGattServerCallback {
* notifications.
*
* @param device The remote device the notification has been sent to
- * @param status 0 if the operation was successful
+ * @param status {@link BluetoothGatt#GATT_SUCCESS} if the operation was successful
*/
public void onNotificationSent(BluetoothDevice device, int status) {
}