Kvaser Linux CANLIB: Welcome to Kvaser CANLIB!
Reading Messages

Incoming messages are placed in a queue in the driver. In most cases the hardware does message buffering as well. You can read the first message in the queue by calling canRead; it will return canERR_NOMSG if there was no message available.

The flag parameter of canRead contains a combination of the canMSG_xxx flags and provides you with more information about the message; for example, a frame with a 29-bit identifier will have the canMSG_EXT bit set, and a remote frame will have the canMSG_RTR bit set. Note that the flag argument is a combination of the canMSG_xxx flags, so more than one bit might be set.

The size of the queues in the driver and hardware is descibed in Message Queue and Buffer Sizes.

If you want to wait until a message arrives (or a timeout occurs) and then read it, call canReadWait().