summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Schwebel <r.schwebel@pengutronix.de>2005-03-16 15:47:48 +0000
committerRobert Schwebel <r.schwebel@pengutronix.de>2005-03-16 15:47:48 +0000
commitad85a4c479c76336331e589eb3f81a052bf2d1cc (patch)
treea5a4e0b4a0290d5c0d285986f774f84b23c2037d
parent69952e15d16902a8524bdd4c5610bc13c1316bb9 (diff)
downloadcanutils-ad85a4c479c76336331e589eb3f81a052bf2d1cc.tar.gz
canutils-ad85a4c479c76336331e589eb3f81a052bf2d1cc.tar.xz
update documentation
git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-1.0-trunks@11 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
-rw-r--r--Makefile.am2
-rw-r--r--candump.82
-rw-r--r--canecho.840
-rw-r--r--canecho.c1
-rw-r--r--cansend.837
-rw-r--r--cansend.c14
6 files changed, 94 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 08f883b..9bc7fe3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,7 +11,7 @@ canconfig_SOURCES = canconfig.c
EXTRA_DIST = autogen.sh can.h
-man_MANS = canconfig.8 candump.8
+man_MANS = canconfig.8 candump.8 canecho.8 cansend.8
# info_TEXINFOS = can.texinfo
diff --git a/candump.8 b/candump.8
index 5667e37..cd11f89 100644
--- a/candump.8
+++ b/candump.8
@@ -27,7 +27,7 @@ Specifies the protocol to sniff for; default is CAN_PROTO_RAW, which is
0.
.br
.SH SEE ALSO
-- ifconfig(8), canconfig(8)
+- ifconfig(8), canconfig(8), canecho(8)
.br
- http://www.pengutronix.de/software/socket-can/ (Socket-CAN Project)
.SH AUTHORS
diff --git a/canecho.8 b/canecho.8
new file mode 100644
index 0000000..b24694b
--- /dev/null
+++ b/canecho.8
@@ -0,0 +1,40 @@
+.TH CANECHO 8 "13 March 2005" "canutils" "Linux Programmer's Manual"
+.SH NAME
+canecho \- loop back received CAN messages to the interface
+.SH SYNOPSIS
+.B "canecho <interface> [Options]"
+.br
+.SH DESCRIPTION
+canecho receives messages from a CAN (Controller Area Network) bus
+interface and directly sends the message back to the same interface.
+This can be used to test a remote CAN node by sending messages and
+testing if the same messages are being echoed back.
+
+.SH ARGUMENTS and OPTIONS
+.TP
+.B interface
+The name of the interface. This is usually a driver name followed by
+a unit number, for example "can0".
+.TP
+.B -f family
+Specifies the protocol family which has to be sniffed for. Default is
+PF_CAN, which is 30.
+.TP
+.B -t type
+Specifies the socket type to be sniffed on. Default is SOCK_RAW, which
+is 3.
+.TP
+.B -p proto
+Specifies the protocol to sniff for; default is CAN_PROTO_RAW, which is
+.TP
+.B -v
+Verbose mode.
+0.
+.br
+.SH SEE ALSO
+- ifconfig(8), canconfig(8), candump(8), cansend(8)
+.br
+- http://www.pengutronix.de/software/socket-can/ (Socket-CAN Project)
+.SH AUTHORS
+Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
+Robert Schwebel <r.schwebel@pengutronix.de>
diff --git a/canecho.c b/canecho.c
index a9ee504..32a6972 100644
--- a/canecho.c
+++ b/canecho.c
@@ -24,6 +24,7 @@ void print_usage(char *prg)
fprintf(stderr, "Options: -f <family> (default PF_CAN = %d)\n", PF_CAN);
fprintf(stderr, " -t <type> (default SOCK_RAW = %d)\n", SOCK_RAW);
fprintf(stderr, " -p <proto> (default CAN_PROTO_RAW = %d)\n", CAN_PROTO_RAW);
+ fprintf(stderr, " -v (verbose)\n");
}
void sigterm(int signo)
diff --git a/cansend.8 b/cansend.8
new file mode 100644
index 0000000..f226be4
--- /dev/null
+++ b/cansend.8
@@ -0,0 +1,37 @@
+.TH CANSEND 8 "13 March 2005" "canutils" "Linux Programmer's Manual"
+.SH NAME
+cansend \- send data on a CAN interface
+.SH SYNOPSIS
+.B "send -i <interface> [Options] message"
+.br
+.SH DESCRIPTION
+cansend sends messages on a CAN (Controller Area Network) bus interface.
+
+.SH ARGUMENTS and OPTIONS
+.TP
+.B interface
+The name of the interface. This is usually a driver name followed by
+a unit number, for example "can0".
+.TP
+.B -f family
+Specifies the protocol family which has to be sniffed for. Default is
+PF_CAN, which is 30.
+.TP
+.B -t type
+Specifies the socket type to be sniffed on. Default is SOCK_RAW, which
+is 3.
+.TP
+.B -p proto
+Specifies the protocol to sniff for; default is CAN_PROTO_RAW, which is
+.TP
+.B -v
+Verbose mode.
+0.
+.br
+.SH SEE ALSO
+- ifconfig(8), canconfig(8), candump(8), cansend(8)
+.br
+- http://www.pengutronix.de/software/socket-can/ (Socket-CAN Project)
+.SH AUTHORS
+Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
+Robert Schwebel <r.schwebel@pengutronix.de>
diff --git a/cansend.c b/cansend.c
index baffd69..8497c95 100644
--- a/cansend.c
+++ b/cansend.c
@@ -21,6 +21,15 @@ void sigterm(int signo)
running = 0;
}
+void print_usage(char *prg)
+{
+ fprintf(stderr, "Usage: %s -i [can-interface] [Options]\n", prg);
+ fprintf(stderr, "Options: -f <family> (default PF_CAN = %d)\n", PF_CAN);
+ fprintf(stderr, " -t <type> (default SOCK_RAW = %d)\n", SOCK_RAW);
+ fprintf(stderr, " -p <proto> (default CAN_PROTO_RAW = %d)\n", CAN_PROTO_RAW);
+ fprintf(stderr, " -v (verbose)\n");
+}
+
int main(int argc, char **argv)
{
int family = PF_CAN, type = SOCK_RAW, proto = CAN_PROTO_RAW;
@@ -63,6 +72,11 @@ int main(int argc, char **argv)
break;
}
}
+
+ if (optind == argc) {
+ print_usage(basename(argv[0]));
+ exit(0);
+ }
if (argv[optind] == NULL) {
fprintf(stderr, "No Interface supplied\n");