
This command exists to change properties of filtering of the CAN (Controller Area Network) interface. CANFLT awaits three or four arguments. If a fourth argument is given, and it is the keyword "NOW", settings are applied immediately but are not stored. Otherwise, if there's no such fourth argument, the settings are stored into internal Flash memory and effective after next reboot. In any case, the meanings of the arguments are...
1. First Filter ID
This is the first message ID that passes the filter. This must be a hexadecimal number. All messages below this ID are discarded.
2. Last Filter ID
This is the last message ID that passes the filter. This must be a hexadecimal number. All messages above this ID are discarded.
3. Filter Mode
This must be one of the keywords OPEN, CLSD, EXT, STD, BOTH. See the following list for filter modes.
OPEN
The filter is completely open. All CAN messages are accepted regardless of other filter settings. Use this configuration only in low bandwidth environments. All messages are stored in the receive FIFO of the module.
CLSD
The filter is closed. No message IDs are accepted except the one that addresses the module itself. See also the CAN command.
EXT
The first and last filter IDs are valid for extended frames only, that is, all standard messages are discarded (except the own ID) and extended IDs are filtered using the given filter range.
STD
The first and last filter IDs are valid for standard frames only. All extended messages are discarded (except the own ID) and standard IDs are filtered by the given filter range.
BOTH
The first and last filter IDs are valid for both, standard and extended frames. All messages in range pass the filter, regardless if they are extended or standard frames.
ERR_OK (0) if all arguments were accepted.
ERR_ARGUMENT (4) if any argument didn't match or the first filter ID was greater than the last filter ID.
Sets the filter range to 0x1f0..0x200 for extended frame, thus, all 17 message ID will be passed by the filter: All standard frames are blocked and the settings will be applied immediately without being stored into Flash memory:
CANFLT 1f0 200 EXT NOW
The filters are embedded in hardware. Using filters that only let pass desired CAN-frames reduces the interrupt load of the CPU.