Revert "proxy progress one more go? it makes no sense :("
This reverts commit dc5be4f0
This commit is contained in:
parent
dc5be4f053
commit
93f56e1b27
|
@ -4,7 +4,6 @@ import com.opensr5.Logger;
|
||||||
import com.opensr5.io.DataListener;
|
import com.opensr5.io.DataListener;
|
||||||
import com.opensr5.io.WriteStream;
|
import com.opensr5.io.WriteStream;
|
||||||
import com.rusefi.binaryprotocol.BinaryProtocol;
|
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||||
import com.rusefi.binaryprotocol.IncomingDataBuffer;
|
|
||||||
import com.rusefi.binaryprotocol.IoHelper;
|
import com.rusefi.binaryprotocol.IoHelper;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -41,8 +40,6 @@ public interface IoStream extends WriteStream {
|
||||||
write(packet);
|
write(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
IncomingDataBuffer getDataBuffer();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param listener would be invoked from unknown implementation-dependent thread
|
* @param listener would be invoked from unknown implementation-dependent thread
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,7 +5,6 @@ import com.fazecast.jSerialComm.SerialPortDataListener;
|
||||||
import com.fazecast.jSerialComm.SerialPortEvent;
|
import com.fazecast.jSerialComm.SerialPortEvent;
|
||||||
import com.opensr5.Logger;
|
import com.opensr5.Logger;
|
||||||
import com.opensr5.io.DataListener;
|
import com.opensr5.io.DataListener;
|
||||||
import com.rusefi.binaryprotocol.IncomingDataBuffer;
|
|
||||||
import com.rusefi.io.IoStream;
|
import com.rusefi.io.IoStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,7 +18,6 @@ public class SerialIoStreamJSerialComm implements IoStream {
|
||||||
private SerialPort sp;
|
private SerialPort sp;
|
||||||
private final String port;
|
private final String port;
|
||||||
private final Logger logger;
|
private final Logger logger;
|
||||||
private final IncomingDataBuffer dataBuffer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see #openPort(String, Logger)
|
* @see #openPort(String, Logger)
|
||||||
|
@ -28,12 +26,6 @@ public class SerialIoStreamJSerialComm implements IoStream {
|
||||||
this.sp = sp;
|
this.sp = sp;
|
||||||
this.port = port;
|
this.port = port;
|
||||||
this.logger = logger;
|
this.logger = logger;
|
||||||
dataBuffer = IncomingDataBuffer.createDataBuffer(this, logger);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IncomingDataBuffer getDataBuffer() {
|
|
||||||
return dataBuffer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.rusefi.io.tcp;
|
||||||
|
|
||||||
import com.opensr5.Logger;
|
import com.opensr5.Logger;
|
||||||
import com.opensr5.io.DataListener;
|
import com.opensr5.io.DataListener;
|
||||||
import com.rusefi.binaryprotocol.IncomingDataBuffer;
|
|
||||||
import com.rusefi.io.ByteReader;
|
import com.rusefi.io.ByteReader;
|
||||||
import com.rusefi.io.IoStream;
|
import com.rusefi.io.IoStream;
|
||||||
|
|
||||||
|
@ -21,7 +20,6 @@ public class TcpIoStream implements IoStream {
|
||||||
private final OutputStream output;
|
private final OutputStream output;
|
||||||
private final Logger logger;
|
private final Logger logger;
|
||||||
private boolean isClosed;
|
private boolean isClosed;
|
||||||
private final IncomingDataBuffer dataBuffer;
|
|
||||||
|
|
||||||
public TcpIoStream(Logger logger, Socket socket) throws IOException {
|
public TcpIoStream(Logger logger, Socket socket) throws IOException {
|
||||||
this(logger, new BufferedInputStream(socket.getInputStream()), socket.getOutputStream());
|
this(logger, new BufferedInputStream(socket.getInputStream()), socket.getOutputStream());
|
||||||
|
@ -35,12 +33,6 @@ public class TcpIoStream implements IoStream {
|
||||||
throw new NullPointerException("output");
|
throw new NullPointerException("output");
|
||||||
this.output = output;
|
this.output = output;
|
||||||
this.input = input;
|
this.input = input;
|
||||||
dataBuffer = IncomingDataBuffer.createDataBuffer(this, logger);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IncomingDataBuffer getDataBuffer() {
|
|
||||||
return dataBuffer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class SerialAutoChecker implements Runnable {
|
||||||
public void run() {
|
public void run() {
|
||||||
IoStream stream = SerialIoStreamJSerialComm.openPort(serialPort, logger);
|
IoStream stream = SerialIoStreamJSerialComm.openPort(serialPort, logger);
|
||||||
Logger logger = FileLog.LOGGER;
|
Logger logger = FileLog.LOGGER;
|
||||||
IncomingDataBuffer incomingData = stream.getDataBuffer();
|
IncomingDataBuffer incomingData = IncomingDataBuffer.createDataBuffer(stream, logger);
|
||||||
try {
|
try {
|
||||||
stream.sendPacket(new byte[]{BinaryProtocolCommands.COMMAND_HELLO}, logger);
|
stream.sendPacket(new byte[]{BinaryProtocolCommands.COMMAND_HELLO}, logger);
|
||||||
byte[] response = incomingData.getPacket(logger, "", false);
|
byte[] response = incomingData.getPacket(logger, "", false);
|
||||||
|
|
|
@ -308,7 +308,7 @@ public class ConsoleTools {
|
||||||
}
|
}
|
||||||
IoStream stream = SerialIoStreamJSerialComm.openPort(autoDetectedPort, FileLog.LOGGER);
|
IoStream stream = SerialIoStreamJSerialComm.openPort(autoDetectedPort, FileLog.LOGGER);
|
||||||
Logger logger = FileLog.LOGGER;
|
Logger logger = FileLog.LOGGER;
|
||||||
IncomingDataBuffer incomingData = stream.getDataBuffer();
|
IncomingDataBuffer incomingData = IncomingDataBuffer.createDataBuffer(stream, logger);
|
||||||
byte[] commandBytes = BinaryProtocol.getTextCommandBytes("hello");
|
byte[] commandBytes = BinaryProtocol.getTextCommandBytes("hello");
|
||||||
stream.sendPacket(commandBytes, logger);
|
stream.sendPacket(commandBytes, logger);
|
||||||
// skipping response
|
// skipping response
|
||||||
|
|
Loading…
Reference in New Issue