Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DLC=0 frames aren't received #7

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

Closed
DerMax93 opened this issue Aug 29, 2018 · 2 comments
Closed

DLC=0 frames aren't received #7

DerMax93 opened this issue Aug 29, 2018 · 2 comments

Comments

@DerMax93
Copy link

I used the library for testing one of my builds and I noticed that it doesn't properly receive frames with DLC=0. While uncommon this type of frame is not ruled-out by the standard. The MCP2515 does acknowledge the frame on the bus properly, but the library does not forward it to the user-code.

I "fixed" the problem in my version by changing the return value of an empty frame to -1 (in parsePacket-function) and checking for a positive return-value in the polling-loop. Maybe you want to incorporate a similar fix into your version.

@sandeepmistry
Copy link
Owner

Hi @DerMax93,

So, the parsePacket() method was aimed to match the UDP classes: https://www.arduino.cc/en/Reference/EthernetUDPParsePacket

Returns
int: the size of a received UDP packet

Are you trying to get the ID of the sender of the DLC=0? Would something like this work for your use case?

if (CAN.parsePacket() || CAN. packetId() != -1) {
  // received a packet ....
}

@sandeepmistry
Copy link
Owner

Closing due to lack of feedback.

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

No branches or pull requests

2 participants