* [PATCH] cangen: Enable sending of RTR CAN frames
@ 2012-07-18 11:33 Rostislav Lisovy
2012-07-22 11:09 ` Oliver Hartkopp
0 siblings, 1 reply; 2+ messages in thread
From: Rostislav Lisovy @ 2012-07-18 11:33 UTC (permalink / raw)
To: linux-can; +Cc: Rostislav Lisovy
Signed-off-by: Rostislav Lisovy <lisovy@gmail.com>
---
cangen.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/cangen.c b/cangen.c
index 4f37808..7147f65 100644
--- a/cangen.c
+++ b/cangen.c
@@ -101,6 +101,7 @@ void print_usage(char *prg)
" write() syscalls)\n");
fprintf(stderr, " -x (disable local loopback of "
"generated CAN frames)\n");
+ fprintf(stderr, " -R (send RTR frame)\n");
fprintf(stderr, " -v (increment verbose level for "
"printing sent CAN frames)\n\n");
fprintf(stderr, "Generation modes:\n");
@@ -141,6 +142,7 @@ int main(int argc, char **argv)
unsigned char dlc_mode = MODE_RANDOM;
unsigned char loopback_disable = 0;
unsigned char verbose = 0;
+ unsigned char rtr_frame = 0;
int count = 0;
uint64_t incdata = 0;
@@ -165,7 +167,7 @@ int main(int argc, char **argv)
signal(SIGHUP, sigterm);
signal(SIGINT, sigterm);
- while ((opt = getopt(argc, argv, "ig:eI:L:D:xp:n:vh?")) != -1) {
+ while ((opt = getopt(argc, argv, "ig:eI:L:D:xp:n:vRh?")) != -1) {
switch (opt) {
case 'i':
@@ -224,6 +226,10 @@ int main(int argc, char **argv)
loopback_disable = 1;
break;
+ case 'R':
+ rtr_frame = 1;
+ break;
+
case 'p':
polltimeout = strtoul(optarg, NULL, 10);
break;
@@ -268,6 +274,9 @@ int main(int argc, char **argv)
frame.can_id &= CAN_SFF_MASK;
}
+ if (rtr_frame)
+ frame.can_id |= CAN_RTR_FLAG;
+
if (extended)
frame.can_id |= CAN_EFF_FLAG;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cangen: Enable sending of RTR CAN frames
2012-07-18 11:33 [PATCH] cangen: Enable sending of RTR CAN frames Rostislav Lisovy
@ 2012-07-22 11:09 ` Oliver Hartkopp
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Hartkopp @ 2012-07-22 11:09 UTC (permalink / raw)
To: Rostislav Lisovy; +Cc: linux-can
On 18.07.2012 13:33, Rostislav Lisovy wrote:
> Signed-off-by: Rostislav Lisovy <lisovy@gmail.com>
> ---
> cangen.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
Applied to can-utils.
Tnx & best regards,
Oliver
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-22 11:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18 11:33 [PATCH] cangen: Enable sending of RTR CAN frames Rostislav Lisovy
2012-07-22 11:09 ` Oliver Hartkopp
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.