4 Protocol description
4.1.14 Command for: Filters, Filter ID, Filter Mask
You can use filters to filter the incoming CAN messages.
1. Command for setting Filter
Syntax:
set filterX [S]
Where:
■
X – 0 to 7: filter number
■
S – 0 or 1: 0 = deactivate filter; 1 = activate filter
Example
// Request: Enable filter 0
set filter0 1
// Response: “OK”
OK
2. Command for setting Filter ID
Syntax:
set filter idX [id]
Where:
■
X – 0 to 7: filter number
■
[id] – value for ID comparison
The bits of the filter ID are directly compared with the bits of the ID of the incoming message.
Example
// Request:
set filter_id0 0x581
// Response: “OK”
OK
3. Command for setting Filter Mask
Syntax:
filter_maskX [id_mask]
Where:
■
X – 0 to 7: filter number
■
[id_mask] – bit mask for ID comparison
The bit mask defines which bits of the ID are taken into consideration.
Example
// Request: Set filter MaskId = 0xFFF
set filter_mask0 0xFFF
// Response: “OK”
OK
Example
set filter_id0 0x07D
set filter_mask0 0x0FF
set filter0 1
Only those messages are shown whose least significant bits correspond to the ID 0x7D.
Version: 1.0.0
16