summaryrefslogtreecommitdiffstats
path: root/examples/java/ScannerTinyB10.java
diff options
context:
space:
mode:
Diffstat (limited to 'examples/java/ScannerTinyB10.java')
-rw-r--r--examples/java/ScannerTinyB10.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/java/ScannerTinyB10.java b/examples/java/ScannerTinyB10.java
index 1ec6afc3..730376d9 100644
--- a/examples/java/ScannerTinyB10.java
+++ b/examples/java/ScannerTinyB10.java
@@ -184,12 +184,14 @@ public class ScannerTinyB10 {
private void connectDiscoveredDevice(final BluetoothDevice device) {
println("****** Connecting Device: Start " + device.toString());
device.getAdapter().stopDiscovery();
- boolean res = false;
+ HCIStatusCode res;
if( !USE_WHITELIST ) {
res = device.connect();
+ } else {
+ res = HCIStatusCode.SUCCESS;
}
- println("****** Connecting Device: End result "+res+" of " + device.toString());
- if( !USE_WHITELIST && 0 == devicesInProcessing.size() && !res ) {
+ println("****** Connecting Device Command, res "+res+": End result "+res+" of " + device.toString());
+ if( !USE_WHITELIST && 0 == devicesInProcessing.size() && HCIStatusCode.SUCCESS != res ) {
device.getAdapter().startDiscovery( true );
}
}