Investigate JSSC connector removal fix #858

This commit is contained in:
rusefi 2019-08-14 22:33:15 -04:00
parent 0994f3db9d
commit ec80aaffaa
3 changed files with 5 additions and 11 deletions

View File

@ -119,15 +119,7 @@ public class PortHolder {
} }
public EstablishConnection invoke() { public EstablishConnection invoke() {
// todo: BUG: Mac version 10 also 'is windows10 == true' at the moment :)
boolean windows10 = isWindows10();
FileLog.MAIN.logLine("Is windows10: " + windows10);
if (windows10) {
// this implementation is way simpler but seems to kind of work, keeping just in case
stream = SerialIoStreamJSerialComm.open(port, BAUD_RATE, FileLog.LOGGER); stream = SerialIoStreamJSerialComm.open(port, BAUD_RATE, FileLog.LOGGER);
} else {
stream = SerialIoStreamJSSC.open(port, BAUD_RATE, FileLog.LOGGER);
}
if (stream == null) { if (stream == null) {
isConnected = false; isConnected = false;
return this; return this;

View File

@ -10,6 +10,8 @@ import jssc.SerialPortException;
import java.io.IOException; import java.io.IOException;
/** /**
* JSSC connector does not seem to be supported and might have some issues like inability to close/re-open connection nicely
* <p>
* (c) Andrey Belomutskiy * (c) Andrey Belomutskiy
* 5/11/2015. * 5/11/2015.
*/ */

View File

@ -69,7 +69,7 @@ public class SerialIoStreamJSerialComm implements IoStream {
} }
public static IoStream open(String port, int baudRate, Logger logger) { public static IoStream open(String port, int baudRate, Logger logger) {
logger.info("[SerialIoStreamJSerialComm]"); logger.info("[SerialIoStreamJSerialComm] " + port);
SerialPort sp = SerialPort.getCommPort(port); SerialPort sp = SerialPort.getCommPort(port);
sp.setBaudRate(baudRate); sp.setBaudRate(baudRate);
sp.openPort(); sp.openPort();