mirror of https://github.com/rusefi/rusefi-1.git
removing some dead code
This commit is contained in:
parent
ef4bd1bf35
commit
3343c02a1d
|
@ -51,7 +51,7 @@ public class Elm327Connector implements Closeable {
|
||||||
public Elm327Connector(IoStream underlyingStream) {
|
public Elm327Connector(IoStream underlyingStream) {
|
||||||
this.underlyingStream = underlyingStream;
|
this.underlyingStream = underlyingStream;
|
||||||
underlyingStream.setInputListener(listener);
|
underlyingStream.setInputListener(listener);
|
||||||
tsStream = new Elm327IoStream(this, "elm327Stream");
|
tsStream = new Elm327IoStream(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,7 +15,6 @@ import java.util.Arrays;
|
||||||
*/
|
*/
|
||||||
public class Elm327IoStream extends AbstractIoStream {
|
public class Elm327IoStream extends AbstractIoStream {
|
||||||
private final Elm327Connector con;
|
private final Elm327Connector con;
|
||||||
private final DisconnectListener disconnectListener;
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final IncomingDataBuffer dataBuffer;
|
private final IncomingDataBuffer dataBuffer;
|
||||||
private DataListener dataListener;
|
private DataListener dataListener;
|
||||||
|
@ -32,15 +31,9 @@ public class Elm327IoStream extends AbstractIoStream {
|
||||||
|
|
||||||
private final IsoTpCanDecoder canDecoder = new IsoTpCanDecoder();
|
private final IsoTpCanDecoder canDecoder = new IsoTpCanDecoder();
|
||||||
|
|
||||||
|
public Elm327IoStream(Elm327Connector con) {
|
||||||
public Elm327IoStream(Elm327Connector con, String loggingPrefix) {
|
|
||||||
this(con, loggingPrefix, DisconnectListener.VOID);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Elm327IoStream(Elm327Connector con, String loggingPrefix, DisconnectListener disconnectListener) {
|
|
||||||
this.con = con;
|
this.con = con;
|
||||||
this.disconnectListener = disconnectListener;
|
dataBuffer = createDataBuffer("elm327Stream");
|
||||||
dataBuffer = createDataBuffer(loggingPrefix);
|
|
||||||
|
|
||||||
// ByteBuffer inBuf = ByteBuffer.allocate(OUT_BUFFER_SIZE);
|
// ByteBuffer inBuf = ByteBuffer.allocate(OUT_BUFFER_SIZE);
|
||||||
outBuf = ByteBuffer.allocate(OUT_BUFFER_SIZE);
|
outBuf = ByteBuffer.allocate(OUT_BUFFER_SIZE);
|
||||||
|
@ -52,7 +45,6 @@ public class Elm327IoStream extends AbstractIoStream {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (!isClosed()) {
|
if (!isClosed()) {
|
||||||
super.close();
|
super.close();
|
||||||
disconnectListener.onDisconnect("on close");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,11 +119,4 @@ public class Elm327IoStream extends AbstractIoStream {
|
||||||
if (rawData.length != 0)
|
if (rawData.length != 0)
|
||||||
sendDataToClient(rawData);
|
sendDataToClient(rawData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface DisconnectListener {
|
|
||||||
DisconnectListener VOID = (String message) -> {
|
|
||||||
|
|
||||||
};
|
|
||||||
void onDisconnect(String message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue