serial sandbox

This commit is contained in:
rusefillc 2022-02-11 08:50:53 -05:00
parent 48e77b163d
commit a605d319ba
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
package com.rusefi.binaryprotocol.test;
import com.rusefi.autodetect.PortDetector;
import com.rusefi.io.LinkManager;
import java.util.concurrent.CountDownLatch;
public class SerialSandbox {
public static void main(String[] args) {
String port = PortDetector.autoDetectSerial(callbackContext -> null).getSerialPort();
System.out.println("Serial detected on " + port);
LinkManager linkManager = new LinkManager();
CountDownLatch connected = linkManager.connect(port);
if (connected.getCount() > 0)
throw new IllegalStateException("Not connected in time");
}
}