Update to report correct target module name in rr_system.log messages

This commit is contained in:
Dale Schultz 2015-01-04 23:24:01 -05:00
parent 611c598a54
commit c980cbefc1
5 changed files with 57 additions and 57 deletions

View File

@ -1358,7 +1358,7 @@ public final class EcuLogger extends AbstractFrame implements MessageListener {
getSettings().setDestinationTarget(module);
}
}
target = name;
target = name.toUpperCase();
}
private Transport getTransportByName(String name) {

View File

@ -60,21 +60,21 @@ public final class DS2LoggerConnection implements LoggerConnection {
@Override
public void ecuReset(Module module) {
byte[] request = protocol.constructEcuResetRequest(module);
LOGGER.debug("ECU Reset Request ---> " + asHex(request));
LOGGER.debug(module + " Reset Request ---> " + asHex(request));
byte[] response = manager.send(request);
byte[] processedResponse = protocol.preprocessResponse(request, response, new PollingStateImpl());
LOGGER.debug("ECU Reset Response <--- " + asHex(processedResponse));
LOGGER.debug(module + " Reset Response <--- " + asHex(processedResponse));
protocol.processEcuResetResponse(processedResponse);
}
@Override
public void ecuInit(EcuInitCallback callback, Module module) {
byte[] request = protocol.constructEcuInitRequest(module);
LOGGER.debug("ECU Init Request ---> " + asHex(request));
LOGGER.debug(module + " Init Request ---> " + asHex(request));
byte[] response = manager.send(request);
LOGGER.trace("ECU Init Raw Response <--- " + asHex(response));
LOGGER.trace(module + " Init Raw Response <--- " + asHex(response));
byte[] processedResponse = protocol.preprocessResponse(request, response, new PollingStateImpl());
LOGGER.debug("ECU Init Response <--- " + asHex(processedResponse));
LOGGER.debug(module + " Init Response <--- " + asHex(processedResponse));
protocol.processEcuInitResponse(callback, processedResponse);
}
@ -95,13 +95,13 @@ public final class DS2LoggerConnection implements LoggerConnection {
queryList.add(query);
request = protocol.constructReadAddressRequest(
module, queryList);
LOGGER.debug("Mode:" + pollState.getCurrentState() +
" ECU Request ---> " + asHex(request));
LOGGER.debug("Mode:" + pollState.getCurrentState() + " " +
module + " Request ---> " + asHex(request));
response = protocol.constructReadAddressResponse(
queryList, request.length);
protocol.processReadAddressResponses(
queryList,
sendRcv(request, response, pollState),
sendRcv(module, request, response, pollState),
pollState);
}
}
@ -111,26 +111,26 @@ public final class DS2LoggerConnection implements LoggerConnection {
queryList.add(query);
request = protocol.constructReadMemoryRequest(
module, queryList);
LOGGER.debug("Mode:" + pollState.getCurrentState() +
" ECU Request ---> " + asHex(request));
LOGGER.debug("Mode:" + pollState.getCurrentState() + " " +
module + " Request ---> " + asHex(request));
response = protocol.constructReadAddressResponse(
queryList, request.length);
protocol.processReadAddressResponses(
queryList,
sendRcv(request, response, pollState),
sendRcv(module ,request, response, pollState),
pollState);
}
}
else {
request = protocol.constructReadGroupRequest(
module, group);
LOGGER.debug("Mode:" + pollState.getCurrentState() +
" ECU Request ---> " + asHex(request));
LOGGER.debug("Mode:" + pollState.getCurrentState() + " " +
module + " Request ---> " + asHex(request));
response = protocol.constructReadGroupResponse(
querySet, request.length);
protocol.processReadAddressResponses(
querySet,
sendRcv(request, response, pollState),
sendRcv(module, request, response, pollState),
pollState);
}
}
@ -158,14 +158,14 @@ public final class DS2LoggerConnection implements LoggerConnection {
writeKey.getBytes(),
writeQueries.get(writeKey)[0]);
LOGGER.debug("ECU Write Request ---> " + asHex(request));
LOGGER.debug(module + " Write Request ---> " + asHex(request));
final byte[] response = manager.send(request);
byte[] processedResponse =
protocol.preprocessResponse(
request,
response,
new PollingStateImpl());
LOGGER.debug("ECU Write Response <--- " + asHex(processedResponse));
LOGGER.debug(module + " Write Response <--- " + asHex(processedResponse));
protocol.processWriteResponse(
writeQueries.get(writeKey), processedResponse);
}
@ -193,13 +193,13 @@ public final class DS2LoggerConnection implements LoggerConnection {
return groups;
}
private byte[] sendRcv(byte[] request, byte[] response, PollingState pollState) {
private byte[] sendRcv(Module module, byte[] request, byte[] response, PollingState pollState) {
manager.send(request, response, pollState);
LOGGER.trace("ECU Read Raw Response <--- " + asHex(response));
LOGGER.trace(module + " Read Raw Response <--- " + asHex(response));
final byte[] processedResponse = protocol.preprocessResponse(
request, response, pollState);
LOGGER.debug("Mode:" + pollState.getCurrentState() +
" ECU Response <--- " + asHex(processedResponse));
LOGGER.debug("Mode:" + pollState.getCurrentState() + " " +
module + " Response <--- " + asHex(processedResponse));
return processedResponse;
}
}

View File

@ -58,13 +58,13 @@ public final class OBDLoggerConnection implements LoggerConnection {
@Override
public void ecuReset(Module module) {
byte[] request = protocol.constructEcuResetRequest(module);
LOGGER.debug(String.format("OBD Reset Request ---> %s",
asHex(request)));
LOGGER.debug(String.format("%s Reset Request ---> %s",
module, asHex(request)));
byte[] response = manager.send(request);
byte[] processedResponse = protocol.preprocessResponse(
request, response, new PollingStateImpl());
LOGGER.debug(String.format("OBD Reset Response <--- %s",
asHex(processedResponse)));
LOGGER.debug(String.format("%s Reset Response <--- %s",
module, asHex(processedResponse)));
protocol.processEcuResetResponse(processedResponse);
}
@ -74,20 +74,20 @@ public final class OBDLoggerConnection implements LoggerConnection {
public void ecuInit(EcuInitCallback callback, Module module) {
final byte[] processedResponse = new byte[46];
final byte[] request = protocol.constructEcuInitRequest(module);
LOGGER.debug(String.format("OBD Calibration ID Request ---> %s",
asHex(request)));
LOGGER.debug(String.format("%s Calibration ID Request ---> %s",
module, asHex(request)));
final byte[] tmp = manager.send(request);
final byte[] response = protocol.preprocessResponse(
request, tmp, new PollingStateImpl());
LOGGER.debug(String.format("OBD Calibration ID Response <--- %s",
asHex(response)));
LOGGER.debug(String.format("%s Calibration ID Response <--- %s",
module, asHex(response)));
System.arraycopy(response, 0, processedResponse, 0, response.length);
int j = 7;
while (response[j] != 0 && j < response.length) { j++; }
final byte[] calIdStr = new byte[j - 7];
System.arraycopy(response, 7, calIdStr, 0, j - 7);
System.arraycopy(calIdStr, 0, processedResponse, 5, 8);
LOGGER.info(String.format("OBD Calibration ID: %s", new String(calIdStr)));
LOGGER.info(String.format("%s Calibration ID: %s", module, new String(calIdStr)));
final byte[] supportedPidsPid = {
(byte) 0x00, (byte) 0x20, (byte) 0x40, (byte) 0x60,
@ -96,13 +96,13 @@ public final class OBDLoggerConnection implements LoggerConnection {
for (byte pid : supportedPidsPid) {
final byte[] pidRequest = protocol.constructReadPidRequest(
module, new byte[]{pid});
LOGGER.debug(String.format("OBD PID Group %02X Request ---> %s",
pid, asHex(pidRequest)));
LOGGER.debug(String.format("%s PID Group %02X Request ---> %s",
module, pid, asHex(pidRequest)));
final byte[] pidtmp = manager.send(pidRequest);
final byte[] pidPpResponse = protocol.preprocessResponse(
pidRequest, pidtmp, new PollingStateImpl());
LOGGER.debug(String.format("OBD PID Group %02X Response <--- %s",
pid, asHex(pidPpResponse)));
LOGGER.debug(String.format("%s PID Group %02X Response <--- %s",
module, pid, asHex(pidPpResponse)));
System.arraycopy(pidPpResponse, 6, processedResponse, i, 4);
i = i + 4;
if ((pidPpResponse[pidPpResponse.length - 1] & 0x01) == 0) break;
@ -116,18 +116,18 @@ public final class OBDLoggerConnection implements LoggerConnection {
final byte[] aiRequest = protocol.constructReadPidRequest(
module, new byte[]{0x65});
LOGGER.debug(String.format(
"OBD Auxiliary Inputs Support Request ---> %s",
asHex(aiRequest)));
"%s Auxiliary Inputs Support Request ---> %s",
module, asHex(aiRequest)));
final byte[] aiResponse = manager.send(aiRequest);
final byte[] aiPpResponse = protocol.preprocessResponse(
aiRequest, aiResponse, new PollingStateImpl());
LOGGER.debug(String.format(
"OBD Auxiliary Inputs Support Response <--- %s",
asHex(aiPpResponse)));
"%s Auxiliary Inputs Support Response <--- %s",
module, asHex(aiPpResponse)));
System.arraycopy(aiPpResponse, 6, processedResponse, 45, 1);
}
LOGGER.debug(String.format("OBD Init Response <--- %s",
asHex(processedResponse))); // contains CALID not ECUID
LOGGER.debug(String.format("%s Init Response <--- %s",
module, asHex(processedResponse))); // contains CALID not ECUID
protocol.processEcuInitResponse(callback, processedResponse);
}
@ -144,16 +144,16 @@ public final class OBDLoggerConnection implements LoggerConnection {
}
final byte[] request = protocol.constructReadAddressRequest(
module, obdQueries);
LOGGER.debug(String.format("Mode:%d OBD Request ---> %s",
pollState.getCurrentState(), asHex(request)));
LOGGER.debug(String.format("Mode:%d %s Request ---> %s",
pollState.getCurrentState(), module, asHex(request)));
final byte[] response = protocol.constructReadAddressResponse(
obdQueries, pollState);
manager.send(request, response, pollState);
final byte[] processedResponse = protocol.preprocessResponse(
request, response, pollState);
LOGGER.debug(String.format("Mode:%d OBD Response <--- %s",
pollState.getCurrentState(), asHex(processedResponse)));
LOGGER.debug(String.format("Mode:%d %s Response <--- %s",
pollState.getCurrentState(), module, asHex(processedResponse)));
protocol.processReadAddressResponses(
obdQueries, processedResponse, pollState);
obdQueries.clear();

View File

@ -72,7 +72,7 @@ public class SSMLoggerCANSubQuery {
subQuery.add(new EcuQueryImpl((EcuData) epi));
final byte[] request = protocol.constructReadAddressRequest(
module, subQuery);
LOGGER.debug("TCU CAN Sub Request " + i + " ---> " + asHex(request));
LOGGER.debug(module + " CAN Sub Request " + i + " ---> " + asHex(request));
final byte[] response = protocol.constructReadAddressResponse(
subQuery, pollState);
manager.send(request, response, pollState);

View File

@ -61,20 +61,20 @@ public final class SSMLoggerConnection implements LoggerConnection {
@Override
public void ecuReset(Module module) {
byte[] request = protocol.constructEcuResetRequest(module);
LOGGER.debug("Ecu Reset Request ---> " + asHex(request));
LOGGER.debug(module + " Reset Request ---> " + asHex(request));
byte[] response = manager.send(request);
byte[] processedResponse = protocol.preprocessResponse(request, response, new PollingStateImpl());
LOGGER.debug("Ecu Reset Response <--- " + asHex(processedResponse));
LOGGER.debug(module + " Reset Response <--- " + asHex(processedResponse));
protocol.processEcuResetResponse(processedResponse);
}
@Override
public void ecuInit(EcuInitCallback callback, Module module) {
byte[] request = protocol.constructEcuInitRequest(module);
LOGGER.debug("Ecu Init Request ---> " + asHex(request));
LOGGER.debug(module + " Init Request ---> " + asHex(request));
byte[] response = manager.send(request);
byte[] processedResponse = protocol.preprocessResponse(request, response, new PollingStateImpl());
LOGGER.debug("Ecu Init Response <--- " + asHex(processedResponse));
LOGGER.debug(module + " Init Response <--- " + asHex(processedResponse));
protocol.processEcuInitResponse(callback, processedResponse);
}
@ -98,7 +98,7 @@ public final class SSMLoggerConnection implements LoggerConnection {
module, tcuSubQuery);
byte[] response = new byte[0];
if (addrLength == 1) {
LOGGER.debug("TCU CAN Request ---> " + asHex(request));
LOGGER.debug(module + " CAN Request ---> " + asHex(request));
response = protocol.constructReadAddressResponse(
tcuSubQuery, pollState);
manager.send(request, response, pollState);
@ -110,7 +110,7 @@ public final class SSMLoggerConnection implements LoggerConnection {
}
final byte[] processedResponse = protocol.preprocessResponse(
request, response, pollState);
LOGGER.debug("TCU CAN Response <--- " + asHex(processedResponse));
LOGGER.debug(module + " CAN Response <--- " + asHex(processedResponse));
protocol.processReadAddressResponses(
tcuSubQuery, processedResponse, pollState);
}
@ -119,16 +119,16 @@ public final class SSMLoggerConnection implements LoggerConnection {
final byte[] request = protocol.constructReadAddressRequest(
module, queries);
if (pollState.getCurrentState() == 0) {
LOGGER.debug("Mode:" + pollState.getCurrentState() +
" ECU Request ---> " + asHex(request));
LOGGER.debug("Mode:" + pollState.getCurrentState() + " " +
module + " Request ---> " + asHex(request));
}
final byte[] response = protocol.constructReadAddressResponse(
queries, pollState);
manager.send(request, response, pollState);
final byte[] processedResponse = protocol.preprocessResponse(
request, response, pollState);
LOGGER.debug("Mode:" + pollState.getCurrentState() +
" ECU Response <--- " + asHex(processedResponse));
LOGGER.debug("Mode:" + pollState.getCurrentState() + " " +
module + " Response <--- " + asHex(processedResponse));
protocol.processReadAddressResponses(
queries, processedResponse, pollState);
}
@ -156,14 +156,14 @@ public final class SSMLoggerConnection implements LoggerConnection {
writeKey.getBytes(),
writeQueries.get(writeKey)[0]);
LOGGER.debug("ECU Write Request ---> " + asHex(request));
LOGGER.debug(module + " Write Request ---> " + asHex(request));
final byte[] response = manager.send(request);
byte[] processedResponse =
protocol.preprocessResponse(
request,
response,
new PollingStateImpl());
LOGGER.debug("ECU Write Response <--- " + asHex(processedResponse));
LOGGER.debug(module + " Write Response <--- " + asHex(processedResponse));
protocol.processWriteResponse(
writeQueries.get(writeKey), processedResponse);
}