diff --git a/java_console/io/src/main/java/com/rusefi/binaryprotocol/MsqFactory.java b/java_console/io/src/main/java/com/rusefi/binaryprotocol/MsqFactory.java index 825c7fa08f..8ae3020d9a 100644 --- a/java_console/io/src/main/java/com/rusefi/binaryprotocol/MsqFactory.java +++ b/java_console/io/src/main/java/com/rusefi/binaryprotocol/MsqFactory.java @@ -7,6 +7,6 @@ import com.rusefi.tune.xml.Msq; public class MsqFactory { public static Msq valueOf(ConfigurationImage image, IniFileModel ini) { - return Msq.valueOf(image, Fields.TOTAL_CONFIG_SIZE, Fields.TS_SIGNATURE, ini); + return Msq.valueOf(image, ini.getMetaInfo().getTotalSize(), Fields.TS_SIGNATURE, ini); } } diff --git a/java_console/io/src/test/java/com/rusefi/binaryprotocol/test/BinaryProtocolServerSandbox.java b/java_console/io/src/test/java/com/rusefi/binaryprotocol/test/BinaryProtocolServerSandbox.java index 874c96f432..41d714feda 100644 --- a/java_console/io/src/test/java/com/rusefi/binaryprotocol/test/BinaryProtocolServerSandbox.java +++ b/java_console/io/src/test/java/com/rusefi/binaryprotocol/test/BinaryProtocolServerSandbox.java @@ -1,6 +1,7 @@ package com.rusefi.binaryprotocol.test; import com.opensr5.ConfigurationImage; +import com.opensr5.ini.IniFileModel; import com.opensr5.ini.field.ScalarIniField; import com.rusefi.TestHelper; import com.rusefi.binaryprotocol.BinaryProtocolState; @@ -23,8 +24,10 @@ class BinaryProtocolServerSandbox { // if (!f.exists()) // throw new IllegalStateException("File not found: " + BinaryProtocolServer.TEST_FILE); + IniFileModel model = IniFileModel.getInstance(); + BinaryProtocolState state = new BinaryProtocolState(); - ConfigurationImage controller = new ConfigurationImage(new byte[Fields.TOTAL_CONFIG_SIZE]); + ConfigurationImage controller = new ConfigurationImage(new byte[model.getMetaInfo().getTotalSize()]); ScalarIniField iniField = TestHelper.createIniField(Fields.TWOSTROKE); iniField.setValue(controller, new Constant(iniField.getName(), "", "1", iniField.getDigits())); state.setController(controller);