minor logging progress

This commit is contained in:
rusefillc 2022-06-22 01:06:55 -04:00
parent 83c43cb8df
commit a22a4ce9df
3 changed files with 6 additions and 4 deletions

View File

@ -101,9 +101,10 @@ public class PCanIoStream extends AbstractIoStream {
TPCANStatus status = can.Read(CHANNEL, rx, null); TPCANStatus status = can.Read(CHANNEL, rx, null);
if (status == TPCANStatus.PCAN_ERROR_OK) { if (status == TPCANStatus.PCAN_ERROR_OK) {
if (log.debugEnabled()) if (log.debugEnabled())
log.debug("Got [" + rx + "] id=" + rx.getID() + " len=" + rx.getLength() + ": " + IoStream.printByteArray(rx.getData())); log.debug("Got [" + rx + "] id=" + String.format("%X", rx.getID()) + " len=" + rx.getLength() + ": " + IoStream.printByteArray(rx.getData()));
if (rx.getID() != CAN_ECU_SERIAL_TX_ID) { if (rx.getID() != CAN_ECU_SERIAL_TX_ID) {
log.info("Skipping non " + CAN_ECU_SERIAL_TX_ID + " packet"); // if (log.debugEnabled())
log.info("Skipping non " + String.format("%X", CAN_ECU_SERIAL_TX_ID) + " packet: " + String.format("%X", rx.getID()));
return; return;
} }
byte[] decode = canDecoder.decodePacket(rx.getData()); byte[] decode = canDecoder.decodePacket(rx.getData());

View File

@ -103,10 +103,10 @@ public class SocketCANIoStream extends AbstractIoStream {
try { try {
CanFrame rx = socket.read(); CanFrame rx = socket.read();
if (log.debugEnabled()) if (log.debugEnabled())
log.debug("GOT " + rx); log.debug("GOT " + String.format("%X", rx));
if (rx.getId() != CAN_ECU_SERIAL_TX_ID) { if (rx.getId() != CAN_ECU_SERIAL_TX_ID) {
if (log.debugEnabled()) if (log.debugEnabled())
log.debug("Skipping non " + CAN_ECU_SERIAL_TX_ID + " packet"); log.debug("Skipping non " + String.format("%X", CAN_ECU_SERIAL_TX_ID) + " packet: " + String.format("%X", rx.getId()));
return; return;
} }
byte[] raw = new byte[rx.getDataLength()]; byte[] raw = new byte[rx.getDataLength()];

View File

@ -64,6 +64,7 @@ public class BinaryProtocolProxy {
while (!targetEcu.isClosed()) { while (!targetEcu.isClosed()) {
byte firstByte = clientStream.getDataBuffer().readByte(timeoutMs); byte firstByte = clientStream.getDataBuffer().readByte(timeoutMs);
if (firstByte == Fields.TS_GET_PROTOCOL_VERSION_COMMAND_F) { if (firstByte == Fields.TS_GET_PROTOCOL_VERSION_COMMAND_F) {
log.info("Responding to GET_PROTOCOL_VERSION with " + TS_PROTOCOL);
clientStream.write(TS_PROTOCOL.getBytes()); clientStream.write(TS_PROTOCOL.getBytes());
clientStream.flush(); clientStream.flush();
continue; continue;