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);