From: Sebastian Smolorz <ssm@domain.hid>
To: roland Tollenaar <rolandtollenaar@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] catching CAN errors
Date: Mon, 5 Mar 2007 12:06:11 +0100 [thread overview]
Message-ID: <E1HOB10-0007rm-Hj@domain.hid> (raw)
In-Reply-To: <bc4264770703030554g658d3284y297b22af22375e0a@domain.hid>
roland Tollenaar wrote:
> Hi,
>
> What I cannot find an example of is how to filter for more than one error?
>
> ret = rt_dev_setsockopt(can_fd, SOL_CAN_RAW, CAN_RAW_ERR_FILTER,
> &err_mask, sizeof(err_mask));
>
> will pick out the messages that correspond to err_mask. At the moment
> I seem to be picking up CAN_ERR_BUSERROR but not for example
> CAN_ERR_CRTL (mind you I presume the latter should have been
> CAN_ERR_CTRL which is a bit more intuitive). If I want to pick up both
> can I do this
>
>
> ret = rt_dev_setsockopt(can_fd, SOL_CAN_RAW, CAN_RAW_ERR_FILTER,
> &err_mask1, sizeof(err_mask1));
>
> ret = rt_dev_setsockopt(can_fd, SOL_CAN_RAW, CAN_RAW_ERR_FILTER,
> &err_mask2, sizeof(err_mask2));
>
> to set up to get errors of two types or can I only pick up one at a time.?
The error mask is called a *mask* because you can mask those errors you are
interested in. Of course you can set the error *bits* in one mask. Just OR
them.
>
> This is what my CanID and the data sequence looks like:
>
> !0x00000088!<0x088> [8] 00 00 80 19 00 00 00 00
>
> 0x00000080 is CAN_ERR_BUSERROR and
> 0x00000008 is protocol violation CAN_ERR_PROT.
>
> So I seem to have those two errors. Correct?
>
> -What is a protocol error?
Either consult the CAN specification or look at the protocol error types in
the RT-Socket-CAN documentation [1] which give you a rough overview what a
protocol error is. In short: It is a violation against the defined CAN
protocol.
>
> The values in data 2 and 3 seem to say
>
> data 2: 80 Error occurred on transmission
> data 3 19 Ack Slot?
>
> The first one I can understand I have nothing connected to the bus,
> the second one
> What does the second one mean?
It means that no one has ack'ed your transmission. This makes sense since you
didn't connect anything.
[1]
http://www.xenomai.org/documentation/trunk/html/api/group__rtcan.html#g6cf7ee3a3d83315ed2589bb3bdb816b3
--
Sebastian
next prev parent reply other threads:[~2007-03-05 11:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-03 13:54 [Xenomai-help] catching CAN errors roland Tollenaar
2007-03-05 11:06 ` Sebastian Smolorz [this message]
2007-03-05 11:22 ` Roland Tollenaar
2007-03-05 11:49 ` Sebastian Smolorz
[not found] ` <45EC0970.1060606@domain.hid>
2007-03-05 13:40 ` Sebastian Smolorz
2007-03-05 14:08 ` Roland Tollenaar
2007-03-05 14:39 ` Sebastian Smolorz
[not found] ` <45EC2F61.2060307@domain.hid>
2007-03-05 15:18 ` Sebastian Smolorz
2007-03-05 22:15 ` roland Tollenaar
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=E1HOB10-0007rm-Hj@domain.hid \
--to=ssm@domain.hid \
--cc=rolandtollenaar@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.