From 18bfd4108c06669256c7d52d961fe6197eceb202 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 31 May 2020 05:25:57 +0200 Subject: C++/Java Scanner 10: Refine found/connect criteria: Also in EUI48_ANY_DEVICE case, skip devices-in-processing --- examples/java/ScannerTinyB10.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'examples/java') diff --git a/examples/java/ScannerTinyB10.java b/examples/java/ScannerTinyB10.java index 1a97ea84..2f81f54d 100644 --- a/examples/java/ScannerTinyB10.java +++ b/examples/java/ScannerTinyB10.java @@ -91,10 +91,9 @@ public class ScannerTinyB10 { System.err.println("****** FOUND__-2: Skip non public LE "+device.toString()); return; } - if( waitForDevice.equals(EUI48_ANY_DEVICE) || - ( waitForDevice.equals(device.getAddress()) && - !devicesProcessed.contains(waitForDevice) && - !devicesInProcessing.contains(waitForDevice) + if( !devicesInProcessing.contains( device.getAddress() ) && + ( waitForDevice.equals(EUI48_ANY_DEVICE) || + ( waitForDevice.equals(device.getAddress()) && !devicesProcessed.contains(waitForDevice) ) ) ) { System.err.println("****** FOUND__-0: Connecting "+device.toString()); @@ -125,10 +124,9 @@ public class ScannerTinyB10 { return; } - if( waitForDevice.equals(EUI48_ANY_DEVICE) || - ( waitForDevice.equals(device.getAddress()) && - !devicesProcessed.contains(waitForDevice) && - !devicesInProcessing.contains(waitForDevice) + if( !devicesInProcessing.contains( device.getAddress() ) && + ( waitForDevice.equals(EUI48_ANY_DEVICE) || + ( waitForDevice.equals(device.getAddress()) && !devicesProcessed.contains(waitForDevice) ) ) ) { System.err.println("****** CONNECTED-0: Processing "+device.toString()); -- cgit v1.2.3