diff options
| author | Keith Packard <keithp@keithp.com> | 2010-08-07 22:30:55 -0400 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2010-08-07 22:30:55 -0400 |
| commit | 294d9c7db21eaf1e71504dbcca5040371abcce55 (patch) | |
| tree | 013a0f8e5147647af9c58c2c4e628e713753341d /ao-tools/ao-dumplog/ao-dumplog.c | |
| parent | f317f1324b69b4241f4bb192e164b33d712d5a43 (diff) | |
ao-dumplog: add --channel option (for use with -R option)
Sets the channel when downloading data with the -R option.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/ao-dumplog/ao-dumplog.c')
| -rw-r--r-- | ao-tools/ao-dumplog/ao-dumplog.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ao-tools/ao-dumplog/ao-dumplog.c b/ao-tools/ao-dumplog/ao-dumplog.c index 440a02b5..57c43290 100644 --- a/ao-tools/ao-dumplog/ao-dumplog.c +++ b/ao-tools/ao-dumplog/ao-dumplog.c @@ -30,12 +30,13 @@ 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 = "channel", .has_arg = 1, .val = 'C' }, { 0, 0, 0, 0}, }; static void usage(char *program) { - fprintf(stderr, "usage: %s [--tty <tty-name>] [--device <device-name>] [-R]\n", program); + fprintf(stderr, "usage: %s [--tty <tty-name>] [--device <device-name>] [--remote] [--channel <radio-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; @@ -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; |
