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 <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);
}
FILE *out;
char *filename;
int serial_number = 0;
+ int channel = 0;
int flight = 0;
char cmd;
int tick, a, b;
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;
case 'R':
remote = 1;
break;
+ case 'C':
+ channel = atoi(optarg);
+ break;
default:
usage(argv[0]);
break;
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;