Linux is asking for SocketCAN ISO-TP console connector #4123

does it matter?
This commit is contained in:
rusefillc 2022-05-10 08:37:46 -04:00
parent 40a9bf5c31
commit bf9229f5ac
2 changed files with 14 additions and 7 deletions

View File

@ -60,9 +60,11 @@ public class PCanIoStream extends AbstractIoStream {
}
private void sendCanPacket(byte[] payLoad) {
log.info("-------sendIsoTp " + payLoad.length + " byte(s):");
if (log.debugEnabled())
log.debug("-------sendIsoTp " + payLoad.length + " byte(s):");
log.info("Sending " + IoStream.printHexBinary(payLoad));
if (log.debugEnabled())
log.debug("Sending " + IoStream.printHexBinary(payLoad));
TPCANMsg msg = new TPCANMsg(Fields.CAN_ECU_SERIAL_RX_ID, PCAN_MESSAGE_STANDARD.getValue(),
(byte) payLoad.length, payLoad);
@ -98,7 +100,8 @@ public class PCanIoStream extends AbstractIoStream {
TPCANMsg rx = new TPCANMsg();
TPCANStatus status = can.Read(CHANNEL, rx, null);
if (status == TPCANStatus.PCAN_ERROR_OK) {
log.info("Got [" + rx + "] id=" + rx.getID() + " len=" + rx.getLength() + ": " + IoStream.printByteArray(rx.getData()));
if (log.debugEnabled())
log.debug("Got [" + rx + "] id=" + rx.getID() + " len=" + rx.getLength() + ": " + IoStream.printByteArray(rx.getData()));
if (rx.getID() != CAN_ECU_SERIAL_TX_ID) {
log.info("Skipping non " + CAN_ECU_SERIAL_TX_ID + " packet");
return;

View File

@ -50,9 +50,11 @@ public class SocketCANIoStream extends AbstractIoStream {
};
private void sendCanPacket(byte[] total) {
log.info("-------sendIsoTp " + total.length + " byte(s):");
if (log.debugEnabled())
log.debug("-------sendIsoTp " + total.length + " byte(s):");
log.info("Sending " + IoStream.printHexBinary(total));
if (log.debugEnabled())
log.debug("Sending " + IoStream.printHexBinary(total));
CanFrame packet = CanFrame.create(Fields.CAN_ECU_SERIAL_RX_ID, FD_NO_FLAGS, total);
try {
@ -100,9 +102,11 @@ public class SocketCANIoStream extends AbstractIoStream {
private void readOnePacket(DataListener listener) {
try {
CanFrame rx = socket.read();
log.info("GOT " + rx);
if (log.debugEnabled())
log.debug("GOT " + rx);
if (rx.getId() != CAN_ECU_SERIAL_TX_ID) {
log.info("Skipping non " + CAN_ECU_SERIAL_TX_ID + " packet");
if (log.debugEnabled())
log.debug("Skipping non " + CAN_ECU_SERIAL_TX_ID + " packet");
return;
}
byte[] raw = new byte[rx.getDataLength()];