Hello fra_rio,
The message buffers are exactly what the name says: a buffer in which you can store messages. You have a certain number of such buffers (the ones available on the list). You can choose one in which to store that message.
As for the message ID mask, this is used for filtering a class of messages. So you can have one message buffer receive only 1 class of messages from your network. Let's get into a few details about how the matching is done:
When a CAN frame is received, all message buffers will be scanned (looking for Rx MB that have the ID equal to the received one, or equal to the received one after applying the mask). Lets look at an example:
If we only want to accept frames with ID = 0x01, we can set the ID = 0x01 and the mask to 0x1FFFFFF.
Note: the ID has length is either 11 bits (with standard message, introduce from older CAN standards - I think CAN1.2), either 29 bits (extended ID, introduced from CAN2.0).
In the example above we're using extended ID (29bits), having the mask all 1s (29 bits), thus the value 0x1FFFFFF.
So when a frame arrives, its ID must match every bit from 0x01 -- so with these settings, we're only accepting messages from 0x01.
Lets take a look at another example. Let's say we want to accept IDs from 0x10 through 0x1F. We can set the ID to 0x10, and set the mask to 0x1FFFFF0. With this mask we're basically saying that the last 4 bits can be anything, but the first 25 must match the ID.
Note: for matching, the following must be true:
recv_frame_id & mask == ID (set in block)
Hope this helps,
Razvan.