From ad85a4c479c76336331e589eb3f81a052bf2d1cc Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Wed, 16 Mar 2005 15:47:48 +0000 Subject: update documentation git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-1.0-trunks@11 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c --- Makefile.am | 2 +- candump.8 | 2 +- canecho.8 | 40 ++++++++++++++++++++++++++++++++++++++++ canecho.c | 1 + cansend.8 | 37 +++++++++++++++++++++++++++++++++++++ cansend.c | 14 ++++++++++++++ 6 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 canecho.8 create mode 100644 cansend.8 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 [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 +Robert Schwebel 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 (default PF_CAN = %d)\n", PF_CAN); fprintf(stderr, " -t (default SOCK_RAW = %d)\n", SOCK_RAW); fprintf(stderr, " -p (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 [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 +Robert Schwebel 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 (default PF_CAN = %d)\n", PF_CAN); + fprintf(stderr, " -t (default SOCK_RAW = %d)\n", SOCK_RAW); + fprintf(stderr, " -p (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"); -- cgit v1.2.3