Merge pull request #69 from gerasiov/help-reformat

Reformat output of help/usage information - Thanks Alexander!
pull/201/head
Oliver Hartkopp 2020-04-27 09:16:13 +02:00 committed by GitHub
commit f91b537c01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 327 additions and 267 deletions

View File

@ -61,9 +61,11 @@ extern int optind, opterr, optopt;
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "%s - convert ASC logfile to compact CAN frame logfile.\n", prg);
fprintf(stderr, "Usage: %s\n", prg); fprintf(stderr, "Usage: %s\n", prg);
fprintf(stderr, "Options: -I <infile> (default stdin)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -O <outfile> (default stdout)\n"); fprintf(stderr, "\t-I <infile>\t(default stdin)\n");
fprintf(stderr, "\t-O <outfile>\t(default stdout)\n");
} }
void prframe(FILE *file, struct timeval *tv, int dev, struct can_frame *cf) { void prframe(FILE *file, struct timeval *tv, int dev, struct can_frame *cf) {

View File

@ -131,17 +131,16 @@ static inline void *netdev_priv(const struct net_device *dev)
static void print_usage(char *cmd) static void print_usage(char *cmd)
{ {
printf("%s - calculate CAN bit timing parameters.\n", cmd);
printf("Usage: %s [options] [<CAN-contoller-name>]\n" printf("Usage: %s [options] [<CAN-contoller-name>]\n"
"\tOptions:\n" "Options:\n"
"\t-q : don't print header line\n" "\t-q don't print header line\n"
"\t-l : list all support CAN controller names\n" "\t-l list all support CAN controller names\n"
"\t-b <bitrate> : bit-rate in bits/sec\n" "\t-b <bitrate> bit-rate in bits/sec\n"
"\t-s <samp_pt> : sample-point in one-tenth of a percent\n" "\t-s <samp_pt> sample-point in one-tenth of a percent\n"
"\t or 0 for CIA recommended sample points\n" "\t or 0 for CIA recommended sample points\n"
"\t-c <clock> : real CAN system clock in Hz\n", "\t-c <clock> real CAN system clock in Hz\n",
cmd); cmd);
exit(EXIT_FAILURE);
} }
static void printf_btr_sja1000(struct can_bittiming *bt, bool hdr) static void printf_btr_sja1000(struct can_bittiming *bt, bool hdr)
@ -638,7 +637,7 @@ int main(int argc, char *argv[])
const struct calc_bittiming_const *btc; const struct calc_bittiming_const *btc;
while ((opt = getopt(argc, argv, "b:c:lqs:")) != -1) { while ((opt = getopt(argc, argv, "b:c:lqs:?")) != -1) {
switch (opt) { switch (opt) {
case 'b': case 'b':
bitrate_nominal = atoi(optarg); bitrate_nominal = atoi(optarg);
@ -660,14 +659,22 @@ int main(int argc, char *argv[])
spt_nominal = strtoul(optarg, NULL, 10); spt_nominal = strtoul(optarg, NULL, 10);
break; break;
case '?':
print_usage(basename(argv[0]));
exit(EXIT_SUCCESS);
break;
default: default:
print_usage(argv[0]); print_usage(basename(argv[0]));
exit(EXIT_FAILURE);
break; break;
} }
} }
if (argc > optind + 1) if (argc > optind + 1) {
print_usage(argv[0]); print_usage(argv[0]);
exit(EXIT_FAILURE);
}
if (argc == optind + 1) if (argc == optind + 1)
name = argv[optind]; name = argv[optind];
@ -677,8 +684,10 @@ int main(int argc, char *argv[])
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
if (spt_nominal && (spt_nominal >= 1000 || spt_nominal < 100)) if (spt_nominal && (spt_nominal >= 1000 || spt_nominal < 100)) {
print_usage(argv[0]); print_usage(argv[0]);
exit(EXIT_FAILURE);
}
for (i = 0; i < ARRAY_SIZE(can_calc_consts); i++) { for (i = 0; i < ARRAY_SIZE(can_calc_consts); i++) {
if (name && strcmp(can_calc_consts[i].bittiming_const.name, name)) if (name && strcmp(can_calc_consts[i].bittiming_const.name, name))

View File

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
/* /*
* canbusload.c * canbusload.c - monitor CAN bus load
* *
* Copyright (c) 2002-2008 Volkswagen Group Electronic Research * Copyright (c) 2002-2008 Volkswagen Group Electronic Research
* All rights reserved. * All rights reserved.
@ -91,14 +91,16 @@ static char *prg;
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "%s - monitor CAN bus load.\n", prg);
fprintf(stderr, "\nUsage: %s [options] <CAN interface>+\n", prg); fprintf(stderr, "\nUsage: %s [options] <CAN interface>+\n", prg);
fprintf(stderr, " (use CTRL-C to terminate %s)\n\n", prg); fprintf(stderr, " (use CTRL-C to terminate %s)\n\n", prg);
fprintf(stderr, "Options: -t (show current time on the first line)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -c (colorize lines)\n"); fprintf(stderr, " -t (show current time on the first line)\n");
fprintf(stderr, " -b (show bargraph in %d%% resolution)\n", PERCENTRES); fprintf(stderr, " -c (colorize lines)\n");
fprintf(stderr, " -r (redraw the terminal - similar to top)\n"); fprintf(stderr, " -b (show bargraph in %d%% resolution)\n", PERCENTRES);
fprintf(stderr, " -i (ignore bitstuffing in bandwidth calculation)\n"); fprintf(stderr, " -r (redraw the terminal - similar to top)\n");
fprintf(stderr, " -e (exact calculation of stuffed bits)\n"); fprintf(stderr, " -i (ignore bitstuffing in bandwidth calculation)\n");
fprintf(stderr, " -e (exact calculation of stuffed bits)\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "Up to %d CAN interfaces with mandatory bitrate can be specified on the \n", MAXSOCK); fprintf(stderr, "Up to %d CAN interfaces with mandatory bitrate can be specified on the \n", MAXSOCK);
fprintf(stderr, "commandline in the form: <ifname>@<bitrate>\n\n"); fprintf(stderr, "commandline in the form: <ifname>@<bitrate>\n\n");
@ -107,7 +109,7 @@ void print_usage(char *prg)
fprintf(stderr, "Due to the bitstuffing estimation the calculated busload may exceed 100%%.\n"); fprintf(stderr, "Due to the bitstuffing estimation the calculated busload may exceed 100%%.\n");
fprintf(stderr, "For each given interface the data is presented in one line which contains:\n\n"); fprintf(stderr, "For each given interface the data is presented in one line which contains:\n\n");
fprintf(stderr, "(interface) (received CAN frames) (used bits total) (used bits for payload)\n"); fprintf(stderr, "(interface) (received CAN frames) (used bits total) (used bits for payload)\n");
fprintf(stderr, "\nExample:\n"); fprintf(stderr, "\nExamples:\n");
fprintf(stderr, "\nuser$> canbusload can0@100000 can1@500000 can2@500000 can3@500000 -r -t -b -c\n\n"); fprintf(stderr, "\nuser$> canbusload can0@100000 can1@500000 can2@500000 can3@500000 -r -t -b -c\n\n");
fprintf(stderr, "%s 2014-02-01 21:13:16 (worst case bitstuffing)\n", prg); fprintf(stderr, "%s 2014-02-01 21:13:16 (worst case bitstuffing)\n", prg);
fprintf(stderr, " can0@100000 805 74491 36656 74%% |XXXXXXXXXXXXXX......|\n"); fprintf(stderr, " can0@100000 805 74491 36656 74%% |XXXXXXXXXXXXXX......|\n");

View File

@ -116,9 +116,11 @@ static volatile int running = 1;
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "%s - dump CAN bus traffic.\n", prg);
fprintf(stderr, "\nUsage: %s [options] <CAN interface>+\n", prg); fprintf(stderr, "\nUsage: %s [options] <CAN interface>+\n", prg);
fprintf(stderr, " (use CTRL-C to terminate %s)\n\n", prg); fprintf(stderr, " (use CTRL-C to terminate %s)\n\n", prg);
fprintf(stderr, "Options: -t <type> (timestamp: (a)bsolute/(d)elta/(z)ero/(A)bsolute w date)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -t <type> (timestamp: (a)bsolute/(d)elta/(z)ero/(A)bsolute w date)\n");
fprintf(stderr, " -H (read hardware timestamps instead of system timestamps)\n"); fprintf(stderr, " -H (read hardware timestamps instead of system timestamps)\n");
fprintf(stderr, " -c (increment color mode level)\n"); fprintf(stderr, " -c (increment color mode level)\n");
fprintf(stderr, " -i (binary output - may exceed 80 chars/line)\n"); fprintf(stderr, " -i (binary output - may exceed 80 chars/line)\n");
@ -137,22 +139,23 @@ void print_usage(char *prg)
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "Up to %d CAN interfaces with optional filter sets can be specified\n", MAXSOCK); fprintf(stderr, "Up to %d CAN interfaces with optional filter sets can be specified\n", MAXSOCK);
fprintf(stderr, "on the commandline in the form: <ifname>[,filter]*\n"); fprintf(stderr, "on the commandline in the form: <ifname>[,filter]*\n");
fprintf(stderr, "\nComma separated filters can be specified for each given CAN interface:\n"); fprintf(stderr, "\nFilters:\n");
fprintf(stderr, " <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)\n"); fprintf(stderr, " Comma separated filters can be specified for each given CAN interface:\n");
fprintf(stderr, " <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)\n"); fprintf(stderr, "<can_id>:<can_mask>\n\t(matches when <received_can_id> & mask == can_id & mask)\n");
fprintf(stderr, " #<error_mask> (set error frame filter, see include/linux/can/error.h)\n"); fprintf(stderr, "<can_id>~<can_mask>\n\t(matches when <received_can_id> & mask != can_id & mask)\n");
fprintf(stderr, " [j|J] (join the given CAN filters - logical AND semantic)\n"); fprintf(stderr, "#<error_mask>\n\t(set error frame filter, see include/linux/can/error.h)\n");
fprintf(stderr, "[j|J]\n\t(join the given CAN filters - logical AND semantic)\n");
fprintf(stderr, "\nCAN IDs, masks and data content are given and expected in hexadecimal values.\n"); fprintf(stderr, "\nCAN IDs, masks and data content are given and expected in hexadecimal values.\n");
fprintf(stderr, "When the can_id is 8 digits long the CAN_EFF_FLAG is set for 29 bit EFF format.\n"); fprintf(stderr, "When the can_id is 8 digits long the CAN_EFF_FLAG is set for 29 bit EFF format.\n");
fprintf(stderr, "Without any given filter all data frames are received ('0:0' default filter).\n"); fprintf(stderr, "Without any given filter all data frames are received ('0:0' default filter).\n");
fprintf(stderr, "\nUse interface name '%s' to receive from all CAN interfaces.\n", ANYDEV); fprintf(stderr, "\nUse interface name '%s' to receive from all CAN interfaces.\n", ANYDEV);
fprintf(stderr, "\nExamples:\n"); fprintf(stderr, "\nExamples:\n");
fprintf(stderr, "%s -c -c -ta can0,123:7FF,400:700,#000000FF can2,400~7F0 can3 can8\n", prg); fprintf(stderr, "%s -c -c -ta can0,123:7FF,400:700,#000000FF can2,400~7F0 can3 can8\n\n", prg);
fprintf(stderr, "%s -l any,0~0,#FFFFFFFF (log only error frames but no(!) data frames)\n", prg); fprintf(stderr, "%s -l any,0~0,#FFFFFFFF\n\t(log only error frames but no(!) data frames)\n", prg);
fprintf(stderr, "%s -l any,0:0,#FFFFFFFF (log error frames and also all data frames)\n", prg); fprintf(stderr, "%s -l any,0:0,#FFFFFFFF\n\t(log error frames and also all data frames)\n", prg);
fprintf(stderr, "%s vcan2,12345678:DFFFFFFF (match only for extended CAN ID 12345678)\n", prg); fprintf(stderr, "%s vcan2,12345678:DFFFFFFF\n\t(match only for extended CAN ID 12345678)\n", prg);
fprintf(stderr, "%s vcan2,123:7FF (matches CAN ID 123 - including EFF and RTR frames)\n", prg); fprintf(stderr, "%s vcan2,123:7FF\n\t(matches CAN ID 123 - including EFF and RTR frames)\n", prg);
fprintf(stderr, "%s vcan2,123:C00007FF (matches CAN ID 123 - only SFF and non-RTR frames)\n", prg); fprintf(stderr, "%s vcan2,123:C00007FF\n\t(matches CAN ID 123 - only SFF and non-RTR frames)\n", prg);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }

View File

@ -52,9 +52,11 @@ static int exit_sig;
static void print_usage(char *prg) static void print_usage(char *prg)
{ {
fprintf(stderr, fprintf(stderr,
"%s - Full-duplex test program (DUT and host part).\n"
"Usage: %s [options] <can-interface>\n" "Usage: %s [options] <can-interface>\n"
"\n" "\n"
"Options: -v (low verbosity)\n" "Options:\n"
" -v (low verbosity)\n"
" -vv (high verbosity)\n" " -vv (high verbosity)\n"
" -g (generate messages)\n" " -g (generate messages)\n"
" -l COUNT (test loop count)\n" " -l COUNT (test loop count)\n"
@ -64,10 +66,12 @@ static void print_usage(char *prg)
"<can-interface> are sent back incrementing the CAN id and\n" "<can-interface> are sent back incrementing the CAN id and\n"
"all data bytes. The program can be aborted with ^C.\n" "all data bytes. The program can be aborted with ^C.\n"
"\n" "\n"
"Example:\n" "Examples:\n"
"\ton DUT : %s -v can0\n" "\ton DUT:\n"
"\ton Host: %s -g -v can2\n", "%s -v can0\n"
prg, prg, prg); "\ton Host:\n"
"%s -g -v can2\n",
prg, prg, prg, prg);
exit(1); exit(1);
} }
@ -320,7 +324,7 @@ int main(int argc, char *argv[])
signal(SIGHUP, signal_handler); signal(SIGHUP, signal_handler);
signal(SIGINT, signal_handler); signal(SIGINT, signal_handler);
while ((opt = getopt(argc, argv, "gl:v")) != -1) { while ((opt = getopt(argc, argv, "gl:v?")) != -1) {
switch (opt) { switch (opt) {
case 'v': case 'v':
verbose++; verbose++;
@ -334,6 +338,7 @@ int main(int argc, char *argv[])
echo_gen = 1; echo_gen = 1;
break; break;
case '?':
default: default:
print_usage(basename(argv[0])); print_usage(basename(argv[0]));
break; break;

View File

@ -78,9 +78,11 @@ static unsigned long long enobufs_count;
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "%s - CAN frames generator for testing purposes.\n", prg);
fprintf(stderr, "\n%s: generate CAN frames\n\n", prg); fprintf(stderr, "\n%s: generate CAN frames\n\n", prg);
fprintf(stderr, "Usage: %s [options] <CAN interface>\n", prg); fprintf(stderr, "Usage: %s [options] <CAN interface>\n", prg);
fprintf(stderr, "Options: -g <ms> (gap in milli seconds " fprintf(stderr, "Options:\n");
fprintf(stderr, " -g <ms> (gap in milli seconds "
"- default: %d ms)\n", DEFAULT_GAP); "- default: %d ms)\n", DEFAULT_GAP);
fprintf(stderr, " -e (generate extended frame mode " fprintf(stderr, " -e (generate extended frame mode "
"(EFF) CAN frames)\n"); "(EFF) CAN frames)\n");
@ -106,25 +108,25 @@ void print_usage(char *prg)
fprintf(stderr, " -v (increment verbose level for " fprintf(stderr, " -v (increment verbose level for "
"printing sent CAN frames)\n\n"); "printing sent CAN frames)\n\n");
fprintf(stderr, "Generation modes:\n"); fprintf(stderr, "Generation modes:\n");
fprintf(stderr, "'r' => random values (default)\n"); fprintf(stderr, " 'r' => random values (default)\n");
fprintf(stderr, "'i' => increment values\n"); fprintf(stderr, " 'i' => increment values\n");
fprintf(stderr, "<hexvalue> => fix value using <hexvalue>\n\n"); fprintf(stderr, " <hexvalue> => fix value using <hexvalue>\n\n");
fprintf(stderr, "When incrementing the CAN data the data length code " fprintf(stderr, "When incrementing the CAN data the data length code "
"minimum is set to 1.\n"); "minimum is set to 1.\n");
fprintf(stderr, "CAN IDs and data content are given and expected in hexadecimal values.\n\n"); fprintf(stderr, "CAN IDs and data content are given and expected in hexadecimal values.\n\n");
fprintf(stderr, "Examples:\n"); fprintf(stderr, "Examples:\n");
fprintf(stderr, "%s vcan0 -g 4 -I 42A -L 1 -D i -v -v ", prg); fprintf(stderr, "%s vcan0 -g 4 -I 42A -L 1 -D i -v -v\n", prg);
fprintf(stderr, "(fixed CAN ID and length, inc. data)\n"); fprintf(stderr, "\t(fixed CAN ID and length, inc. data)\n");
fprintf(stderr, "%s vcan0 -e -L i -v -v -v ", prg); fprintf(stderr, "%s vcan0 -e -L i -v -v -v\n", prg);
fprintf(stderr, "(generate EFF frames, incr. length)\n"); fprintf(stderr, "\t(generate EFF frames, incr. length)\n");
fprintf(stderr, "%s vcan0 -D 11223344DEADBEEF -L 8 ", prg); fprintf(stderr, "%s vcan0 -D 11223344DEADBEEF -L 8\n", prg);
fprintf(stderr, "(fixed CAN data payload and length)\n"); fprintf(stderr, "\t(fixed CAN data payload and length)\n");
fprintf(stderr, "%s vcan0 -g 0 -i -x ", prg); fprintf(stderr, "%s vcan0 -g 0 -i -x\n", prg);
fprintf(stderr, "(full load test ignoring -ENOBUFS)\n"); fprintf(stderr, "\t(full load test ignoring -ENOBUFS)\n");
fprintf(stderr, "%s vcan0 -g 0 -p 10 -x ", prg); fprintf(stderr, "%s vcan0 -g 0 -p 10 -x\n", prg);
fprintf(stderr, "(full load test with polling, 10ms timeout)\n"); fprintf(stderr, "\t(full load test with polling, 10ms timeout)\n");
fprintf(stderr, "%s vcan0 ", prg); fprintf(stderr, "%s vcan0\n", prg);
fprintf(stderr, "(my favourite default :)\n\n"); fprintf(stderr, "\t(my favourite default :)\n\n");
} }
void sigterm(int signo) void sigterm(int signo)

79
cangw.c
View File

@ -222,55 +222,60 @@ void print_cs_crc8(struct cgw_csum_crc8 *cs_crc8)
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "%s - manage PF_CAN netlink gateway.\n", prg);
fprintf(stderr, "\nUsage: %s [options]\n\n", prg); fprintf(stderr, "\nUsage: %s [options]\n\n", prg);
fprintf(stderr, "Commands: -A (add a new rule)\n"); fprintf(stderr, "Commands:\n");
fprintf(stderr, " -D (delete a rule)\n"); fprintf(stderr, " -A (add a new rule)\n");
fprintf(stderr, " -F (flush / delete all rules)\n"); fprintf(stderr, " -D (delete a rule)\n");
fprintf(stderr, " -L (list all rules)\n"); fprintf(stderr, " -F (flush / delete all rules)\n");
fprintf(stderr, "Mandatory: -s <src_dev> (source netdevice)\n"); fprintf(stderr, " -L (list all rules)\n");
fprintf(stderr, "Mandatory:\n");
fprintf(stderr, " -s <src_dev> (source netdevice)\n");
fprintf(stderr, " -d <dst_dev> (destination netdevice)\n"); fprintf(stderr, " -d <dst_dev> (destination netdevice)\n");
fprintf(stderr, "Options: -X (this is a CAN FD rule)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -t (preserve src_dev rx timestamp)\n"); fprintf(stderr, " -X (this is a CAN FD rule)\n");
fprintf(stderr, " -e (echo sent frames - recommended on vcanx)\n"); fprintf(stderr, " -t (preserve src_dev rx timestamp)\n");
fprintf(stderr, " -i (allow to route to incoming interface)\n"); fprintf(stderr, " -e (echo sent frames - recommended on vcanx)\n");
fprintf(stderr, " -u <uid> (user defined modification identifier)\n"); fprintf(stderr, " -i (allow to route to incoming interface)\n");
fprintf(stderr, " -l <hops> (limit the number of frame hops / routings)\n"); fprintf(stderr, " -u <uid> (user defined modification identifier)\n");
fprintf(stderr, " -f <filter> (set CAN filter)\n"); fprintf(stderr, " -l <hops> (limit the number of frame hops / routings)\n");
fprintf(stderr, " -m <mod> (set Classic CAN frame modifications)\n"); fprintf(stderr, " -f <filter> (set CAN filter)\n");
fprintf(stderr, " -M <MOD> (set CAN FD frame modifications)\n"); fprintf(stderr, " -m <mod> (set Classic CAN frame modifications)\n");
fprintf(stderr, " -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR checksum)\n"); fprintf(stderr, " -M <MOD> (set CAN FD frame modifications)\n");
fprintf(stderr, " -c <from>:<to>:<result>:<init_val>:<xor_val>:<crctab[256]> (CRC8 cs)\n"); fprintf(stderr, " -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR checksum)\n");
fprintf(stderr, " -p <profile>:[<profile_data>] (CRC8 checksum profile & parameters)\n"); fprintf(stderr, " -c <from>:<to>:<result>:<init_val>:<xor_val>:<crctab[256]> (CRC8 cs)\n");
fprintf(stderr, " -p <profile>:[<profile_data>] (CRC8 checksum profile & parameters)\n");
fprintf(stderr, "\nValues are given and expected in hexadecimal values. Leading 0s can be omitted.\n"); fprintf(stderr, "\nValues are given and expected in hexadecimal values. Leading 0s can be omitted.\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "<filter> is a <value><mask> CAN identifier filter\n"); fprintf(stderr, "<filter> is a <value><mask> CAN identifier filter:\n");
fprintf(stderr, " <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)\n"); fprintf(stderr, " <can_id>:<can_mask>\t(matches when <received_can_id> & mask == can_id & mask)\n");
fprintf(stderr, " <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)\n"); fprintf(stderr, " <can_id>~<can_mask>\t(matches when <received_can_id> & mask != can_id & mask)\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "<mod> is a CAN frame modification instruction consisting of\n"); fprintf(stderr, "<mod> is a CAN frame modification instruction consisting of\n");
fprintf(stderr, "<instruction>:<can_frame-elements>:<can_id>.<can_dlc>.<can_data>\n"); fprintf(stderr, "<instruction>:<can_frame-elements>:<can_id>.<can_dlc>.<can_data>\n");
fprintf(stderr, " - <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\n"); fprintf(stderr, " <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\n");
fprintf(stderr, " - <can_frame-elements> is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\n"); fprintf(stderr, " <can_frame-elements> is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\n");
fprintf(stderr, " - <can_id> is an u32 value containing the CAN Identifier\n"); fprintf(stderr, " <can_id> is an u32 value containing the CAN Identifier\n");
fprintf(stderr, " - <can_dlc> is an u8 value containing the data length code (0 .. 8)\n"); fprintf(stderr, " <can_dlc> is an u8 value containing the data length code (0 .. 8)\n");
fprintf(stderr, " - <can_data> is always eight(!) u8 values containing the CAN frames data\n"); fprintf(stderr, " <can_data> is always eight(!) u8 values containing the CAN frames data\n");
fprintf(stderr, "\n");
fprintf(stderr, "<MOD> is a CAN FD frame modification instruction consisting of\n"); fprintf(stderr, "<MOD> is a CAN FD frame modification instruction consisting of\n");
fprintf(stderr, "<instruction>:<canfd_frame-elements>:<can_id>.<flags>.<len>.<can_data>\n"); fprintf(stderr, "<instruction>:<canfd_frame-elements>:<can_id>.<flags>.<len>.<can_data>\n");
fprintf(stderr, " - <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\n"); fprintf(stderr, " <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\n");
fprintf(stderr, " - <canfd_frame-elements> is _one_ or _more_ of 'I'd 'F'lags 'L'ength 'D'ata\n"); fprintf(stderr, " <canfd_frame-elements> is _one_ or _more_ of 'I'd 'F'lags 'L'ength 'D'ata\n");
fprintf(stderr, " - <can_id> is an u32 value containing the CAN FD Identifier\n"); fprintf(stderr, " <can_id> is an u32 value containing the CAN FD Identifier\n");
fprintf(stderr, " - <flags> is an u8 value containing CAN FD flags (CANFD_BRS, CANFD_ESI)\n"); fprintf(stderr, " <flags> is an u8 value containing CAN FD flags (CANFD_BRS, CANFD_ESI)\n");
fprintf(stderr, " - <len> is an u8 value containing the data length (0 .. 64)\n"); fprintf(stderr, " <len> is an u8 value containing the data length (0 .. 64)\n");
fprintf(stderr, " - <can_data> is always 64(!) u8 values containing the CAN FD frames data\n"); fprintf(stderr, " <can_data> is always 64(!) u8 values containing the CAN FD frames data\n");
fprintf(stderr, "The max. four modifications are performed in the order AND -> OR -> XOR -> SET\n"); fprintf(stderr, "The max. four modifications are performed in the order AND -> OR -> XOR -> SET\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "Example:\n");
fprintf(stderr, "%s -A -s can0 -d vcan3 -e -f 123:C00007FF -m SET:IL:333.4.1122334455667788\n", prg);
fprintf(stderr, "\n");
fprintf(stderr, "Supported CRC 8 profiles:\n"); fprintf(stderr, "Supported CRC 8 profiles:\n");
fprintf(stderr, "Profile '%d' (1U8) - add one additional u8 value\n", CGW_CRC8PRF_1U8); fprintf(stderr, " Profile '%d' (1U8) - add one additional u8 value\n", CGW_CRC8PRF_1U8);
fprintf(stderr, "Profile '%d' (16U8) - add u8 value from table[16] indexed by (data[1] & 0xF)\n", CGW_CRC8PRF_16U8); fprintf(stderr, " Profile '%d' (16U8) - add u8 value from table[16] indexed by (data[1] & 0xF)\n", CGW_CRC8PRF_16U8);
fprintf(stderr, "Profile '%d' (SFFID_XOR) - add u8 value (can_id & 0xFF) ^ (can_id >> 8 & 0xFF)\n", CGW_CRC8PRF_SFFID_XOR); fprintf(stderr, " Profile '%d' (SFFID_XOR) - add u8 value (can_id & 0xFF) ^ (can_id >> 8 & 0xFF)\n", CGW_CRC8PRF_SFFID_XOR);
fprintf(stderr, "\n");
fprintf(stderr, "Examples:\n");
fprintf(stderr, "%s -A -s can0 -d vcan3 -e -f 123:C00007FF -m SET:IL:333.4.1122334455667788\n", prg);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }

View File

@ -89,7 +89,8 @@ void print_usage(char *prg)
{ {
fprintf(stderr, "\nUsage: %s [options] <CAN interface>+\n", prg); fprintf(stderr, "\nUsage: %s [options] <CAN interface>+\n", prg);
fprintf(stderr, " (use CTRL-C to terminate %s)\n\n", prg); fprintf(stderr, " (use CTRL-C to terminate %s)\n\n", prg);
fprintf(stderr, "Options: -m <mask> (ID filter mask. Default 0x00000000) *\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -m <mask> (ID filter mask. Default 0x00000000) *\n");
fprintf(stderr, " -v <value> (ID filter value. Default 0x00000000) *\n"); fprintf(stderr, " -v <value> (ID filter value. Default 0x00000000) *\n");
fprintf(stderr, " -i <0|1> (invert the specified ID filter) *\n"); fprintf(stderr, " -i <0|1> (invert the specified ID filter) *\n");
fprintf(stderr, " -e <emask> (mask for error frames)\n"); fprintf(stderr, " -e <emask> (mask for error frames)\n");

View File

@ -77,8 +77,10 @@ extern int optind, opterr, optopt;
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "%s - replay a compact CAN frame logfile to CAN devices.\n", prg);
fprintf(stderr, "\nUsage: %s <options> [interface assignment]*\n\n", prg); fprintf(stderr, "\nUsage: %s <options> [interface assignment]*\n\n", prg);
fprintf(stderr, "Options: -I <infile> (default stdin)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -I <infile> (default stdin)\n");
fprintf(stderr, " -l <num> " fprintf(stderr, " -l <num> "
"(process input file <num> times)\n" "(process input file <num> times)\n"
" " " "
@ -93,13 +95,13 @@ void print_usage(char *prg)
"loopback of sent CAN frames)\n"); "loopback of sent CAN frames)\n");
fprintf(stderr, " -v (verbose: print " fprintf(stderr, " -v (verbose: print "
"sent CAN frames)\n\n"); "sent CAN frames)\n\n");
fprintf(stderr, "Interface assignment: 0..n assignments like " fprintf(stderr, "Interface assignment:\n");
"<write-if>=<log-if>\n"); fprintf(stderr, " 0..n assignments like <write-if>=<log-if>\n\n");
fprintf(stderr, "e.g. vcan2=can0 ( send frames received from can0 on " fprintf(stderr, " e.g. vcan2=can0 (send frames received from can0 on "
"vcan2 )\n"); "vcan2)\n");
fprintf(stderr, "extra hook: stdout=can0 ( print logfile line marked with can0 on " fprintf(stderr, " extra hook: stdout=can0 (print logfile line marked with can0 on "
"stdout )\n"); "stdout)\n");
fprintf(stderr, "No assignments => send frames to the interface(s) they " fprintf(stderr, " No assignments => send frames to the interface(s) they "
"had been received from.\n\n"); "had been received from.\n\n");
fprintf(stderr, "Lines in the logfile not beginning with '(' (start of " fprintf(stderr, "Lines in the logfile not beginning with '(' (start of "
"timestamp) are ignored.\n\n"); "timestamp) are ignored.\n\n");

View File

@ -56,6 +56,29 @@
#include "lib.h" #include "lib.h"
void print_usage(char *prg)
{
fprintf(stderr, "Usage: %s - simple command line tool to send CAN-frames via CAN_RAW sockets.\n", prg);
fprintf(stderr, "Usage: %s <device> <can_frame>.\n", prg);
fprintf(stderr, "<can_frame>:\n");
fprintf(stderr, " <can_id>#{data} for 'classic' CAN 2.0 data frames\n");
fprintf(stderr, " <can_id>#R{len} for 'classic' CAN 2.0 data frames\n");
fprintf(stderr, " <can_id>##<flags>{data} for CAN FD frames\n\n");
fprintf(stderr, "<can_id>:\n"
" 3 (SFF) or 8 (EFF) hex chars\n");
fprintf(stderr, "{data}:\n"
" 0..8 (0..64 CAN FD) ASCII hex-values (optionally separated by '.')\n");
fprintf(stderr, "{len}:\n"
" an optional 0..8 value as RTR frames can contain a valid dlc field\n");
fprintf(stderr, "<flags>:\n"
" a single ASCII Hex value (0 .. F) which defines canfd_frame.flags\n\n");
fprintf(stderr, "Examples:\n");
fprintf(stderr, " 5A1#11.2233.44556677.88 / 123#DEADBEEF / 5AA# / 123##1 / 213##311223344 /\n"
" 1F334455#1122334455667788 / 123#R / 00000123#R3\n\n");
}
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int s; /* can raw socket */ int s; /* can raw socket */
@ -68,27 +91,15 @@ int main(int argc, char **argv)
/* check command line options */ /* check command line options */
if (argc != 3) { if (argc != 3) {
fprintf(stderr, "Usage: %s <device> <can_frame>.\n", argv[0]); print_usage(argv[0]);
return 1; return 1;
} }
/* parse CAN frame */ /* parse CAN frame */
required_mtu = parse_canframe(argv[2], &frame); required_mtu = parse_canframe(argv[2], &frame);
if (!required_mtu){ if (!required_mtu){
fprintf(stderr, "\nWrong CAN-frame format! Try:\n\n"); fprintf(stderr, "\nWrong CAN-frame format!\n\n");
fprintf(stderr, " <can_id>#{data} for 'classic' CAN 2.0 data frames\n"); print_usage(argv[0]);
fprintf(stderr, " <can_id>#R{len} for 'classic' CAN 2.0 RTR frames\n");
fprintf(stderr, " <can_id>##<flags>{data} for CAN FD frames\n\n");
fprintf(stderr, "<can_id> can have 3 (SFF) or 8 (EFF) hex chars\n");
fprintf(stderr, "{data} has 0..8 (0..64 CAN FD) ASCII hex-values (optionally");
fprintf(stderr, " separated by '.')\n");
fprintf(stderr, "{len} is an optional 0..8 value as RTR frames can contain a");
fprintf(stderr, " valid dlc field\n");
fprintf(stderr, "<flags> a single ASCII Hex value (0 .. F) which defines");
fprintf(stderr, " canfd_frame.flags\n\n");
fprintf(stderr, "e.g. 5A1#11.2233.44556677.88 / 123#DEADBEEF / 5AA# / ");
fprintf(stderr, "123##1 / 213##311223344\n 1F334455#1122334455667788 / ");
fprintf(stderr, "123#R / 00000123#R3\n\n");
return 1; return 1;
} }

View File

@ -134,26 +134,25 @@ void print_usage(char *prg)
{ {
const char manual [] = { const char manual [] = {
"commands that can be entered at runtime:\n" "commands that can be entered at runtime:\n"
"\n" " q<ENTER> - quit\n"
"q<ENTER> - quit\n" " b<ENTER> - toggle binary / HEX-ASCII output\n"
"b<ENTER> - toggle binary / HEX-ASCII output\n" " B<ENTER> - toggle binary with gap / HEX-ASCII output (exceeds 80 chars!)\n"
"B<ENTER> - toggle binary with gap / HEX-ASCII output (exceeds 80 chars!)\n" " c<ENTER> - toggle color mode\n"
"c<ENTER> - toggle color mode\n" " #<ENTER> - notch currently marked/changed bits (can be used repeatedly)\n"
"#<ENTER> - notch currently marked/changed bits (can be used repeatedly)\n" " *<ENTER> - clear notched marked\n"
"*<ENTER> - clear notched marked\n" " rMYNAME<ENTER> - read settings file (filter/notch)\n"
"rMYNAME<ENTER> - read settings file (filter/notch)\n" " wMYNAME<ENTER> - write settings file (filter/notch)\n"
"wMYNAME<ENTER> - write settings file (filter/notch)\n" " +FILTER<ENTER> - add CAN-IDs to sniff\n"
"+FILTER<ENTER> - add CAN-IDs to sniff\n" " -FILTER<ENTER> - remove CAN-IDs to sniff\n"
"-FILTER<ENTER> - remove CAN-IDs to sniff\n"
"\n" "\n"
"FILTER can be a single CAN-ID or a CAN-ID/Bitmask:\n" "FILTER can be a single CAN-ID or a CAN-ID/Bitmask:\n"
"+1F5<ENTER> - add CAN-ID 0x1F5\n" " +1F5<ENTER> - add CAN-ID 0x1F5\n"
"-42E<ENTER> - remove CAN-ID 0x42E\n" " -42E<ENTER> - remove CAN-ID 0x42E\n"
"-42E7FF<ENTER> - remove CAN-ID 0x42E (using Bitmask)\n" " -42E7FF<ENTER> - remove CAN-ID 0x42E (using Bitmask)\n"
"-500700<ENTER> - remove CAN-IDs 0x500 - 0x5FF\n" " -500700<ENTER> - remove CAN-IDs 0x500 - 0x5FF\n"
"+400600<ENTER> - add CAN-IDs 0x400 - 0x5FF\n" " +400600<ENTER> - add CAN-IDs 0x400 - 0x5FF\n"
"+000000<ENTER> - add all CAN-IDs\n" " +000000<ENTER> - add all CAN-IDs\n"
"-000000<ENTER> - remove all CAN-IDs\n" " -000000<ENTER> - remove all CAN-IDs\n"
"\n" "\n"
"if (id & filter) == (sniff-id & filter) the action (+/-) is performed,\n" "if (id & filter) == (sniff-id & filter) the action (+/-) is performed,\n"
"which is quite easy when the filter is 000\n" "which is quite easy when the filter is 000\n"
@ -161,18 +160,19 @@ void print_usage(char *prg)
}; };
fprintf(stderr, "\nUsage: %s [can-interface]\n", prg); fprintf(stderr, "\nUsage: %s [can-interface]\n", prg);
fprintf(stderr, "Options: -m <mask> (initial FILTER default 0x00000000)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -v <value> (initial FILTER default 0x00000000)\n"); fprintf(stderr, " -m <mask> (initial FILTER default 0x00000000)\n");
fprintf(stderr, " -q (quiet - all IDs deactivated)\n"); fprintf(stderr, " -v <value> (initial FILTER default 0x00000000)\n");
fprintf(stderr, " -r <name> (read %sname from file)\n", SETFNAME); fprintf(stderr, " -q (quiet - all IDs deactivated)\n");
fprintf(stderr, " -b (start with binary mode)\n"); fprintf(stderr, " -r <name> (read %sname from file)\n", SETFNAME);
fprintf(stderr, " -B (start with binary mode with gap - exceeds 80 chars!)\n"); fprintf(stderr, " -b (start with binary mode)\n");
fprintf(stderr, " -c (color changes)\n"); fprintf(stderr, " -B (start with binary mode with gap - exceeds 80 chars!)\n");
fprintf(stderr, " -f (filter on CAN-ID only)\n"); fprintf(stderr, " -c (color changes)\n");
fprintf(stderr, " -t <time> (timeout for ID display [x10ms] default: %d, 0 = OFF)\n", TIMEOUT); fprintf(stderr, " -f (filter on CAN-ID only)\n");
fprintf(stderr, " -h <time> (hold marker on changes [x10ms] default: %d)\n", HOLD); fprintf(stderr, " -t <time> (timeout for ID display [x10ms] default: %d, 0 = OFF)\n", TIMEOUT);
fprintf(stderr, " -l <time> (loop time (display) [x10ms] default: %d)\n", LOOP); fprintf(stderr, " -h <time> (hold marker on changes [x10ms] default: %d)\n", HOLD);
fprintf(stderr, "Use interface name '%s' to receive from all can-interfaces\n", ANYDEV); fprintf(stderr, " -l <time> (loop time (display) [x10ms] default: %d)\n", LOOP);
fprintf(stderr, "Use interface name '%s' to receive from all can-interfaces.\n", ANYDEV);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "%s", manual); fprintf(stderr, "%s", manual);
} }

View File

@ -68,20 +68,22 @@ const int canfd_on = 1;
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n", prg); fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n", prg);
fprintf(stderr, "Options: -s <can_id> (source can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, " -s <can_id> (source can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -x <addr> (extended addressing mode. Use 'any' for all addresses)\n"); fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -X <addr> (extended addressing mode (rx addr). Use 'any' for all)\n"); fprintf(stderr, " -x <addr> (extended addressing mode. Use 'any' for all addresses)\n");
fprintf(stderr, " -c (color mode)\n"); fprintf(stderr, " -X <addr> (extended addressing mode (rx addr). Use 'any' for all)\n");
fprintf(stderr, " -a (print data also in ASCII-chars)\n"); fprintf(stderr, " -c (color mode)\n");
fprintf(stderr, " -t <type> (timestamp: (a)bsolute/(d)elta/(z)ero/(A)bsolute w date)\n"); fprintf(stderr, " -a (print data also in ASCII-chars)\n");
fprintf(stderr, " -u (print uds messages)\n"); fprintf(stderr, " -t <type> (timestamp: (a)bsolute/(d)elta/(z)ero/(A)bsolute w date)\n");
fprintf(stderr, " -u (print uds messages)\n");
fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n"); fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n");
fprintf(stderr, "\nUDS output contains a flag which provides information about the type of the message.\n"); fprintf(stderr, "\nUDS output contains a flag which provides information about the type of the message.\n\n");
fprintf(stderr, "Flags: [SRQ] = Service Request\n"); fprintf(stderr, "Flags:\n");
fprintf(stderr, " [PSR] = Positive Service Response\n"); fprintf(stderr, " [SRQ] = Service Request\n");
fprintf(stderr, " [NRC] = Negative Response Code\n"); fprintf(stderr, " [PSR] = Positive Service Response\n");
fprintf(stderr, " [???] = Unknown (not specified)\n"); fprintf(stderr, " [NRC] = Negative Response Code\n");
fprintf(stderr, " [???] = Unknown (not specified)\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }

View File

@ -65,11 +65,13 @@
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "%s - ISO15765-2 protocol performance visualisation.\n", prg);
fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n", prg); fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n", prg);
fprintf(stderr, "Options: -s <can_id> (source can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, " -s <can_id> (source can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -x <addr> (extended addressing mode)\n"); fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -X <addr> (extended addressing mode (rx addr))\n"); fprintf(stderr, " -x <addr> (extended addressing mode)\n");
fprintf(stderr, " -X <addr> (extended addressing mode (rx addr))\n");
fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n"); fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }

View File

@ -62,17 +62,18 @@
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n", prg); fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n", prg);
fprintf(stderr, "Options: -s <can_id> (source can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, " -s <can_id> (source can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -x <addr>[:<rxaddr>] (extended addressing / opt. separate rxaddr)\n"); fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -p [tx]:[rx] (set and enable tx/rx padding bytes)\n"); fprintf(stderr, " -x <addr>[:<rxaddr>] (extended addressing / opt. separate rxaddr)\n");
fprintf(stderr, " -P <mode> (check rx padding for (l)ength (c)ontent (a)ll)\n"); fprintf(stderr, " -p [tx]:[rx] (set and enable tx/rx padding bytes)\n");
fprintf(stderr, " -b <bs> (blocksize. 0 = off)\n"); fprintf(stderr, " -P <mode> (check rx padding for (l)ength (c)ontent (a)ll)\n");
fprintf(stderr, " -m <val> (STmin in ms/ns. See spec.)\n"); fprintf(stderr, " -b <bs> (blocksize. 0 = off)\n");
fprintf(stderr, " -f <time ns> (force rx stmin value in nanosecs)\n"); fprintf(stderr, " -m <val> (STmin in ms/ns. See spec.)\n");
fprintf(stderr, " -w <num> (max. wait frame transmissions.)\n"); fprintf(stderr, " -f <time ns> (force rx stmin value in nanosecs)\n");
fprintf(stderr, " -l (loop: do not exit after pdu reception.)\n"); fprintf(stderr, " -w <num> (max. wait frame transmissions.)\n");
fprintf(stderr, " -L <mtu>:<tx_dl>:<tx_flags> (link layer options for CAN FD)\n"); fprintf(stderr, " -l (loop: do not exit after pdu reception.)\n");
fprintf(stderr, " -L <mtu>:<tx_dl>:<tx_flags> (link layer options for CAN FD)\n");
fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n"); fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n");
fprintf(stderr, "The pdu data is written on STDOUT in space separated ASCII hex values.\n"); fprintf(stderr, "The pdu data is written on STDOUT in space separated ASCII hex values.\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");

View File

@ -62,15 +62,16 @@
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n", prg); fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n", prg);
fprintf(stderr, "Options: -s <can_id> (source can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -s <can_id> (source can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -x <addr>[:<rxaddr>] (extended addressing / opt. separate rxaddr)\n"); fprintf(stderr, " -x <addr>[:<rxaddr>] (extended addressing / opt. separate rxaddr)\n");
fprintf(stderr, " -p [tx]:[rx] (set and enable tx/rx padding bytes)\n"); fprintf(stderr, " -p [tx]:[rx] (set and enable tx/rx padding bytes)\n");
fprintf(stderr, " -P <mode> (check rx padding for (l)ength (c)ontent (a)ll)\n"); fprintf(stderr, " -P <mode> (check rx padding for (l)ength (c)ontent (a)ll)\n");
fprintf(stderr, " -t <time ns> (frame transmit time (N_As) in nanosecs)\n"); fprintf(stderr, " -t <time ns> (frame transmit time (N_As) in nanosecs)\n");
fprintf(stderr, " -f <time ns> (ignore FC and force local tx stmin value in nanosecs)\n"); fprintf(stderr, " -f <time ns> (ignore FC and force local tx stmin value in nanosecs)\n");
fprintf(stderr, " -D <len> (send a fixed PDU with len bytes - no STDIN data)\n"); fprintf(stderr, " -D <len> (send a fixed PDU with len bytes - no STDIN data)\n");
fprintf(stderr, " -L <mtu>:<tx_dl>:<tx_flags> (link layer options for CAN FD)\n"); fprintf(stderr, " -L <mtu>:<tx_dl>:<tx_flags> (link layer options for CAN FD)\n");
fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n"); fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n");
fprintf(stderr, "The pdu data is expected on STDIN in space separated ASCII hex values.\n"); fprintf(stderr, "The pdu data is expected on STDIN in space separated ASCII hex values.\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");

View File

@ -100,28 +100,29 @@ void childdied(int i)
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "\nUsage: %s -l <port> -s <can_id> -d <can_id> [options] <CAN interface>\n", prg); fprintf(stderr, "\nUsage: %s -l <port> -s <can_id> -d <can_id> [options] <CAN interface>\n", prg);
fprintf(stderr, "Options: (* = mandatory)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, "\n");
fprintf(stderr, "ip addressing:\n"); fprintf(stderr, "ip addressing:\n");
fprintf(stderr, " * -l <port> (local port for the server)\n"); fprintf(stderr, " -l <port> * (local port for the server)\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "isotp addressing:\n"); fprintf(stderr, "isotp addressing:\n");
fprintf(stderr, " * -s <can_id> (source can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, " -s <can_id> * (source can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " * -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, " -d <can_id> * (destination can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -x <addr>[:<rxaddr>] (extended addressing / opt. separate rxaddr)\n"); fprintf(stderr, " -x <addr>[:<rxaddr>] (extended addressing / opt. separate rxaddr)\n");
fprintf(stderr, " -L <mtu>:<tx_dl>:<tx_flags> (link layer options for CAN FD)\n"); fprintf(stderr, " -L <mtu>:<tx_dl>:<tx_flags> (link layer options for CAN FD)\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "padding:\n"); fprintf(stderr, "padding:\n");
fprintf(stderr, " -p [tx]:[rx] (set and enable tx/rx padding bytes)\n"); fprintf(stderr, " -p [tx]:[rx] (set and enable tx/rx padding bytes)\n");
fprintf(stderr, " -P <mode> (check rx padding for (l)ength (c)ontent (a)ll)\n"); fprintf(stderr, " -P <mode> (check rx padding for (l)ength (c)ontent (a)ll)\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "rx path: (config, which is sent to the sender / data source)\n"); fprintf(stderr, "rx path:\n (config, which is sent to the sender / data source)\n");
fprintf(stderr, " -b <bs> (blocksize. 0 = off)\n"); fprintf(stderr, " -b <bs> (blocksize. 0 = off)\n");
fprintf(stderr, " -m <val> (STmin in ms/ns. See spec.)\n"); fprintf(stderr, " -m <val> (STmin in ms/ns. See spec.)\n");
fprintf(stderr, " -w <num> (max. wait frame transmissions)\n"); fprintf(stderr, " -w <num> (max. wait frame transmissions)\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "tx path: (config, which changes local tx settings)\n"); fprintf(stderr, "tx path:\n (config, which changes local tx settings)\n");
fprintf(stderr, " -t <time ns> (transmit time in nanosecs)\n"); fprintf(stderr, " -t <time ns> (transmit time in nanosecs)\n");
fprintf(stderr, "\n");
fprintf(stderr, "(* = mandatory option)\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "All values except for '-l' and '-t' are expected in hexadecimal values.\n"); fprintf(stderr, "All values except for '-l' and '-t' are expected in hexadecimal values.\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");

View File

@ -69,14 +69,15 @@
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n", prg); fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n", prg);
fprintf(stderr, "Options: -s <can_id> (source can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, " -s <can_id> (source can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -x <addr> (extended addressing mode)\n"); fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -X <addr> (extended addressing mode - rx addr)\n"); fprintf(stderr, " -x <addr> (extended addressing mode)\n");
fprintf(stderr, " -c (color mode)\n"); fprintf(stderr, " -X <addr> (extended addressing mode - rx addr)\n");
fprintf(stderr, " -t <type> (timestamp: (a)bsolute/(d)elta/(z)ero/(A)bsolute w date)\n"); fprintf(stderr, " -c (color mode)\n");
fprintf(stderr, " -f <format> (1 = HEX, 2 = ASCII, 3 = HEX & ASCII - default: %d)\n", FORMAT_DEFAULT); fprintf(stderr, " -t <type> (timestamp: (a)bsolute/(d)elta/(z)ero/(A)bsolute w date)\n");
fprintf(stderr, " -L <mtu>:<tx_dl>:<tx_flags> (link layer options for CAN FD)\n"); fprintf(stderr, " -f <format> (1 = HEX, 2 = ASCII, 3 = HEX & ASCII - default: %d)\n", FORMAT_DEFAULT);
fprintf(stderr, " -L <mtu>:<tx_dl>:<tx_flags> (link layer options for CAN FD)\n");
fprintf(stderr, " -h <len> (head: print only first <len> bytes)\n"); fprintf(stderr, " -h <len> (head: print only first <len> bytes)\n");
fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n"); fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n");
fprintf(stderr, "\n"); fprintf(stderr, "\n");

View File

@ -102,23 +102,25 @@ void perror_syslog(const char *s)
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "%s - IP over CAN ISO-TP (ISO15765-2) tunnel / proof-of-concept.\n", prg);
fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n\n", prg); fprintf(stderr, "\nUsage: %s [options] <CAN interface>\n\n", prg);
fprintf(stderr, "This program creates a Linux tunnel netdevice 'ctunX' and transfers the\n"); fprintf(stderr, "This program creates a Linux tunnel netdevice 'ctunX' and transfers the\n");
fprintf(stderr, "ethernet frames inside ISO15765-2 (unreliable) datagrams on CAN.\n\n"); fprintf(stderr, "ethernet frames inside ISO15765-2 (unreliable) datagrams on CAN.\n\n");
fprintf(stderr, "Options: -s <can_id> (source can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n"); fprintf(stderr, " -s <can_id> (source can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -n <name> (name of created IP netdevice. Default: '%s')\n", DEFAULT_NAME); fprintf(stderr, " -d <can_id> (destination can_id. Use 8 digits for extended IDs)\n");
fprintf(stderr, " -x <addr>[:<rxaddr>] (extended addressing / opt. separate rxaddr)\n"); fprintf(stderr, " -n <name> (name of created IP netdevice. Default: '%s')\n", DEFAULT_NAME);
fprintf(stderr, " -L <mtu>:<tx_dl>:<tx_flags> (link layer options for CAN FD)\n"); fprintf(stderr, " -x <addr>[:<rxaddr>] (extended addressing / opt. separate rxaddr)\n");
fprintf(stderr, " -p [tx]:[rx] (set and enable tx/rx padding bytes)\n"); fprintf(stderr, " -L <mtu>:<tx_dl>:<tx_flags> (link layer options for CAN FD)\n");
fprintf(stderr, " -P <mode> (check rx padding for (l)ength (c)ontent (a)ll)\n"); fprintf(stderr, " -p [tx]:[rx] (set and enable tx/rx padding bytes)\n");
fprintf(stderr, " -t <time ns> (transmit time in nanosecs)\n"); fprintf(stderr, " -P <mode> (check rx padding for (l)ength (c)ontent (a)ll)\n");
fprintf(stderr, " -b <bs> (blocksize. 0 = off)\n"); fprintf(stderr, " -t <time ns> (transmit time in nanosecs)\n");
fprintf(stderr, " -m <val> (STmin in ms/ns. See spec.)\n"); fprintf(stderr, " -b <bs> (blocksize. 0 = off)\n");
fprintf(stderr, " -w <num> (max. wait frame transmissions.)\n"); fprintf(stderr, " -m <val> (STmin in ms/ns. See spec.)\n");
fprintf(stderr, " -D (daemonize to background when tun device created)\n"); fprintf(stderr, " -w <num> (max. wait frame transmissions.)\n");
fprintf(stderr, " -h (half duplex mode.)\n"); fprintf(stderr, " -D (daemonize to background when tun device created)\n");
fprintf(stderr, " -v (verbose mode. Print symbols for tunneled msgs.)\n"); fprintf(stderr, " -h (half duplex mode.)\n");
fprintf(stderr, " -v (verbose mode. Print symbols for tunneled msgs.)\n");
fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n"); fprintf(stderr, "\nCAN IDs and addresses are given and expected in hexadecimal values.\n");
fprintf(stderr, "Use e.g. 'ifconfig ctun0 123.123.123.1 pointopoint 123.123.123.2 up'\n"); fprintf(stderr, "Use e.g. 'ifconfig ctun0 123.123.123.1 pointopoint 123.123.123.2 up'\n");
fprintf(stderr, "to create a point-to-point IP connection on CAN.\n"); fprintf(stderr, "to create a point-to-point IP connection on CAN.\n");

View File

@ -30,9 +30,9 @@
#include "libj1939.h" #include "libj1939.h"
static const char help_msg[] = static const char help_msg[] =
"j1939acd: An SAE J1939 address claiming daemon" "\n" "jacd: An SAE J1939 address claiming daemon" "\n"
"Usage: j1939acd [options] NAME [INTF]" "\n" "Usage: j1939acd [options] NAME [INTF]" "\n"
"\n" "Options:\n"
" -v, --verbose Increase verbosity" "\n" " -v, --verbose Increase verbosity" "\n"
" -r, --range=RANGE Ranges of source addresses" "\n" " -r, --range=RANGE Ranges of source addresses" "\n"
" e.g. 80,50-100,200-210 (defaults to 0-253)" "\n" " e.g. 80,50-100,200-210 (defaults to 0-253)" "\n"
@ -44,6 +44,8 @@ static const char help_msg[] =
"\n" "\n"
"Example:" "\n" "Example:" "\n"
"j1939acd -r 100,80-120 -c /tmp/1122334455667788.jacd 1122334455667788" "\n" "j1939acd -r 100,80-120 -c /tmp/1122334455667788.jacd 1122334455667788" "\n"
"Examples:" "\n"
"j1939acd -r 100,80-120 -c /tmp/1122334455667788.jacd 1122334455667788" "\n"
; ;
#ifdef _GNU_SOURCE #ifdef _GNU_SOURCE

View File

@ -67,8 +67,8 @@ struct j1939cat_priv {
}; };
static const char help_msg[] = static const char help_msg[] =
"j1939cat: netcat tool for j1939\n" "j1939cat: netcat-like tool for j1939\n"
"Usage: j1939cat FROM TO\n" "Usage: j1939cat [options] FROM TO\n"
" FROM / TO - or [IFACE][:[SA][,[PGN][,NAME]]]\n" " FROM / TO - or [IFACE][:[SA][,[PGN][,NAME]]]\n"
"Options:\n" "Options:\n"
" -i <infile> (default stdin)\n" " -i <infile> (default stdin)\n"
@ -84,7 +84,7 @@ static const char help_msg[] =
"\n" "\n"
; ;
static const char optstring[] = "?i:vs:rp:P:R:"; static const char optstring[] = "?hi:vs:rp:P:R:";
static void j1939cat_init_sockaddr_can(struct sockaddr_can *sac) static void j1939cat_init_sockaddr_can(struct sockaddr_can *sac)
@ -617,6 +617,7 @@ static int j1939cat_parse_args(struct j1939cat_priv *priv, int argc, char *argv[
if (priv->repeat < 1) if (priv->repeat < 1)
err(EXIT_FAILURE, "send/repeat count can't be less then 1\n"); err(EXIT_FAILURE, "send/repeat count can't be less then 1\n");
break; break;
case 'h': /*fallthrough*/
default: default:
fputs(help_msg, stderr); fputs(help_msg, stderr);
return EXIT_FAILURE; return EXIT_FAILURE;

View File

@ -32,7 +32,7 @@
static const char help_msg[] = static const char help_msg[] =
"j1939spy: An SAE J1939 spy utility" "\n" "j1939spy: An SAE J1939 spy utility" "\n"
"Usage: j1939spy [OPTION...] [[IFACE:][NAME|SA][,PGN]]" "\n" "Usage: j1939spy [OPTION...] [[IFACE:][NAME|SA][,PGN]]" "\n"
"\n" "Options:\n"
" -v, --verbose Increase verbosity" "\n" " -v, --verbose Increase verbosity" "\n"
" -P, --promisc Run in promiscuous mode" "\n" " -P, --promisc Run in promiscuous mode" "\n"
" (= receive traffic not for this ECU)" "\n" " (= receive traffic not for this ECU)" "\n"

View File

@ -33,7 +33,7 @@
static const char help_msg[] = static const char help_msg[] =
"j1939sr: An SAE J1939 send/recv utility" "\n" "j1939sr: An SAE J1939 send/recv utility" "\n"
"Usage: j1939sr [OPTION...] SOURCE [DEST]" "\n" "Usage: j1939sr [OPTION...] SOURCE [DEST]" "\n"
"\n" "Options:\n"
" -v, --verbose Increase verbosity" "\n" " -v, --verbose Increase verbosity" "\n"
" -p, --priority=VAL J1939 priority (0..7, default 6)" "\n" " -p, --priority=VAL J1939 priority (0..7, default 6)" "\n"
" -S, --serialize Strictly serialize outgoing packets" "\n" " -S, --serialize Strictly serialize outgoing packets" "\n"

View File

@ -60,11 +60,13 @@ extern int optind, opterr, optopt;
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "Usage: %s [can-interfaces]\n", prg); fprintf(stderr, "%s - convert compact CAN frame logfile to ASC logfile.\n", prg);
fprintf(stderr, "Options: -I <infile> (default stdin)\n"); fprintf(stderr, "Usage: %s <options> [can-interfaces]\n", prg);
fprintf(stderr, " -O <outfile> (default stdout)\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -4 (reduce decimal place to 4 digits)\n"); fprintf(stderr, " -I <infile> (default stdin)\n");
fprintf(stderr, " -n (set newline to cr/lf - default lf)\n"); fprintf(stderr, " -O <outfile> (default stdout)\n");
fprintf(stderr, " -4 (reduce decimal place to 4 digits)\n");
fprintf(stderr, " -n (set newline to cr/lf - default lf)\n");
} }
int main(int argc, char **argv) int main(int argc, char **argv)

View File

@ -57,22 +57,23 @@
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "%s - userspace tool for serial line CAN interface driver SLCAN.\n", prg);
fprintf(stderr, "\nUsage: %s [options] tty\n\n", prg); fprintf(stderr, "\nUsage: %s [options] tty\n\n", prg);
fprintf(stderr, "Options: -o (send open command 'O\\r')\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -l (send listen only command 'L\\r', overrides -o)\n"); fprintf(stderr, " -o (send open command 'O\\r')\n");
fprintf(stderr, " -c (send close command 'C\\r')\n"); fprintf(stderr, " -l (send listen only command 'L\\r', overrides -o)\n");
fprintf(stderr, " -f (read status flags with 'F\\r' to reset error states)\n"); fprintf(stderr, " -c (send close command 'C\\r')\n");
fprintf(stderr, " -s <speed> (set CAN speed 0..8)\n"); fprintf(stderr, " -f (read status flags with 'F\\r' to reset error states)\n");
fprintf(stderr, " -b <btr> (set bit time register value)\n"); fprintf(stderr, " -s <speed> (set CAN speed 0..8)\n");
fprintf(stderr, " -d (only detach line discipline)\n"); fprintf(stderr, " -b <btr> (set bit time register value)\n");
fprintf(stderr, " -w (attach - wait for keypess - detach)\n"); fprintf(stderr, " -d (only detach line discipline)\n");
fprintf(stderr, " -n <name> (assign created netdevice name)\n"); fprintf(stderr, " -w (attach - wait for keypess - detach)\n");
fprintf(stderr, " -n <name> (assign created netdevice name)\n");
fprintf(stderr, "\nExamples:\n"); fprintf(stderr, "\nExamples:\n");
fprintf(stderr, "slcan_attach -w -o -f -s6 -c /dev/ttyS1\n"); fprintf(stderr, "slcan_attach -w -o -f -s6 -c /dev/ttyS1\n\n");
fprintf(stderr, "slcan_attach /dev/ttyS1\n"); fprintf(stderr, "slcan_attach /dev/ttyS1\n\n");
fprintf(stderr, "slcan_attach -d /dev/ttyS1\n"); fprintf(stderr, "slcan_attach -d /dev/ttyS1\n\n");
fprintf(stderr, "slcan_attach -w -n can15 /dev/ttyS1\n"); fprintf(stderr, "slcan_attach -w -n can15 /dev/ttyS1\n\n");
fprintf(stderr, "\n");
exit(1); exit(1);
} }

View File

@ -72,22 +72,23 @@ static syslog_t syslogger = syslog;
void print_usage(char *prg) void print_usage(char *prg)
{ {
fprintf(stderr, "%s - userspace daemon for serial line CAN interface driver SLCAN.\n", prg);
fprintf(stderr, "\nUsage: %s [options] <tty> [canif-name]\n\n", prg); fprintf(stderr, "\nUsage: %s [options] <tty> [canif-name]\n\n", prg);
fprintf(stderr, "Options: -o (send open command 'O\\r')\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " -c (send close command 'C\\r')\n"); fprintf(stderr, " -o (send open command 'O\\r')\n");
fprintf(stderr, " -f (read status flags with 'F\\r' to reset error states)\n"); fprintf(stderr, " -c (send close command 'C\\r')\n");
fprintf(stderr, " -l (send listen only command 'L\\r', overrides -o)\n"); fprintf(stderr, " -f (read status flags with 'F\\r' to reset error states)\n");
fprintf(stderr, " -s <speed> (set CAN speed 0..8)\n"); fprintf(stderr, " -l (send listen only command 'L\\r', overrides -o)\n");
fprintf(stderr, " -S <speed> (set UART speed in baud)\n"); fprintf(stderr, " -s <speed> (set CAN speed 0..8)\n");
fprintf(stderr, " -t <type> (set UART flow control type 'hw' or 'sw')\n"); fprintf(stderr, " -S <speed> (set UART speed in baud)\n");
fprintf(stderr, " -b <btr> (set bit time register value)\n"); fprintf(stderr, " -t <type> (set UART flow control type 'hw' or 'sw')\n");
fprintf(stderr, " -F (stay in foreground; no daemonize)\n"); fprintf(stderr, " -b <btr> (set bit time register value)\n");
fprintf(stderr, " -h (show this help page)\n"); fprintf(stderr, " -F (stay in foreground; no daemonize)\n");
fprintf(stderr, " -h (show this help page)\n");
fprintf(stderr, "\nExamples:\n"); fprintf(stderr, "\nExamples:\n");
fprintf(stderr, "slcand -o -c -f -s6 ttyUSB0\n"); fprintf(stderr, "slcand -o -c -f -s6 ttyUSB0\n\n");
fprintf(stderr, "slcand -o -c -f -s6 ttyUSB0 can0\n"); fprintf(stderr, "slcand -o -c -f -s6 ttyUSB0 can0\n\n");
fprintf(stderr, "slcand -o -c -f -s6 /dev/ttyUSB0\n"); fprintf(stderr, "slcand -o -c -f -s6 /dev/ttyUSB0\n\n");
fprintf(stderr, "\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@ -430,14 +430,15 @@ int main(int argc, char **argv)
if (argc != 3) { if (argc != 3) {
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "%s creates a pty for applications using" fprintf(stderr, "%s creates a pty for applications using"
" the slcan ASCII protocol and\n", argv[0]); " the slcan ASCII protocol and\n", basename(argv[0]));
fprintf(stderr, "converts the ASCII data to a CAN network" fprintf(stderr, "converts the ASCII data to a CAN network"
" interface (and vice versa)\n\n"); " interface (and vice versa)\n\n");
fprintf(stderr, "Usage: %s <pty> <can interface>\n", argv[0]); fprintf(stderr, "Usage: %s <pty> <can interface>\n", basename(argv[0]));
fprintf(stderr, "e.g. '%s /dev/ptyc0 can0' creates" fprintf(stderr, "Examples:\n");
" /dev/ttyc0 for the slcan application\n", argv[0]); fprintf(stderr, "%s /dev/ptyc0 can0 - creates /dev/ttyc0 for the slcan application\n\n",
basename(argv[0]));
fprintf(stderr, "e.g. for pseudo-terminal '%s %s can0' creates" fprintf(stderr, "e.g. for pseudo-terminal '%s %s can0' creates"
" /dev/pts/N\n", argv[0], DEVICE_NAME_PTMX); " /dev/pts/N\n", basename(argv[0]), DEVICE_NAME_PTMX);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
return 1; return 1;
} }

View File

@ -29,7 +29,7 @@
static const char help_msg[] = static const char help_msg[] =
"testj1939: demonstrate j1939 use\n" "testj1939: demonstrate j1939 use\n"
"Usage: testj1939 FROM TO\n" "Usage: testj1939 [OPTIONS] FROM TO\n"
" FROM / TO - or [IFACE][:[SA][,[PGN][,NAME]]]\n" " FROM / TO - or [IFACE][:[SA][,[PGN][,NAME]]]\n"
"Options:\n" "Options:\n"
" -v Print relevant API calls\n" " -v Print relevant API calls\n"
@ -46,7 +46,7 @@ static const char help_msg[] =
" -n Emit 64bit NAMEs in output\n" " -n Emit 64bit NAMEs in output\n"
" -w[TIME] Return after TIME (default 1) seconds\n" " -w[TIME] Return after TIME (default 1) seconds\n"
"\n" "\n"
"Example:\n" "Examples:\n"
"testj1939 can1 20\n" "testj1939 can1 20\n"
"\n" "\n"
; ;