From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Boris Baskevitch <boris.baskevitch@annecy-elec.fr>
Cc: linux-can@vger.kernel.org
Subject: Re: BCM periodic send
Date: Thu, 04 Apr 2013 20:44:46 +0200 [thread overview]
Message-ID: <515DCA1E.7070502@hartkopp.net> (raw)
In-Reply-To: <000601ce312f$5d07f6b0$1717e410$@annecy-elec.fr>
On 04.04.2013 14:24, Boris Baskevitch wrote:
> I finally found out in a German documentation the actual meaning of ival1,
> ival2 and data (mask) fields in RX_SETUP.
> I didn't see it in English, is there a reference documentation that I
> missed?
Hm - no.
Daniele Venzano suggested to add some documentation for the BCM:
http://www.brownhat.org/docs/socketcan.html
And i started the documentation split in the old BerliOS SVN:
http://svn.berlios.de/wsvn/socketcan/trunk/kernel/2.6/Documentation/networking/can/
But unfortunately this didn't go further ...
> I also have to note for other users the fact that when you get a RX_TIMEOUT
> you have to check msg_head.can_id to find out the offending message ID and
> not frame[0].can_id which is not updated.
The RX_TIMEOUT message has no struct can_frame.
It only consists of a struct bcm_msg_head!
That's why frame[0].can_id is not updated at all in RX_TIMEOUT messages :-)
> So now the timeout feature works in my application but I still have the
> issue with both RX_TIMEOUT and RX_CHANGED flags always set together.
Flags?
RX_TIMEOUT and RX_CHANGED are two different messages (with different sizes).
> This issue is masked when I use the following structure:
> if (msg.msg_head.opcode & RX_CHANGED) {
> // extract data from frame and send to process
> } else if (msg.msg_head.opcode & RX_TIMEOUT) {
> // tell process that the frame is absent
> }
> But if I replace the "else if" by a simple "if" I have wrong timeout
> signaling for each frame received.
> Is it a normal behavior?
Your if statement is wrong.
Use
if (msg.msg_head.opcode == RX_CHANGED)
instead of
if (msg.msg_head.opcode & RX_CHANGED)
The opcode is a enum value and not a bit field.
>
> I'm still working on my timer inaccuracy issue. It's not linked to
> CLOCK_TICK_RATE which is OK. It's probably not directly linked to the BCM,
> but still if anybody has any hints, I'm taking.
No idea so far.
Regards,
Oliver
prev parent reply other threads:[~2013-04-04 18:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 16:11 BCM periodic send Boris Baskevitch
2013-03-28 21:18 ` Oliver Hartkopp
2013-04-03 9:46 ` Boris Baskevitch
2013-04-03 18:29 ` Oliver Hartkopp
2013-04-04 12:24 ` Boris Baskevitch
2013-04-04 18:44 ` Oliver Hartkopp [this message]
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=515DCA1E.7070502@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=boris.baskevitch@annecy-elec.fr \
--cc=linux-can@vger.kernel.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.