diff options
author | Sven Gothel <[email protected]> | 2022-05-06 10:54:01 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-05-06 10:54:01 +0200 |
commit | 7b1b83bfa1041c4c93cb6eac0c4994c2bd44f6b8 (patch) | |
tree | 33c627e75ca4d65c17836c8d49a5684f0a3489ed /examples/java/DBTPeripheral00.java | |
parent | b3d62d2336744481bc83377d780d9ac79f534207 (diff) |
API Change: AdapterStatusListener::deviceConnected(): `const uint16_t handle` -> `const bool discovered`
Motivation:
- the connection handle is known to the device already and can be retrieved, redundant information
- the flag discovered gives information whether BTAdapter has sent out a deviceFound message, i.e. the user actually issued the connection (default).
We like to detect issues where devices are automatically connected by the underlying host implementation,
i.e. BlueZ/kernel's whitelist mechanism or otherwise - an unsusal and undesired situation.
In such case, no `DEVICE FOUND` advertising is promoted and the underlying BlueZ/kernel
issues the connection itself.
Here `discovered` will be `false`.
Diffstat (limited to 'examples/java/DBTPeripheral00.java')
-rw-r--r-- | examples/java/DBTPeripheral00.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/java/DBTPeripheral00.java b/examples/java/DBTPeripheral00.java index df4ac622..00b3f7ad 100644 --- a/examples/java/DBTPeripheral00.java +++ b/examples/java/DBTPeripheral00.java @@ -272,8 +272,8 @@ public class DBTPeripheral00 { } @Override - public void deviceConnected(final BTDevice device, final short handle, final long timestamp) { - BTUtils.println(System.err, "****** CONNECTED: "+device.toString()); + public void deviceConnected(final BTDevice device, final boolean discovered, final long timestamp) { + BTUtils.println(System.err, "****** CONNECTED (discovered "+discovered+"): "+device.toString()); final boolean available = null == getDevice(); if( available ) { setDevice(device); |