linux - Heavily confused by candump (SocketCAN) ID filtering feature -
in nutshell, want candump show me frames ids 0x00200200 or 0x255.
so this:
candump can0,00200200:0,255:0
but gives frames, , each frame shown twice. i.e. output of:
cansend can0 256#112233
would this:
can0 256 [3] 11 22 33 can0 256 [3] 11 22 33
aside filter not behaving expected , passing through 0x256, fact shows twice suggests frames matched both filters, makes less sense me. can explain why happening, , perhaps show me correct way it?
from of candump:
<can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)
now, when mask 0, every can id match it. can_id has no real effect, why messages pass, each required bit in can id should set 1 in mask.
regarding duplication problem, happens because use 2 filters, although not sure this.
what want is:
candump can0,00200200:1fffffff,255:7ff
example (provided op):
enyquist:~$ candump vcan0,00200200:1fffffff,255:7ff & [1] 7339 enyquist:~$ cansend vcan0 002001fe#1122 enyquist:~$ cansend vcan0 002001ff#1122 enyquist:~$ cansend vcan0 00200200#1122 vcan0 00200200 [2] 11 22 enyquist:~$ cansend vcan0 00200201#1122 enyquist:~$ cansend vcan0 00200202#1122 enyquist:~$ enyquist:~$ cansend vcan0 253#1122 enyquist:~$ cansend vcan0 254#1122 enyquist:~$ cansend vcan0 255#1122 vcan0 255 [2] 11 22 enyquist:~$ cansend vcan0 256#1122 enyquist:~$ cansend vcan0 257#1122 enyquist:~$
Comments
Post a Comment