0

I Don't understand why this example code from mcp_can library &&'s the received can Id with 0x1FFFFFFF. What kind of bits can be lost? because the 3 MSB bits can be lost with this instruction.

if((rxId & 0x80000000) == 0x80000000)     // Determine if ID is standard (11 bits) or extended (29 bits)
  sprintf(msgString, "Extended ID: 0x%.8lX  DLC: %1d  Data:", (rxId & 0x1FFFFFFF), len);
else
sprintf(msgString, "Standard ID: 0x%.3lX       DLC: %1d  Data:", rxId, len);
Piet Jan
  • 11
  • 2
  • According to the comment and the condition, at least bit `32` seems to contain some kind of header information. However `0x1FFFFFFF` give you the 29 bits mentioned in the comment. – jp-jee Nov 18 '16 at 21:00

1 Answers1

0

It's just because 2.0b is 29 bits so nothing should be lost

Piet Jan
  • 11
  • 2