Index: dialin/protocols/CAN.py =================================================================== diff -u -rebf0a72a1a1a52f3cfe20975de4857201275888c -r7635412902a86cfda24e86fd2ac1f4a36390ece8 --- dialin/protocols/CAN.py (.../CAN.py) (revision ebf0a72a1a1a52f3cfe20975de4857201275888c) +++ dialin/protocols/CAN.py (.../CAN.py) (revision 7635412902a86cfda24e86fd2ac1f4a36390ece8) @@ -746,17 +746,12 @@ tmp = str(message) + data = tmp[-41:-18].upper() if send: - return "{0} {1} [{2}] {3}\n".format(channel, - hex(message.arbitration_id)[2:], - message.dlc, - tmp[-23:].upper()) - else: - return "{0} {1} [{2}] {3}\n".format(channel, - hex(message.arbitration_id)[2:], - message.dlc, - tmp[-41:-18].upper()) + data = tmp[-23:].upper() + return " {0} {1} [{2}] {3}\n".format(channel, hex(message.arbitration_id)[2:], message.dlc, data) + def do_log_can(self, packet: can.Message, style="candump", channel="can0", send=True): """ Logs all packets sent or received by dialin in candump, or non-candump style format