arduino-CAN icon indicating copy to clipboard operation
arduino-CAN copied to clipboard

fixing reception of packets with DLC=0

Open mwensing opened this issue 5 years ago • 3 comments

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.

mwensing avatar Sep 04 '19 08:09 mwensing

Hi @mwensing,

Please see the comment in https://github.com/sandeepmistry/arduino-CAN/issues/7#issuecomment-418209109

Maybe the examples should be updated accordingly?

sandeepmistry avatar Sep 08 '19 12:09 sandeepmistry

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.

mwensing avatar Sep 19 '19 14:09 mwensing

How can we achieve this also with the ReceiverCallback?

emekBaris avatar Nov 02 '22 16:11 emekBaris