X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Fao-dumplog%2Fao-dumplog.c;h=6d4fa5bfb0cd56a13b02f48265adcd7801288602;hp=440a02b5925d8b473f633a8a08cfd1638c66a159;hb=803bf106caf5d6b5ac12eb00a941647c7325edd1;hpb=d6ba07e885bdc62ba64719c9d8cc42fcecbcb09d diff --git a/ao-tools/ao-dumplog/ao-dumplog.c b/ao-tools/ao-dumplog/ao-dumplog.c index 440a02b5..6d4fa5bf 100644 --- a/ao-tools/ao-dumplog/ao-dumplog.c +++ b/ao-tools/ao-dumplog/ao-dumplog.c @@ -29,13 +29,14 @@ static const struct option options[] = { { .name = "tty", .has_arg = 1, .val = 'T' }, { .name = "device", .has_arg = 1, .val = 'D' }, - { .name = "remote", .has_arg = 1, .val = 'R' }, + { .name = "remote", .has_arg = 0, .val = 'R' }, + { .name = "channel", .has_arg = 1, .val = 'C' }, { 0, 0, 0, 0}, }; static void usage(char *program) { - fprintf(stderr, "usage: %s [--tty ] [--device ] [-R]\n", program); + fprintf(stderr, "usage: %s [--tty ] [--device ] [--remote] [--channel ]\n", program); exit(1); } @@ -75,6 +76,7 @@ main (int argc, char **argv) FILE *out; char *filename; int serial_number = 0; + int channel = 0; int flight = 0; char cmd; int tick, a, b; @@ -89,7 +91,7 @@ main (int argc, char **argv) int invalid; char serial_line[8192]; - while ((c = getopt_long(argc, argv, "T:D:R", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "T:D:C:R", options, NULL)) != -1) { switch (c) { case 'T': tty = optarg; @@ -100,6 +102,9 @@ main (int argc, char **argv) case 'R': remote = 1; break; + case 'C': + channel = atoi(optarg); + break; default: usage(argv[0]); break; @@ -119,7 +124,7 @@ main (int argc, char **argv) if (!cc) exit(1); if (remote) - cc_usb_open_remote(cc); + cc_usb_open_remote(cc, channel); /* send a 'version' command followed by a 'log' command */ cc_usb_printf(cc, "v\n"); out = NULL;