mirror of https://github.com/rusefi/RomRaider.git
updated logger address config handling
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@611 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
7f80a5741c
commit
e0082bf31b
|
@ -1,57 +0,0 @@
|
||||||
Trent Here. I do those ugly brown pages at rxtx.org. Documentation is not
|
|
||||||
what I do well :) So please help me when you see problems or something is
|
|
||||||
confusing.
|
|
||||||
|
|
||||||
For more information provided by end users please visit the rxtx wiki at
|
|
||||||
http://rxtx.qbang.org/wiki. This is also where you can help.
|
|
||||||
|
|
||||||
Short Install Instructions
|
|
||||||
|
|
||||||
Windows
|
|
||||||
|
|
||||||
RXTXcomm.jar goes in \jre\lib\ext (under java)
|
|
||||||
rxtxSerial.dll goes in \jre\bin
|
|
||||||
|
|
||||||
Mac OS X (x86 and ppc) (there is an Installer with the source)
|
|
||||||
|
|
||||||
RXTXcomm.jar goes in /Library/Java/Extensions
|
|
||||||
librxtxSerial.jnilib goes in /Library/Java/Extensions
|
|
||||||
Run fixperm.sh thats in the directory. Fix perms is in the Mac_OS_X
|
|
||||||
subdirectory.
|
|
||||||
|
|
||||||
Linux (only x86, x86_64, ia64 here but more in the ToyBox)
|
|
||||||
|
|
||||||
RXTXcomm.jar goes in /jre/lib/ext (under java)
|
|
||||||
librxtxSerial.so goes in /jre/lib/[machine type] (i386 for instance)
|
|
||||||
Make sure the user is in group lock or uucp so lockfiles work.
|
|
||||||
|
|
||||||
Solaris (sparc only so far)
|
|
||||||
|
|
||||||
RXTXcomm.jar goes in /jre/lib/ext (under java)
|
|
||||||
librxtxSerial.so goes in /jre/lib/[machine type]
|
|
||||||
Make sure the user is in group uucp so lockfiles work.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
A person is added to group lock or uucp by editing /etc/groups. Distributions
|
|
||||||
have various tools but this works:
|
|
||||||
|
|
||||||
lock:x:54: becomes:
|
|
||||||
lock:x:53:jarvi,taj
|
|
||||||
|
|
||||||
Now jarvi and taj are in group lock.
|
|
||||||
|
|
||||||
Also make sure jarvi and taj have read and write permissions on the port.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If there are problems please help each other on the wiki and ask questions
|
|
||||||
on the mail-list. User contributed changes will be used here in the next
|
|
||||||
release. If you don't like the documentation, you can improve it.
|
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
Trent Jarvi
|
|
||||||
tjarvi@qbang.org
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -4,7 +4,7 @@
|
||||||
<!ATTLIST address length CDATA #IMPLIED >
|
<!ATTLIST address length CDATA #IMPLIED >
|
||||||
<!ATTLIST address bit ( 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 ) #IMPLIED >
|
<!ATTLIST address bit ( 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 ) #IMPLIED >
|
||||||
|
|
||||||
<!ELEMENT ecu ( address+ ) >
|
<!ELEMENT ecu ( address ) >
|
||||||
<!ATTLIST ecu id CDATA #REQUIRED >
|
<!ATTLIST ecu id CDATA #REQUIRED >
|
||||||
|
|
||||||
<!ELEMENT ref EMPTY >
|
<!ELEMENT ref EMPTY >
|
||||||
|
|
|
@ -36,8 +36,8 @@ public final class EcuConnectionImpl implements EcuConnection {
|
||||||
this.sendTimeout = connectionProperties.getSendTimeout();
|
this.sendTimeout = connectionProperties.getSendTimeout();
|
||||||
|
|
||||||
// Use TestSSMConnectionImpl for testing!!
|
// Use TestSSMConnectionImpl for testing!!
|
||||||
serialConnection = new SerialConnectionImpl(connectionProperties, portName);
|
// serialConnection = new SerialConnectionImpl(connectionProperties, portName);
|
||||||
// serialConnection = new TestSSMConnectionImpl(connectionProperties, portName);
|
serialConnection = new TestSSMConnectionImpl(connectionProperties, portName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] send(byte[] bytes) {
|
public byte[] send(byte[] bytes) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ package enginuity.logger.ecu.comms.io.connection;
|
||||||
|
|
||||||
import enginuity.io.connection.ConnectionProperties;
|
import enginuity.io.connection.ConnectionProperties;
|
||||||
import enginuity.io.connection.SerialConnection;
|
import enginuity.io.connection.SerialConnection;
|
||||||
import enginuity.io.connection.SerialConnectionImpl;
|
import enginuity.io.connection.TestSSMConnectionImpl;
|
||||||
import enginuity.logger.ecu.comms.io.protocol.LoggerProtocol;
|
import enginuity.logger.ecu.comms.io.protocol.LoggerProtocol;
|
||||||
import enginuity.logger.ecu.comms.io.protocol.SSMLoggerProtocol;
|
import enginuity.logger.ecu.comms.io.protocol.SSMLoggerProtocol;
|
||||||
import enginuity.logger.ecu.comms.query.EcuQuery;
|
import enginuity.logger.ecu.comms.query.EcuQuery;
|
||||||
|
@ -45,8 +45,8 @@ public final class SSMLoggerConnection implements LoggerConnection {
|
||||||
protocol = new SSMLoggerProtocol();
|
protocol = new SSMLoggerProtocol();
|
||||||
|
|
||||||
// Use TestSSMConnectionImpl for testing!!
|
// Use TestSSMConnectionImpl for testing!!
|
||||||
serialConnection = new SerialConnectionImpl(connectionProperties, portName);
|
// serialConnection = new SerialConnectionImpl(connectionProperties, portName);
|
||||||
// serialConnection = new TestSSMConnectionImpl(connectionProperties, portName);
|
serialConnection = new TestSSMConnectionImpl(connectionProperties, portName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendAddressReads(Collection<EcuQuery> queries) {
|
public void sendAddressReads(Collection<EcuQuery> queries) {
|
||||||
|
|
|
@ -24,25 +24,12 @@ package enginuity.logger.ecu.definition.xml;
|
||||||
import enginuity.io.connection.ConnectionProperties;
|
import enginuity.io.connection.ConnectionProperties;
|
||||||
import enginuity.io.connection.ConnectionPropertiesImpl;
|
import enginuity.io.connection.ConnectionPropertiesImpl;
|
||||||
import enginuity.logger.ecu.comms.query.EcuInit;
|
import enginuity.logger.ecu.comms.query.EcuInit;
|
||||||
import enginuity.logger.ecu.definition.EcuData;
|
import enginuity.logger.ecu.definition.*;
|
||||||
import enginuity.logger.ecu.definition.EcuDataConvertor;
|
|
||||||
import enginuity.logger.ecu.definition.EcuDerivedParameterConvertor;
|
|
||||||
import enginuity.logger.ecu.definition.EcuDerivedParameterConvertorImpl;
|
|
||||||
import enginuity.logger.ecu.definition.EcuDerivedParameterImpl;
|
|
||||||
import enginuity.logger.ecu.definition.EcuParameter;
|
|
||||||
import enginuity.logger.ecu.definition.EcuParameterConvertorImpl;
|
|
||||||
import enginuity.logger.ecu.definition.EcuSwitch;
|
|
||||||
import static enginuity.util.ParamChecker.checkNotNullOrEmpty;
|
import static enginuity.util.ParamChecker.checkNotNullOrEmpty;
|
||||||
import org.xml.sax.Attributes;
|
import org.xml.sax.Attributes;
|
||||||
import org.xml.sax.helpers.DefaultHandler;
|
import org.xml.sax.helpers.DefaultHandler;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public final class LoggerDefinitionHandler extends DefaultHandler {
|
public final class LoggerDefinitionHandler extends DefaultHandler {
|
||||||
private static final String FLOAT = "float";
|
private static final String FLOAT = "float";
|
||||||
|
@ -89,11 +76,11 @@ public final class LoggerDefinitionHandler extends DefaultHandler {
|
||||||
private String ecuByteIndex;
|
private String ecuByteIndex;
|
||||||
private String ecuBit;
|
private String ecuBit;
|
||||||
private String ecuIds;
|
private String ecuIds;
|
||||||
private Set<String> addressList;
|
private EcuAddress address;
|
||||||
private Set<String> dependsList;
|
private Set<String> dependsList;
|
||||||
private Map<String, String[]> ecuAddressMap;
|
private Map<String, EcuAddress> ecuAddressMap;
|
||||||
private boolean derived;
|
private boolean derived;
|
||||||
private int bit;
|
private int addressBit;
|
||||||
private int addressLength;
|
private int addressLength;
|
||||||
private Set<EcuDataConvertor> convertorList;
|
private Set<EcuDataConvertor> convertorList;
|
||||||
private Set<EcuDerivedParameterConvertor> derivedConvertorList;
|
private Set<EcuDerivedParameterConvertor> derivedConvertorList;
|
||||||
|
@ -133,9 +120,8 @@ public final class LoggerDefinitionHandler extends DefaultHandler {
|
||||||
} else if (TAG_ADDRESS.equals(qName)) {
|
} else if (TAG_ADDRESS.equals(qName)) {
|
||||||
String length = attributes.getValue(ATTR_LENGTH);
|
String length = attributes.getValue(ATTR_LENGTH);
|
||||||
addressLength = length == null ? 1 : Integer.valueOf(length);
|
addressLength = length == null ? 1 : Integer.valueOf(length);
|
||||||
String bitx = attributes.getValue(ATTR_BIT);
|
String bit = attributes.getValue(ATTR_BIT);
|
||||||
bit = bitx == null ? -1 : Integer.valueOf(bitx);
|
addressBit = bit == null ? -1 : Integer.valueOf(bit);
|
||||||
addressList = new LinkedHashSet<String>(addressLength);
|
|
||||||
derived = false;
|
derived = false;
|
||||||
} else if (TAG_DEPENDS.equals(qName)) {
|
} else if (TAG_DEPENDS.equals(qName)) {
|
||||||
dependsList = new LinkedHashSet<String>();
|
dependsList = new LinkedHashSet<String>();
|
||||||
|
@ -158,15 +144,14 @@ public final class LoggerDefinitionHandler extends DefaultHandler {
|
||||||
id = attributes.getValue(ATTR_ID);
|
id = attributes.getValue(ATTR_ID);
|
||||||
name = attributes.getValue(ATTR_NAME);
|
name = attributes.getValue(ATTR_NAME);
|
||||||
desc = attributes.getValue(ATTR_DESC);
|
desc = attributes.getValue(ATTR_DESC);
|
||||||
addressList = new HashSet<String>();
|
address = new EcuAddressImpl(attributes.getValue(ATTR_BYTE), 1,
|
||||||
addressList.add(attributes.getValue(ATTR_BYTE));
|
Integer.valueOf(attributes.getValue(ATTR_BIT)));
|
||||||
bit = Integer.valueOf(attributes.getValue(ATTR_BIT));
|
|
||||||
derived = false;
|
derived = false;
|
||||||
} else if (TAG_ECUPARAM.equals(qName)) {
|
} else if (TAG_ECUPARAM.equals(qName)) {
|
||||||
id = attributes.getValue(ATTR_ID);
|
id = attributes.getValue(ATTR_ID);
|
||||||
name = attributes.getValue(ATTR_NAME);
|
name = attributes.getValue(ATTR_NAME);
|
||||||
desc = attributes.getValue(ATTR_DESC);
|
desc = attributes.getValue(ATTR_DESC);
|
||||||
ecuAddressMap = new HashMap<String, String[]>();
|
ecuAddressMap = new HashMap<String, EcuAddress>();
|
||||||
derived = false;
|
derived = false;
|
||||||
} else if (TAG_ECU.equals(qName)) {
|
} else if (TAG_ECU.equals(qName)) {
|
||||||
ecuIds = attributes.getValue(ATTR_ID);
|
ecuIds = attributes.getValue(ATTR_ID);
|
||||||
|
@ -180,14 +165,14 @@ public final class LoggerDefinitionHandler extends DefaultHandler {
|
||||||
charBuffer.append(ch, start, length);
|
charBuffer.append(ch, start, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//FIXME: Fix all the commented out stuff!!!
|
|
||||||
public void endElement(String uri, String localName, String qName) {
|
public void endElement(String uri, String localName, String qName) {
|
||||||
if (TAG_PROTOCOL.equals(qName)) {
|
if (TAG_PROTOCOL.equals(qName)) {
|
||||||
parseProtocol = false;
|
parseProtocol = false;
|
||||||
} else if (parseProtocol) {
|
} else if (parseProtocol) {
|
||||||
if (TAG_ADDRESS.equals(qName)) {
|
if (TAG_ADDRESS.equals(qName)) {
|
||||||
String startAddress = charBuffer.toString();
|
String startAddress = charBuffer.toString();
|
||||||
// addressList.addAll(getAddressList(startAddress, addressLength));
|
address = new EcuAddressImpl(startAddress, addressLength, addressBit);
|
||||||
} else if (TAG_PARAMETER.equals(qName)) {
|
} else if (TAG_PARAMETER.equals(qName)) {
|
||||||
if (derived) {
|
if (derived) {
|
||||||
Set<EcuData> dependencies = new HashSet<EcuData>();
|
Set<EcuData> dependencies = new HashSet<EcuData>();
|
||||||
|
@ -207,32 +192,31 @@ public final class LoggerDefinitionHandler extends DefaultHandler {
|
||||||
} else {
|
} else {
|
||||||
if (ecuByteIndex == null || ecuBit == null || ecuInit == null || isSupportedParameter(ecuInit,
|
if (ecuByteIndex == null || ecuBit == null || ecuInit == null || isSupportedParameter(ecuInit,
|
||||||
ecuByteIndex, ecuBit)) {
|
ecuByteIndex, ecuBit)) {
|
||||||
// EcuParameter param = new EcuParameterImpl(id, name, desc, toArray(addressList),
|
EcuParameter param = new EcuParameterImpl(id, name, desc, address,
|
||||||
// convertorList.toArray(new EcuDataConvertor[convertorList.size()]));
|
convertorList.toArray(new EcuDataConvertor[convertorList.size()]));
|
||||||
// params.add(param);
|
params.add(param);
|
||||||
// ecuDataMap.put(param.getId(), param);
|
ecuDataMap.put(param.getId(), param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (TAG_SWITCH.equals(qName)) {
|
} else if (TAG_SWITCH.equals(qName)) {
|
||||||
// EcuSwitch ecuSwitch = new EcuSwitchImpl(id, name, desc, toArray(addressList),
|
EcuSwitch ecuSwitch = new EcuSwitchImpl(id, name, desc, address,
|
||||||
// new EcuDataConvertor[]{new EcuSwitchConvertorImpl(bit)});
|
new EcuDataConvertor[]{new EcuSwitchConvertorImpl(address.getBit())});
|
||||||
// switches.add(ecuSwitch);
|
switches.add(ecuSwitch);
|
||||||
// ecuDataMap.put(ecuSwitch.getId(), ecuSwitch);
|
ecuDataMap.put(ecuSwitch.getId(), ecuSwitch);
|
||||||
if (id.equalsIgnoreCase(fileLoggingControllerSwitchId)) {
|
if (id.equalsIgnoreCase(fileLoggingControllerSwitchId)) {
|
||||||
// fileLoggingControllerSwitch = new EcuSwitchImpl(id, name, desc, toArray(addressList),
|
fileLoggingControllerSwitch = new EcuSwitchImpl(id, name, desc, address,
|
||||||
// new EcuDataConvertor[]{new EcuSwitchConvertorImpl(bit)});
|
new EcuDataConvertor[]{new EcuSwitchConvertorImpl(address.getBit())});
|
||||||
}
|
}
|
||||||
} else if (TAG_ECUPARAM.equals(qName)) {
|
} else if (TAG_ECUPARAM.equals(qName)) {
|
||||||
if (ecuInit != null && ecuAddressMap.containsKey(ecuInit.getEcuId())) {
|
if (ecuInit != null && ecuAddressMap.containsKey(ecuInit.getEcuId())) {
|
||||||
// EcuParameter param = new EcuParameterImpl(id, name, desc, ecuAddressMap.get(ecuInit.getEcuId()),
|
EcuParameter param = new EcuParameterImpl(id, name, desc, ecuAddressMap.get(ecuInit.getEcuId()),
|
||||||
// convertorList.toArray(new EcuDataConvertor[convertorList.size()]));
|
convertorList.toArray(new EcuDataConvertor[convertorList.size()]));
|
||||||
// params.add(param);
|
params.add(param);
|
||||||
// ecuDataMap.put(param.getId(), param);
|
ecuDataMap.put(param.getId(), param);
|
||||||
}
|
}
|
||||||
} else if (TAG_ECU.equals(qName)) {
|
} else if (TAG_ECU.equals(qName)) {
|
||||||
String[] addresses = toArray(addressList);
|
|
||||||
for (String ecuId : ecuIds.split(",")) {
|
for (String ecuId : ecuIds.split(",")) {
|
||||||
ecuAddressMap.put(ecuId, addresses);
|
ecuAddressMap.put(ecuId, address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,10 +249,4 @@ public final class LoggerDefinitionHandler extends DefaultHandler {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] toArray(Set<String> set) {
|
|
||||||
String[] addresses = new String[set.size()];
|
|
||||||
set.toArray(addresses);
|
|
||||||
return addresses;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue