auto-sync

This commit is contained in:
rusEfi 2015-12-26 09:01:32 -05:00
parent 95371713b9
commit 0694ad8358
2 changed files with 11 additions and 8 deletions

View File

@ -110,13 +110,16 @@ public class BinaryProtocolServer {
short page = dis.readShort();
short offset = swap16(dis.readShort());
short count = swap16(dis.readShort());
System.out.println("read " + page + "/" + offset + "/" + count);
BinaryProtocol bp = BinaryProtocol.instance;
byte[] response = new byte[1 + count];
response[0] = (byte) TS_OK.charAt(0);
System.arraycopy(bp.getController().getContent(), offset, response, 1, count);
BinaryProtocol.sendCrcPacket(response, FileLog.LOGGER, stream);
if (count <= 0) {
FileLog.MAIN.logLine("Error: negative read request " + offset + "/" + count);
} else {
System.out.println("read " + page + "/" + offset + "/" + count);
BinaryProtocol bp = BinaryProtocol.instance;
byte[] response = new byte[1 + count];
response[0] = (byte) TS_OK.charAt(0);
System.arraycopy(bp.getController().getContent(), offset, response, 1, count);
BinaryProtocol.sendCrcPacket(response, FileLog.LOGGER, stream);
}
} else if (command == BinaryProtocol.COMMAND_OUTPUTS) {
byte[] response = new byte[1 + BinaryProtocol.OUTPUT_CHANNELS_SIZE];

View File

@ -32,7 +32,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel
*/
public class Launcher {
public static final int CONSOLE_VERSION = 20151224;
public static final int CONSOLE_VERSION = 20151226;
public static final boolean SHOW_STIMULATOR = false;
private static final String TAB_INDEX = "main_tab";
protected static final String PORT_KEY = "port";