Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing reception of packets with DLC=0 #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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