Skip to content

Conversation

mwensing
Copy link

@mwensing mwensing commented Sep 4, 2019

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.

…eceived, otherwise the length of the packet

this fixes reception of zero-length packets
@sandeepmistry
Copy link
Owner

Hi @mwensing,

Please see the comment in #7 (comment)

Maybe the examples should be updated accordingly?

@mwensing
Copy link
Author

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.

@emekBaris
Copy link
Contributor

How can we achieve this also with the ReceiverCallback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants