diff --git a/candump.c b/candump.c index 16382d1..4fcffef 100644 --- a/candump.c +++ b/candump.c @@ -116,9 +116,11 @@ static volatile int running = 1; void print_usage(char *prg) { + fprintf(stderr, "%s - dump CAN bus traffic.\n", prg); fprintf(stderr, "\nUsage: %s [options] +\n", prg); fprintf(stderr, " (use CTRL-C to terminate %s)\n\n", prg); - fprintf(stderr, "Options: -t (timestamp: (a)bsolute/(d)elta/(z)ero/(A)bsolute w date)\n"); + fprintf(stderr, "Options:\n"); + fprintf(stderr, " -t (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, " -c (increment color mode level)\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, "Up to %d CAN interfaces with optional filter sets can be specified\n", MAXSOCK); fprintf(stderr, "on the commandline in the form: [,filter]*\n"); - fprintf(stderr, "\nComma separated filters can be specified for each given CAN interface:\n"); - fprintf(stderr, " : (matches when & mask == can_id & mask)\n"); - fprintf(stderr, " ~ (matches when & mask != can_id & mask)\n"); - fprintf(stderr, " # (set error frame filter, see include/linux/can/error.h)\n"); - fprintf(stderr, " [j|J] (join the given CAN filters - logical AND semantic)\n"); + fprintf(stderr, "\nFilters:\n"); + fprintf(stderr, " Comma separated filters can be specified for each given CAN interface:\n"); + fprintf(stderr, ":\n\t(matches when & mask == can_id & mask)\n"); + fprintf(stderr, "~\n\t(matches when & mask != can_id & mask)\n"); + fprintf(stderr, "#\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, "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, "\nUse interface name '%s' to receive from all CAN interfaces.\n", ANYDEV); 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 -l any,0~0,#FFFFFFFF (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 vcan2,12345678:DFFFFFFF (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:C00007FF (matches CAN ID 123 - only SFF and non-RTR frames)\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\n\t(log only error frames but no(!) 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\n\t(match only for extended CAN ID 12345678)\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\n\t(matches CAN ID 123 - only SFF and non-RTR frames)\n", prg); fprintf(stderr, "\n"); }