From: Stefan Tatschner <rumpelsepp@sevenbyte.org>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Jonathan Corbet <corbet@lwn.net>,
linux-can@vger.kernel.org,
Stefan Tatschner <rumpelsepp@sevenbyte.org>
Subject: [PATCH] can-doc: Add hint about getting timestamps
Date: Tue, 24 Nov 2015 15:06:29 +0100 [thread overview]
Message-ID: <1448373989-7241-1-git-send-email-rumpelsepp@sevenbyte.org> (raw)
In-Reply-To: <56546954.1070005@pengutronix.de>
This patch adds a hint about how to get timestamps of received
CAN frames with ioctl(2). This hint has been applied to the
former SocketCAN Documentation, but it got lost during mainlining
the first bits and pieces to linux kernel.
Signed-off-by: Stefan Tatschner <rumpelsepp@sevenbyte.org>
---
Documentation/networking/can.txt | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt
index 05fd83b..6ab619f 100644
--- a/Documentation/networking/can.txt
+++ b/Documentation/networking/can.txt
@@ -372,6 +372,15 @@ solution for a couple of reasons:
nbytes = sendto(s, &frame, sizeof(struct can_frame),
0, (struct sockaddr*)&addr, sizeof(addr));
+ An accurate timestamp can be obtained with an ioctl(2) call after reading
+ a message from the socket:
+
+ struct timeval tv;
+ ioctl(s, SIOCGSTAMP, &tv);
+
+ The timestamp has a resolution of one microsecond and is set automatically
+ at the reception of a CAN frame.
+
Remark about CAN FD (flexible data rate) support:
Generally the handling of CAN FD is very similar to the formerly described
--
2.6.2
next prev parent reply other threads:[~2015-11-24 14:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 13:07 SocketCAN timestamps Stefan Tatschner
2015-11-24 13:42 ` Marc Kleine-Budde
2015-11-24 14:06 ` Stefan Tatschner [this message]
2015-12-08 10:07 ` [PATCH] can-doc: Add hint about getting timestamps Stefan Tatschner
2015-12-10 18:29 ` Jonathan Corbet
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=1448373989-7241-1-git-send-email-rumpelsepp@sevenbyte.org \
--to=rumpelsepp@sevenbyte.org \
--cc=corbet@lwn.net \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=socketcan@hartkopp.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).