arduino-CAN
arduino-CAN copied to clipboard
fixing reception of packets with DLC=0
Packets with DLC=0 are reported in the same way as if no packet has been received. As the CAN standard allows packets with DLC=0, I have changed the behaviour of parsePacket to return -1 if no packet has been received and the packet length otherwise.
Hi @mwensing,
Please see the comment in https://github.com/sandeepmistry/arduino-CAN/issues/7#issuecomment-418209109
Maybe the examples should be updated accordingly?
Of course fixing the examples is one way, but in my opinion the return value of the parsePacket function should differ between a packet with length 0 and no packet received at all.
How can we achieve this also with the ReceiverCallback?