aboutsummaryrefslogtreecommitdiffstats
path: root/java/direct_bt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-05-28 06:06:46 +0200
committerSven Gothel <[email protected]>2020-05-28 06:06:46 +0200
commit9f91fa9a33a35a893555e68a761db5a600d96867 (patch)
tree7884010c54e9b78b2fd19196a88f83092aede945 /java/direct_bt
parent1da27ac4831a6ae64e059ec29eb186e653a1a4e5 (diff)
DBTDevice/BluetoothDevice: Expose getCreationTimestamp() and add BluetoothAddressType getAddressType()
Diffstat (limited to 'java/direct_bt')
-rw-r--r--java/direct_bt/tinyb/DBTDevice.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/java/direct_bt/tinyb/DBTDevice.java b/java/direct_bt/tinyb/DBTDevice.java
index 18f52783..c9ea2647 100644
--- a/java/direct_bt/tinyb/DBTDevice.java
+++ b/java/direct_bt/tinyb/DBTDevice.java
@@ -29,6 +29,7 @@ import java.util.List;
import java.util.Map;
import org.tinyb.AdapterStatusListener;
+import org.tinyb.BluetoothAddressType;
import org.tinyb.BluetoothDevice;
import org.tinyb.BluetoothException;
import org.tinyb.BluetoothGattCharacteristic;
@@ -43,6 +44,7 @@ public class DBTDevice extends DBTObject implements BluetoothDevice
{
private final DBTAdapter adapter;
private final String address;
+ private final BluetoothAddressType addressType;
private final String name;
private final long ts_creation;
long ts_update;
@@ -81,11 +83,14 @@ public class DBTDevice extends DBTObject implements BluetoothDevice
};
- /* pp */ DBTDevice(final long nativeInstance, final DBTAdapter adptr, final String address, final String name, final long ts_creation)
+ /* pp */ DBTDevice(final long nativeInstance, final DBTAdapter adptr,
+ final String address, final int intAddressType,
+ final String name, final long ts_creation)
{
super(nativeInstance, compHash(address, name));
this.adapter = adptr;
this.address = address;
+ this.addressType = BluetoothAddressType.get(intAddressType);
this.name = name;
this.ts_creation = ts_creation;
ts_update = ts_creation;
@@ -123,6 +128,9 @@ public class DBTDevice extends DBTObject implements BluetoothDevice
}
@Override
+ public final long getCreationTimestamp() { return ts_creation; }
+
+ @Override
public DBTAdapter getAdapter() {
return adapter;
}
@@ -131,6 +139,9 @@ public class DBTDevice extends DBTObject implements BluetoothDevice
public String getAddress() { return address; }
@Override
+ public BluetoothAddressType getAddressType() { return addressType; }
+
+ @Override
public String getName() { return name; }
@Override