hard requirement for console version match #4187

This commit is contained in:
rusefillc 2022-06-01 11:07:28 -04:00
parent 1dc5c970b5
commit fc81ef9ce5
4 changed files with 3 additions and 21 deletions

View File

@ -725,6 +725,7 @@ void updateTunerStudioState() {
// header
tsOutputChannels->tsConfigVersion = TS_FILE_VERSION;
static_assert(offsetof (TunerStudioOutputChannels, tsConfigVersion) == TS_FILE_VERSION_OFFSET);
#if EFI_SHAFT_POSITION_INPUT

View File

@ -98,7 +98,7 @@ public enum Sensor {
TIME_SECONDS(GAUGE_NAME_TIME, SensorCategory.OPERATIONS, FieldType.INT, 112, 1, 0, 5, ""),
engineMode("mode", SensorCategory.OPERATIONS, FieldType.INT, 116, 0, 5),
FIRMWARE_VERSION(GAUGE_NAME_VERSION, SensorCategory.OPERATIONS, FieldType.INT, 120, 1, 0, 100, "version_f"),
TS_CONFIG_VERSION(".ini version", SensorCategory.OPERATIONS, FieldType.INT, 124),
TS_CONFIG_VERSION(".ini version", SensorCategory.OPERATIONS, FieldType.INT, TS_FILE_VERSION_OFFSET),
engineMakeCodeNameCrc16("engine crc16", SensorCategory.STATUS, FieldType.UINT16, 138, 0, 5),
// Errors

View File

@ -6,7 +6,7 @@ import java.net.URL;
import java.util.concurrent.atomic.AtomicReference;
public class rusEFIVersion {
public static final int CONSOLE_VERSION = 20220525;
public static final int CONSOLE_VERSION = 20220601;
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
public static long classBuildTimeMillis() {

View File

@ -4,10 +4,7 @@ import com.devexperts.logging.Logging;
import com.rusefi.autodetect.PortDetector;
import com.rusefi.autoupdate.AutoupdateUtil;
import com.rusefi.binaryprotocol.BinaryProtocolLogger;
import com.rusefi.config.generated.Fields;
import com.rusefi.core.MessagesCentral;
import com.rusefi.core.Sensor;
import com.rusefi.core.SensorCentral;
import com.rusefi.io.LinkManager;
import com.rusefi.io.serial.BaudRateHolder;
import com.rusefi.maintenance.FirmwareFlasher;
@ -41,7 +38,6 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
public class ConsoleUI {
private static final Logging log = getLogging(ConsoleUI.class);
private static final int DEFAULT_TAB_INDEX = 0;
private static SensorCentral.SensorListener wrongVersionListener;
public static final String TAB_INDEX = "main_tab";
protected static final String PORT_KEY = "port";
@ -204,21 +200,6 @@ public class ConsoleUI {
if (result == JOptionPane.NO_OPTION)
System.exit(-1);
}
wrongVersionListener = new SensorCentral.SensorListener() {
@Override
public void onSensorUpdate(double value) {
// todo: we need to migrate to TS_SIGNATURE validation!!!
if (value != Fields.TS_FILE_VERSION) {
String message = "This copy of rusEFI console is not compatible with this version of firmware\r\n" +
"Console compatible with " + Fields.TS_FILE_VERSION + " while firmware compatible with " +
(int) value;
JOptionPane.showMessageDialog(getFrame(), message);
assert wrongVersionListener != null;
SensorCentral.getInstance().removeListener(Sensor.TS_CONFIG_VERSION, wrongVersionListener);
}
}
};
SensorCentral.getInstance().addListener(Sensor.TS_CONFIG_VERSION, wrongVersionListener);
JustOneInstance.onStart();
try {
boolean isPortDefined = args.length > 0;