All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Oliver Hartkopp <socketcan@domain.hid>
Cc: socketcan-core@domain.hid, xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] Re: Magics of [CAN] message filtering
Date: Fri, 16 Feb 2007 22:04:28 +0100	[thread overview]
Message-ID: <45D61C5C.8090201@domain.hid> (raw)
In-Reply-To: <45D60C78.5090106@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 2024 bytes --]

Hi all,

I just bluntly jump in and capture this posting for the original issue
behind it. :->

Oliver Hartkopp wrote:
> Hello Wolfgang,
> 
> indeed you are right with all your examples.
> 
> To get more practice i would suggest to check out the possibilities by 
> using the tools 'cangen', 'cansend' and 'candump'.
> 
> E.g. these are /your/ examples on the virtual CAN interface vcan0:
> 
>> The following filter will select all messages, extended and standard 
>> messages:
>>
>>   rfilter[0].can_id   = 0x0;
>>   rfilter[0].can_mask = 0x0;
>>   
> candump vcan0
> or
> candump -m 0 -v 0 vcan0
> /* mask = value = 0 is the default */
> 
>> The following filter will select only extended messages:
>>
>>   rfilter[0].can_id   = CAN_EFF_FLAG;
>>   rfilter[0].can_mask = CAN_EFF_FLAG;
>>
>>   
> candump -m 0x80000000 -v 0x80000000 vcan0
>> The following filter will select only standard messages:
>>
>>   rfilter[0].can_id   = CAN_EFF_FLAG | CAN_INV_FILTER;
>>   rfilter[0].can_mask = CAN_EFF_FLAG;
>>
>>   
> candump -m 0x80000000 -v 0x80000000 -i 1 vcan0

...and I guess this would work as well:

candump -m 0x80000000 -v 0x00000000 vcan0

>> And RTR-Messages could be filtered in a similar way. Is this correct?
>>
>>   
> Yes. E.g.
> 
> candump -m 0x40000000 -v 0x40000000 vcan0
> 

Makes perfect sense, it's considering EFF and RTR as yet some more bits
of the CAN ID. That's what I actually tried to apply yesterday under
Xenomai and wondered why it didn't work. :o)

So, to align RT-Socket-CAN with plain Socket-CAN again, we (Xenomai) should

a) include EFF and RTS transparently into mask building and ID
   comparison
b) add support for inverse masks

Wolfgang, as we currently have some "exception" specified in the CAN
profile, I would just fix the code in this regard (for 2.3.1). The two
changes above should be queued for Xenomai 2.4 together with a profile
and revision number update - to avoid breakage inside the stable series.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

       reply	other threads:[~2007-02-16 21:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <45D425B8.7070401@domain.hid>
     [not found] ` <45D60C78.5090106@domain.hid>
2007-02-16 21:04   ` Jan Kiszka [this message]
     [not found]     ` <45D709E4.80409@domain.hid>
2007-02-17 17:44       ` [Xenomai-core] Re: Magics of [CAN] message filtering Jan Kiszka
2007-02-17 18:12         ` Wolfgang Grandegger
2007-02-17 18:56           ` Jan Kiszka
2007-02-18 18:24             ` Jan Kiszka
2007-02-18 20:41               ` Wolfgang Grandegger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45D61C5C.8090201@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=socketcan-core@domain.hid \
    --cc=socketcan@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.