From bc2bb94dee9291425a812d39eab20cc4a30e3b88 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 1 Aug 2020 13:21:50 -0400 Subject: [PATCH] TS SD integration #1653 --- .../java/com/opensr5/ini/field/IniField.java | 3 ++ .../com/rusefi/binaryprotocol/IoHelper.java | 4 +-- .../rusefi/io/tcp/BinaryProtocolServer.java | 30 ++++++++++++++++-- java_console/test_log.mlg.Z | Bin 0 -> 15009 bytes .../io/BinaryProtocolServerSandbox.java | 15 ++++++++- 5 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 java_console/test_log.mlg.Z diff --git a/java_console/inifile/src/main/java/com/opensr5/ini/field/IniField.java b/java_console/inifile/src/main/java/com/opensr5/ini/field/IniField.java index 031bf93c3c..cfe23557e9 100644 --- a/java_console/inifile/src/main/java/com/opensr5/ini/field/IniField.java +++ b/java_console/inifile/src/main/java/com/opensr5/ini/field/IniField.java @@ -30,6 +30,9 @@ public abstract class IniField { public abstract int getSize(); + /** + * @see com.rusefi.config.Field#getValue + */ public String getValue(ConfigurationImage image) { return null; } diff --git a/java_console/io/src/main/java/com/rusefi/binaryprotocol/IoHelper.java b/java_console/io/src/main/java/com/rusefi/binaryprotocol/IoHelper.java index 76b92d6e25..a350c53c41 100644 --- a/java_console/io/src/main/java/com/rusefi/binaryprotocol/IoHelper.java +++ b/java_console/io/src/main/java/com/rusefi/binaryprotocol/IoHelper.java @@ -39,11 +39,11 @@ public class IoHelper { return (((x & 0xff) << 8) | ((x >> 8) & 0xff)); } - static int swap32(int x) { + public static int swap32(int x) { return (((x) >> 24) & 0xff) | (((x) << 8) & 0xff0000) | (((x) >> 8) & 0xff00) | (((x) << 24) & 0xff000000); } - private static void putInt(byte[] packet, int offset, int value) { + public static void putInt(byte[] packet, int offset, int value) { int index = offset + 3; for (int i = 0; i < 4; i++) { packet[index--] = (byte) value; diff --git a/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java b/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java index fcb7d08a57..b91bf4acd4 100644 --- a/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java +++ b/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java @@ -39,6 +39,7 @@ import static com.rusefi.config.generated.Fields.*; */ public class BinaryProtocolServer implements BinaryProtocolCommands { + public static final String TEST_FILE = "test_log.mlg.Z"; private static final Logging log = getLogging(BinaryProtocolServer.class); private static final int DEFAULT_PROXY_PORT = 2390; public static final String TS_OK = "\0"; @@ -267,6 +268,9 @@ public class BinaryProtocolServer implements BinaryProtocolCommands { response[9] = 0; response[10] = 1; // number of files } else { + // SD read directory command + // + System.arraycopy("hello123mlq".getBytes(), 0, response, 1, 11); response[1 + 11] = 1; // file @@ -275,9 +279,14 @@ public class BinaryProtocolServer implements BinaryProtocolCommands { response[1 + 24] = (byte) 0; // size response[1 + 25] = (byte) 0; // size - response[1 + 29] = (byte) 128; - response[1 + 30] = (byte) 1; - response[1 + 31] = (byte) 0; // size + File f = new File(TEST_FILE); + int size = (int) f.length(); + + IoHelper.putInt(response, 29, IoHelper.swap32(size)); + +// response[1 + 29] = (byte) 128; +// response[1 + 30] = (byte) 1; +// response[1 + 31] = (byte) 0; // size } stream.sendPacket(response); @@ -296,6 +305,21 @@ public class BinaryProtocolServer implements BinaryProtocolCommands { // fake data response[3] = payload[3]; response[4] = payload[4]; + + File f = new File(BinaryProtocolServer.TEST_FILE); + FileInputStream fis = new FileInputStream(f); + int size = (int) f.length(); + + + int offset = blockNumber * 2048; + int len = Math.min(size - offset, 2048); + + if (len > 0) { + fis.skip(offset); + log.info("TS_SD reading " + offset + " " + len + " of " + size); + fis.read(response, 3, len); + } + stream.sendPacket(response); } else { log.info("TS_SD: Got unexpected r " + IoStream.printHexBinary(packet.packet)); diff --git a/java_console/test_log.mlg.Z b/java_console/test_log.mlg.Z new file mode 100644 index 0000000000000000000000000000000000000000..567df6121a854e173008232d4f8982a7c71b73f6 GIT binary patch literal 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_B3f-keNSq7P2R>Edv~6_uddqVAUC;1JSzCy&ft}ipKg9CcUXDSX~DX3m)aYLR;kJ&%`|o`8v!Sp z0c?v3jpeKQ1%I4sC@-3UBSP|PuxoniFAEKEP&@2YEtxDnS>`d5sbb?`1tD=`H)6Mi zO!ls*;QRB5Fs%yT+$jnzx?;wG)z<{tp|!x2vvI_MdX~Jt(;!9 zbVj+UXrcR};_$rQMGr%7Rc^J6(+hi6DOkDS9%lrWQ(Idd<0}nhYc{AkBaUO`0;An} zqT{W0c8^7tyEMqLijZZ!2@gOKvdU?>W96Y&>(iE_@b96UA?S2uWWQ#szjeiuL$NZo zJ%~HWCozkX^noXBKRv;VI-{%kr&KuTORQ)vTUJ`67xAL%>&j4fpM4cSR>sGj>O?Qn zqn6S7rK?^UUFFoGGD?S!_rioLi}k$paZON{2eiX}vfO?4V0q`tt7VbTs#t-=;mfw{ cx@(#19;UXM2inxd_t~l)20!OUO#Ki35C0>V+5i9m literal 0 HcmV?d00001 diff --git a/java_console/ui/src/test/java/com/rusefi/io/BinaryProtocolServerSandbox.java b/java_console/ui/src/test/java/com/rusefi/io/BinaryProtocolServerSandbox.java index 04fc02d5b3..8ef20303c1 100644 --- a/java_console/ui/src/test/java/com/rusefi/io/BinaryProtocolServerSandbox.java +++ b/java_console/ui/src/test/java/com/rusefi/io/BinaryProtocolServerSandbox.java @@ -1,17 +1,30 @@ package com.rusefi.io; import com.opensr5.ConfigurationImage; +import com.opensr5.ini.field.ScalarIniField; +import com.rusefi.TestHelper; import com.rusefi.binaryprotocol.BinaryProtocolState; import com.rusefi.config.generated.Fields; import com.rusefi.io.tcp.BinaryProtocolServer; +import com.rusefi.tune.xml.Constant; + +import java.io.File; /** * Starts a fake device with TCP connector at {@link BinaryProtocolServer#DEFAULT_PROXY_PORT} port */ class BinaryProtocolServerSandbox { + public static void main(String[] args) { + File f = new File(BinaryProtocolServer.TEST_FILE); + if (!f.exists()) + throw new IllegalStateException("File not found: " + BinaryProtocolServer.TEST_FILE); + BinaryProtocolState state = new BinaryProtocolState(); - state.setController(new ConfigurationImage(new byte[Fields.TOTAL_CONFIG_SIZE])); + ConfigurationImage controller = new ConfigurationImage(new byte[Fields.TOTAL_CONFIG_SIZE]); + ScalarIniField iniField = TestHelper.createIniField(Fields.AMBIGUOUSOPERATIONMODE); + iniField.setValue(controller, new Constant(iniField.getName(), "", "1", iniField.getDigits())); + state.setController(controller); state.setCurrentOutputs(new byte[1 + Fields.TS_OUTPUT_SIZE]); LinkManager linkManager = new LinkManager();