diff options
author | Sven Gothel <[email protected]> | 2020-07-27 07:33:12 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-07-27 07:33:12 +0200 |
commit | 6e71e6e8fcf1a075d2b14ce5b2f18081cb436abd (patch) | |
tree | 8d047dadc1488f3a091d9df7ed58d830821c5cef /examples/java/HelloTinyB.java | |
parent | b7d7d08c108fb3a1d17d3542dce1f942f6bb4059 (diff) |
C++/Java *Device::connect*(..), disconnect(): Return HCIStatusCode instead of just boolean, passing through potential HCI error detail
The HCIStatusCode on failed connect*/disconnect commands issued via direct_bt HCI,
could help applications making a better fail-recovery decision than just having the binary result.
Diffstat (limited to 'examples/java/HelloTinyB.java')
-rw-r--r-- | examples/java/HelloTinyB.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/java/HelloTinyB.java b/examples/java/HelloTinyB.java index 77435de6..b6709b7f 100644 --- a/examples/java/HelloTinyB.java +++ b/examples/java/HelloTinyB.java @@ -11,6 +11,7 @@ import org.tinyb.BluetoothFactory; import org.tinyb.BluetoothGattCharacteristic; import org.tinyb.BluetoothGattService; import org.tinyb.BluetoothManager; +import org.tinyb.HCIStatusCode; public class HelloTinyB { static boolean running = true; @@ -149,7 +150,7 @@ public class HelloTinyB { System.out.print("Found device: "); printDevice(sensor); - if (sensor.connect()) + if ( HCIStatusCode.SUCCESS == sensor.connect() ) System.out.println("Sensor with the provided address connected"); else { System.out.println("Could not connect device."); |