Merge pull request #293 from marckleinebudde/misc-cleanups

Misc cleanups
pull/297/head
Marc Kleine-Budde 2021-05-06 15:59:52 +02:00 committed by GitHub
commit f8a2cf01fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 13 deletions

View File

@ -58,11 +58,11 @@ static void print_usage(char *prg)
"Usage: %s [options] <can-interface>\n" "Usage: %s [options] <can-interface>\n"
"\n" "\n"
"Options:\n" "Options:\n"
" -v (low verbosity)\n" " -f COUNT (number of frames in flight, default: %d)\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"
" -f COUNT (number of frames in flight, default: %d)\n" " -v (low verbosity)\n"
" -vv (high verbosity)\n"
"\n" "\n"
"With the option '-g' CAN messages are generated and checked\n" "With the option '-g' CAN messages are generated and checked\n"
"on <can-interface>, otherwise all messages received on the\n" "on <can-interface>, otherwise all messages received on the\n"
@ -376,19 +376,20 @@ int main(int argc, char *argv[])
while ((opt = getopt(argc, argv, "f:gl:v?")) != -1) { while ((opt = getopt(argc, argv, "f:gl:v?")) != -1) {
switch (opt) { switch (opt) {
case 'v':
verbose++;
break;
case 'f': case 'f':
inflight_count = atoi(optarg); inflight_count = atoi(optarg);
break; break;
case 'g':
echo_gen = 1;
break;
case 'l': case 'l':
test_loops = atoi(optarg); test_loops = atoi(optarg);
break; break;
case 'g': case 'v':
echo_gen = 1; verbose++;
break; break;
case '?': case '?':

View File

@ -69,6 +69,18 @@ void print_usage(char *prg)
fprintf(stderr, " -d (only detach line discipline)\n"); fprintf(stderr, " -d (only detach line discipline)\n");
fprintf(stderr, " -w (attach - wait for keypess - detach)\n"); fprintf(stderr, " -w (attach - wait for keypess - detach)\n");
fprintf(stderr, " -n <name> (assign created netdevice name)\n"); fprintf(stderr, " -n <name> (assign created netdevice name)\n");
fprintf(stderr, "\n"
" <speed> Bitrate\n"
" 0 10 Kbit/s\n"
" 1 20 Kbit/s\n"
" 2 50 Kbit/s\n"
" 3 100 Kbit/s\n"
" 4 125 Kbit/s\n"
" 5 250 Kbit/s\n"
" 6 500 Kbit/s\n"
" 7 800 Kbit/s\n"
" 8 1000 Kbit/s\n"
"\n");
fprintf(stderr, "\nExamples:\n"); fprintf(stderr, "\nExamples:\n");
fprintf(stderr, "slcan_attach -w -o -f -s6 -c /dev/ttyS1\n\n"); fprintf(stderr, "slcan_attach -w -o -f -s6 -c /dev/ttyS1\n\n");
fprintf(stderr, "slcan_attach /dev/ttyS1\n\n"); fprintf(stderr, "slcan_attach /dev/ttyS1\n\n");