summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/le/ScanResult.java
diff options
context:
space:
mode:
authorJakub Pawlowski <jpawlowski@google.com>2017-04-12 08:51:22 -0700
committerJakub Pawlowski <jpawlowski@google.com>2017-04-12 10:57:03 -0700
commit9582b46a4b3b91c36295c9d771a9d5cc07fb10e8 (patch)
tree079c4b4b1416aeed49d0c90409cf39b76f1c9f6e /framework/java/android/bluetooth/le/ScanResult.java
parent6acf2c8b4bee0aec004bc3dcf8643f4d9bb09a82 (diff)
Bluetooth 5 PHY simplification
Having PHY_LE_* constants defined in four different places, with one value being different than others is misleading. Leave just PHY_LE_* definitions in BluetoothDevice, and add PHY_LE*_MASK for the mask used in PHY update API. This patch also removes need to translate PHY value between PHY update request and event, as mask is used for request, and the value is returned in event. Bug: 30622771 Test: manual Change-Id: I897effa1204a024465d55501c83c542566c4d37c
Diffstat (limited to 'framework/java/android/bluetooth/le/ScanResult.java')
-rw-r--r--framework/java/android/bluetooth/le/ScanResult.java25
1 files changed, 5 insertions, 20 deletions
diff --git a/framework/java/android/bluetooth/le/ScanResult.java b/framework/java/android/bluetooth/le/ScanResult.java
index 745cd16c78..5b2fa406cd 100644
--- a/framework/java/android/bluetooth/le/ScanResult.java
+++ b/framework/java/android/bluetooth/le/ScanResult.java
@@ -47,21 +47,6 @@ public final class ScanResult implements Parcelable {
public static final int PHY_UNUSED = 0x00;
/**
- * Bluetooth LE 1Mbit advertiser PHY.
- */
- public static final int PHY_LE_1M = 0x01;
-
- /**
- * Bluetooth LE 2Mbit advertiser PHY.
- */
- public static final int PHY_LE_2M = 0x02;
-
- /**
- * Bluetooth LE Coded advertiser PHY.
- */
- public static final int PHY_LE_CODED = 0x03;
-
- /**
* Advertising Set ID is not present in the packet.
*/
public static final int SID_NOT_PRESENT = 0xFF;
@@ -112,7 +97,7 @@ public final class ScanResult implements Parcelable {
mRssi = rssi;
mTimestampNanos = timestampNanos;
mEventType = (DATA_COMPLETE << 5) | ET_LEGACY_MASK | ET_CONNECTABLE_MASK;
- mPrimaryPhy = PHY_LE_1M;
+ mPrimaryPhy = BluetoothDevice.PHY_LE_1M;
mSecondaryPhy = PHY_UNUSED;
mAdvertisingSid = SID_NOT_PRESENT;
mTxPower = 127;
@@ -256,16 +241,16 @@ public final class ScanResult implements Parcelable {
/**
* Returns the primary Physical Layer
* on which this advertisment was received.
- * Can be one of {@link ScanResult#PHY_LE_1M} or
- * {@link ScanResult#PHY_LE_CODED}.
+ * Can be one of {@link BluetoothDevice#PHY_LE_1M} or
+ * {@link BluetoothDevice#PHY_LE_CODED}.
*/
public int getPrimaryPhy() { return mPrimaryPhy; }
/**
* Returns the secondary Physical Layer
* on which this advertisment was received.
- * Can be one of {@link ScanResult#PHY_LE_1M},
- * {@link ScanResult#PHY_LE_2M}, {@link ScanResult#PHY_LE_CODED}
+ * Can be one of {@link BluetoothDevice#PHY_LE_1M},
+ * {@link BluetoothDevice#PHY_LE_2M}, {@link BluetoothDevice#PHY_LE_CODED}
* or {@link ScanResult#PHY_UNUSED} - if the advertisement
* was not received on a secondary physical channel.
*/