summaryrefslogtreecommitdiffstats
path: root/examples/java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-07-28 10:50:12 +0200
committerSven Gothel <[email protected]>2021-07-28 10:50:12 +0200
commitc7b62da9a528de1e032c5189178af0ab60fff5b1 (patch)
treee44ed239eafb4b8db8bd23f1281879d77a960679 /examples/java
parentd02d3d11d4a67b0951e671ff4273bda02594906f (diff)
Add BTAdapter::[getV|v]isibleAddressAndType[()] and BTAdapter::get[Address->AddressAndType]() using BDAddressAndType, preparing for random address
Thoroughly changes - 'EUI48 AdapterInfo::address' -> 'BDAddressAndType AdapterInfo::addressAndType' - BTAdapter C++ - BTAdapter and its DBTAdapter/DBusAdapter implementations (Java) Motivation: - The adapter's address as initially reported by the system is always its public address, i.e. BDAddressType::BDADDR_LE_PUBLIC - The adapter's visible BDAddressAndType might be set to BDAddressType::BDADDR_LE_RANDOM before scanning / discovery mode (TODO).
Diffstat (limited to 'examples/java')
-rw-r--r--examples/java/DBTScanner10.java4
-rw-r--r--examples/java/ScannerTinyB00.java2
-rw-r--r--examples/java/ScannerTinyB01.java2
-rw-r--r--examples/java/ScannerTinyB02.java2
4 files changed, 5 insertions, 5 deletions
diff --git a/examples/java/DBTScanner10.java b/examples/java/DBTScanner10.java
index 4345815d..25ef619e 100644
--- a/examples/java/DBTScanner10.java
+++ b/examples/java/DBTScanner10.java
@@ -202,7 +202,7 @@ public class DBTScanner10 {
{
executeOffThread( () -> { startDiscovery(adapter, "powered-on"); },
- "DBT-StartDiscovery-"+adapter.getAddress(), true /* detach */);
+ "DBT-StartDiscovery-"+adapter.getAddressAndType(), true /* detach */);
}
}
@@ -343,7 +343,7 @@ public class DBTScanner10 {
}
if( 0 < RESET_ADAPTER_EACH_CONN && 0 == deviceReadyCount.get() % RESET_ADAPTER_EACH_CONN ) {
executeOffThread( () -> { resetAdapter(device.getAdapter(), 1); },
- "DBT-Reset-"+device.getAdapter().getAddress(), true /* detach */ );
+ "DBT-Reset-"+device.getAdapter().getAddressAndType(), true /* detach */ );
}
}
diff --git a/examples/java/ScannerTinyB00.java b/examples/java/ScannerTinyB00.java
index be34b609..6b10a2bb 100644
--- a/examples/java/ScannerTinyB00.java
+++ b/examples/java/ScannerTinyB00.java
@@ -129,7 +129,7 @@ public class ScannerTinyB00 {
}
adapter = adapters.get(dev_id);
if( !adapter.isPowered() ) {
- System.err.println("Adapter not enabled: device "+adapter.getName()+", address "+adapter.getAddress()+": "+adapter.toString());
+ System.err.println("Adapter not enabled: device "+adapter.getName()+", address "+adapter.getAddressAndType()+": "+adapter.toString());
System.exit(-1);
}
}
diff --git a/examples/java/ScannerTinyB01.java b/examples/java/ScannerTinyB01.java
index e5c229db..67fed321 100644
--- a/examples/java/ScannerTinyB01.java
+++ b/examples/java/ScannerTinyB01.java
@@ -153,7 +153,7 @@ public class ScannerTinyB01 {
}
adapter = adapters.get(dev_id);
if( !adapter.isPowered() ) {
- System.err.println("Adapter not enabled: device "+adapter.getName()+", address "+adapter.getAddress()+": "+adapter.toString());
+ System.err.println("Adapter not enabled: device "+adapter.getName()+", address "+adapter.getAddressAndType()+": "+adapter.toString());
System.exit(-1);
}
}
diff --git a/examples/java/ScannerTinyB02.java b/examples/java/ScannerTinyB02.java
index 2f1cf9de..67938901 100644
--- a/examples/java/ScannerTinyB02.java
+++ b/examples/java/ScannerTinyB02.java
@@ -129,7 +129,7 @@ public class ScannerTinyB02 {
}
adapter = adapters.get(dev_id);
if( !adapter.isPowered() ) {
- System.err.println("Adapter not enabled: device "+adapter.getName()+", address "+adapter.getAddress()+": "+adapter.toString());
+ System.err.println("Adapter not enabled: device "+adapter.getName()+", address "+adapter.getAddressAndType()+": "+adapter.toString());
System.exit(-1);
}
}