parent
cb426863c9
commit
ef20cf8916
|
@ -231,7 +231,7 @@ public class BinaryProtocol {
|
||||||
textListener.onDataArrived((text + "\r\n").getBytes());
|
textListener.onDataArrived((text + "\r\n").getBytes());
|
||||||
}
|
}
|
||||||
if (linkManager.isNeedPullLiveData()) {
|
if (linkManager.isNeedPullLiveData()) {
|
||||||
LiveDocsRegistry.LiveDataProvider liveDataProvider = LiveDocsRegistry.getLiveDataProvider(BinaryProtocol.this);
|
LiveDocsRegistry.LiveDataProvider liveDataProvider = LiveDocsRegistry.getLiveDataProvider();
|
||||||
LiveDocsRegistry.INSTANCE.refresh(liveDataProvider);
|
LiveDocsRegistry.INSTANCE.refresh(liveDataProvider);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.rusefi.ui.livedocs;
|
||||||
|
|
||||||
import com.rusefi.binaryprotocol.BinaryProtocol;
|
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||||
import com.rusefi.config.Field;
|
import com.rusefi.config.Field;
|
||||||
import com.rusefi.config.generated.Fields;
|
import com.rusefi.core.SensorCentral;
|
||||||
import com.rusefi.enums.live_data_e;
|
import com.rusefi.enums.live_data_e;
|
||||||
import com.rusefi.ldmp.StateDictionary;
|
import com.rusefi.ldmp.StateDictionary;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -46,7 +46,7 @@ public enum LiveDocsRegistry {
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static LiveDataProvider getLiveDataProvider(BinaryProtocol binaryProtocol) {
|
public static LiveDataProvider getLiveDataProvider() {
|
||||||
return context -> {
|
return context -> {
|
||||||
Field[] values = StateDictionary.INSTANCE.getFields(context);
|
Field[] values = StateDictionary.INSTANCE.getFields(context);
|
||||||
int size = Field.getStructureSize(values);
|
int size = Field.getStructureSize(values);
|
||||||
|
@ -54,13 +54,12 @@ public enum LiveDocsRegistry {
|
||||||
putShort(packet, 0, swap16(context.ordinal())); // offset
|
putShort(packet, 0, swap16(context.ordinal())); // offset
|
||||||
putShort(packet, 2, swap16(size));
|
putShort(packet, 2, swap16(size));
|
||||||
|
|
||||||
byte[] responseWithCode = binaryProtocol.executeCommand(Fields.TS_GET_STRUCT, packet, "get LiveDoc");
|
int structOffset = StateDictionary.INSTANCE.getOffset(context);
|
||||||
if (responseWithCode == null || responseWithCode.length != (size + 1) || responseWithCode[0] != Fields.TS_RESPONSE_OK)
|
byte[] overallOutputs = SensorCentral.getInstance().getResponse();
|
||||||
return null;
|
|
||||||
|
|
||||||
byte[] response = new byte[size];
|
byte[] response = new byte[size];
|
||||||
|
|
||||||
System.arraycopy(responseWithCode, 1, response, 0, size);
|
System.arraycopy(overallOutputs, structOffset, overallOutputs, 0, size);
|
||||||
return response;
|
return response;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import java.net.URL;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
public class rusEFIVersion {
|
public class rusEFIVersion {
|
||||||
public static final int CONSOLE_VERSION = 20220618;
|
public static final int CONSOLE_VERSION = 20220625;
|
||||||
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
public static AtomicReference<String> firmwareVersion = new AtomicReference<>("N/A");
|
||||||
|
|
||||||
public static long classBuildTimeMillis() {
|
public static long classBuildTimeMillis() {
|
||||||
|
|
Loading…
Reference in New Issue