Skip to content

Commit

Permalink
Investigate JSSC connector removal fix #858
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefillc committed Aug 15, 2019
1 parent 0994f3d commit ec80aaf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
10 changes: 1 addition & 9 deletions java_console/io/src/com/rusefi/io/serial/PortHolder.java
Expand Up @@ -119,15 +119,7 @@ public IoStream getStream() {
}

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);
} else {
stream = SerialIoStreamJSSC.open(port, BAUD_RATE, FileLog.LOGGER);
}
stream = SerialIoStreamJSerialComm.open(port, BAUD_RATE, FileLog.LOGGER);
if (stream == null) {
isConnected = false;
return this;
Expand Down
Expand Up @@ -10,6 +10,8 @@
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
* 5/11/2015.
*/
Expand Down Expand Up @@ -61,7 +63,7 @@ public static SerialIoStreamJSSC open(String port, int baudRate, Logger logger)
public void close() {
isClosed = true;
try {
FileLog.MAIN.logLine("CLOSING PORT... " + serialPort.getPortName());
FileLog.MAIN.logLine("CLOSING PORT... " + serialPort.getPortName());
serialPort.removeEventListener();
serialPort.closePort();
FileLog.MAIN.logLine("PORT CLOSED: " + serialPort.getPortName());
Expand Down
Expand Up @@ -69,7 +69,7 @@ public void write(byte[] bytes) {
}

public static IoStream open(String port, int baudRate, Logger logger) {
logger.info("[SerialIoStreamJSerialComm]");
logger.info("[SerialIoStreamJSerialComm] " + port);
SerialPort sp = SerialPort.getCommPort(port);
sp.setBaudRate(baudRate);
sp.openPort();
Expand Down

0 comments on commit ec80aaf

Please sign in to comment.