trigger and VSS hw integrated testing #1668
This commit is contained in:
parent
a9b2f32eb4
commit
3990fd109f
|
@ -38,6 +38,7 @@ public class SerialAutoChecker implements Runnable {
|
||||||
public void run() {
|
public void run() {
|
||||||
IoStream stream = SerialIoStreamJSerialComm.openPort(serialPort);
|
IoStream stream = SerialIoStreamJSerialComm.openPort(serialPort);
|
||||||
IncomingDataBuffer incomingData = stream.getDataBuffer();
|
IncomingDataBuffer incomingData = stream.getDataBuffer();
|
||||||
|
boolean isPortFound = false;
|
||||||
try {
|
try {
|
||||||
HelloCommand.send(stream);
|
HelloCommand.send(stream);
|
||||||
byte[] response = incomingData.getPacket("");
|
byte[] response = incomingData.getPacket("");
|
||||||
|
@ -50,14 +51,19 @@ public class SerialAutoChecker implements Runnable {
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
callback.apply(stream);
|
callback.apply(stream);
|
||||||
}
|
}
|
||||||
result.set(serialPort);
|
isPortFound = true;
|
||||||
portFound.countDown();
|
|
||||||
}
|
}
|
||||||
} catch (IOException ignore) {
|
} catch (IOException ignore) {
|
||||||
return;
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
stream.close();
|
stream.close();
|
||||||
}
|
}
|
||||||
|
if (isPortFound) {
|
||||||
|
/**
|
||||||
|
* propagating result after closing the port so that it could be used right away
|
||||||
|
*/
|
||||||
|
result.set(serialPort);
|
||||||
|
portFound.countDown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue