mirror of https://github.com/rusefi/RomRaider.git
fixed bug related to auto loading of params for pre-01 ecus
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@538 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
9dcc4a5025
commit
dea19ae779
|
@ -23,7 +23,10 @@ import java.util.Random;
|
||||||
@SuppressWarnings({"PointlessArithmeticExpression"})
|
@SuppressWarnings({"PointlessArithmeticExpression"})
|
||||||
public final class TestSSMConnectionImpl implements SerialConnection {
|
public final class TestSSMConnectionImpl implements SerialConnection {
|
||||||
private static final Random RANDOM = new Random(System.currentTimeMillis());
|
private static final Random RANDOM = new Random(System.currentTimeMillis());
|
||||||
private static final String ECU_INIT_RESPONSE = "8010F001BF4080F01039FFA21011315258400673FACB842B83FEA800000060CED4FDB060000F200000000000DC0000551E30C0F222000040FB00E1000000000000000059";
|
private static final String ECU_INIT_RESPONSE_01_UP = "8010F001BF4080F01039FFA21011315258400673FACB842B83FEA800000060CED4FDB060000F200000000000DC0000551E30C0F222000040FB00E1000000000000000059";
|
||||||
|
private static final String ECU_INIT_RESPONSE_PRE_01 = "8010F001BF4080F01029FFA1100B195458050561C4EB800808000000000070CE64F8BA080000E00000000000DC0000108000007B";
|
||||||
|
private static final String ECU_INIT_RESPONSE = ECU_INIT_RESPONSE_01_UP;
|
||||||
|
// private static final String ECU_INIT_RESPONSE = ECU_INIT_RESPONSE_PRE_01;
|
||||||
private byte[] request = new byte[0];
|
private byte[] request = new byte[0];
|
||||||
|
|
||||||
public TestSSMConnectionImpl(ConnectionProperties connectionProperties, String portName) {
|
public TestSSMConnectionImpl(ConnectionProperties connectionProperties, String portName) {
|
||||||
|
|
|
@ -251,10 +251,16 @@ public final class LoggerDefinitionHandler extends DefaultHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSupportedParameter(final EcuInit ecuInit, final String ecuByteIndex, final String ecuBit) {
|
private boolean isSupportedParameter(EcuInit ecuInit, String ecuByteIndex, String ecuBit) {
|
||||||
|
byte[] ecuInitBytes = ecuInit.getEcuInitBytes();
|
||||||
|
int index = Integer.parseInt(ecuByteIndex);
|
||||||
|
if (index < ecuInitBytes.length) {
|
||||||
byte[] bytes = new byte[1];
|
byte[] bytes = new byte[1];
|
||||||
System.arraycopy(ecuInit.getEcuInitBytes(), Integer.parseInt(ecuByteIndex), bytes, 0, 1);
|
System.arraycopy(ecuInitBytes, index, bytes, 0, 1);
|
||||||
return (bytes[0] & 1 << Integer.parseInt(ecuBit)) > 0;
|
return (bytes[0] & 1 << Integer.parseInt(ecuBit)) > 0;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EcuParameter> getEcuParameters() {
|
public List<EcuParameter> getEcuParameters() {
|
||||||
|
|
Loading…
Reference in New Issue