parent
fa63c99ed3
commit
22428230f6
|
@ -19,10 +19,6 @@ public interface LinkConnector extends LinkDecoder {
|
||||||
public void send(String command, boolean fireEvent) {
|
public void send(String command, boolean fireEvent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void restart() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BinaryProtocol getBinaryProtocol() {
|
public BinaryProtocol getBinaryProtocol() {
|
||||||
return null;
|
return null;
|
||||||
|
@ -47,11 +43,6 @@ public interface LinkConnector extends LinkDecoder {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void restart() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BinaryProtocol getBinaryProtocol() {
|
public BinaryProtocol getBinaryProtocol() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
|
@ -63,8 +54,6 @@ public interface LinkConnector extends LinkDecoder {
|
||||||
|
|
||||||
void send(String command, boolean fireEvent) throws InterruptedException;
|
void send(String command, boolean fireEvent) throws InterruptedException;
|
||||||
|
|
||||||
void restart();
|
|
||||||
|
|
||||||
BinaryProtocol getBinaryProtocol();
|
BinaryProtocol getBinaryProtocol();
|
||||||
|
|
||||||
default BinaryProtocolState getBinaryProtocolState() {
|
default BinaryProtocolState getBinaryProtocolState() {
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class LinkManager implements Closeable {
|
||||||
public static final String LOG_VIEWER = "log viewer";
|
public static final String LOG_VIEWER = "log viewer";
|
||||||
private final CommandQueue commandQueue;
|
private final CommandQueue commandQueue;
|
||||||
|
|
||||||
private String lastTriedPort = null;
|
private String lastTriedPort;
|
||||||
|
|
||||||
private LinkConnector connector = LinkConnector.VOID;
|
private LinkConnector connector = LinkConnector.VOID;
|
||||||
private boolean isStarted;
|
private boolean isStarted;
|
||||||
|
@ -278,8 +278,8 @@ public class LinkManager implements Closeable {
|
||||||
close(); // Explicitly kill the connection (call connectors destructor??????)
|
close(); // Explicitly kill the connection (call connectors destructor??????)
|
||||||
|
|
||||||
String[] ports = getCommPorts();
|
String[] ports = getCommPorts();
|
||||||
boolean isPortAvaliableAgain = Arrays.stream(ports).anyMatch(lastTriedPort::equals);
|
boolean isPortAvailableAgain = Arrays.stream(ports).anyMatch(lastTriedPort::equals);
|
||||||
if(isPortAvaliableAgain) {
|
if (isPortAvailableAgain) {
|
||||||
connect(lastTriedPort);
|
connect(lastTriedPort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,15 +49,6 @@ public class StreamConnector implements LinkConnector {
|
||||||
portHolder.close();
|
portHolder.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void restart() {
|
|
||||||
linkManager.execute(() -> {
|
|
||||||
linkManager.messageListener.postMessage(StreamConnector.this.getClass(), "Restarting serial IO");
|
|
||||||
portHolder.close();
|
|
||||||
portHolder.connectAndReadConfiguration(arguments);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String unpack(String packet) {
|
public String unpack(String packet) {
|
||||||
return packet;
|
return packet;
|
||||||
|
|
Loading…
Reference in New Issue