This filter works as follows: A received CAN ID is AND'ed bitwise with can_mask
and then compared to can_id
. If this comparison is true the message will be received by the socket.
Multiple filters can be arranged in a filter list and set with Sockopts. If one of these filters matches a CAN ID upon reception of a CAN frame, this frame is accepted.
can_id
and none for can_mask
. This means that the RTR bit is not taken into account while filtering messages.can_id
. If it is cleared only standard IDs are accepted. Data Fields | |
uint32_t | can_id |
CAN ID which must match with incoming IDs after passing the mask. | |
uint32_t | can_mask |
Mask which is applied to incoming IDs. |
uint32_t can_filter_t::can_mask |
Mask which is applied to incoming IDs.
See CAN ID masks if exactly one CAN ID should come through.