diff options
author | Sven Gothel <[email protected]> | 2020-10-23 06:56:52 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-10-23 06:56:52 +0200 |
commit | 0a71109c4105d2b9f3880a83252c39f8720eb832 (patch) | |
tree | 0e1c9a087823ea5aee07c12c5507c37f41f27248 /examples/java/ScannerTinyB02.java | |
parent | fcbe2b39e5eb5bf2aafc876bdf5e6bf1a300f3ae (diff) |
AdapterStatusListener::discoveringChanged: Add meta ScanType and changed ScanType for the changedEnabled value; Expose meta ScanType.
The additional information in the callback is essential in a LE + BREDR environment.
User can also see the current meta ScanType.
ScanType is exposed to Java.
Java's BluetoothAdapter also adds 'ScanType getCurrentScanType()', exposing the last sent meta ScanType.
DBTAdapter.java stores the meta ScanType instead of a boolean flag, hence we can react on LE only scanning for example.
DBTAdapter can call all discovery callbacks for all ScanTypes now.
Diffstat (limited to 'examples/java/ScannerTinyB02.java')
-rw-r--r-- | examples/java/ScannerTinyB02.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/java/ScannerTinyB02.java b/examples/java/ScannerTinyB02.java index 815d5876..d8409397 100644 --- a/examples/java/ScannerTinyB02.java +++ b/examples/java/ScannerTinyB02.java @@ -42,6 +42,7 @@ import org.tinyb.BluetoothUtils; import org.tinyb.EIRDataTypeSet; import org.tinyb.GATTCharacteristicListener; import org.tinyb.HCIStatusCode; +import org.tinyb.ScanType; /** * Test and debugging application for certain situation. @@ -147,8 +148,8 @@ public class ScannerTinyB02 { } @Override - public void discoveringChanged(final BluetoothAdapter adapter, final boolean enabled, final boolean keepAlive, final long timestamp) { - System.err.println("****** DISCOVERING: enabled "+enabled+", keepAlive "+keepAlive+" on "+adapter); + public void discoveringChanged(final BluetoothAdapter adapter, final ScanType currentMeta, final ScanType changedType, final boolean changedEnabled, final boolean keepAlive, final long timestamp) { + System.err.println("****** DISCOVERING: meta "+currentMeta+", changed["+changedType+", enabled "+changedEnabled+", keepAlive "+keepAlive+"] on "+adapter); System.err.println("Status Adapter:"); System.err.println(adapter.toString()); } |