python-can icon indicating copy to clipboard operation
python-can copied to clipboard

Enable CanFD support in "serial" interface

Open jacky309 opened this issue 2 years ago • 3 comments

  • Remove (DLC <= 8) limitation

jacky309 avatar Apr 13 '23 14:04 jacky309

Any feedback regarding this pull-request ?

jacky309 avatar May 09 '23 12:05 jacky309

Hey @jacky309,

your PR does not take into consideration the fact that a regular CAN frame shouldn't have a payload larger than 8 Byte. If you want to send CAN-FD frames over the interface, I recommend adding proper CAN-FD support to the interface. This would entail the following points:

  • Adding a flag field to the transmission frame
  • sending up to 8 byte if frame.is_fd == False, sending and receiving up to 64 byte if frame.is_fd is True

lumagi avatar May 26 '23 19:05 lumagi

Do you mean that the serial frame format described at https://python-can.readthedocs.io/en/master/interfaces/serial.html should be changed to introduce a new field to identify if a frame is CanFD or not ? This would be a breaking change which is likely to cause some trouble with existing software, right ? IMO, this is not acceptable. This PR, as it is now, introduces the improvement that CanFD frames can be transmitted over a serial connection, without requiring any change to the serial frame format. IMO, this benefit outweights the fact that the length check is gone, so I would consider merging this PR for now.

jacky309 avatar May 31 '23 14:05 jacky309