X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Fao-telem%2Fao-telem.c;h=ee60712c40f6c969fde407bf2f27e97bd43d3217;hb=88e279b15b3d2357f142e58d20d73c24bf2561eb;hp=05a69542d53b7c97a436df77d85dd4f59811ef12;hpb=b4064bf63bb95c58d74869f4ff3e440370d64692;p=fw%2Faltos diff --git a/ao-tools/ao-telem/ao-telem.c b/ao-tools/ao-telem/ao-telem.c index 05a69542..ee60712c 100644 --- a/ao-tools/ao-telem/ao-telem.c +++ b/ao-tools/ao-telem/ao-telem.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -30,8 +31,7 @@ static const struct option options[] = { static void usage(char *program) { - fprintf(stderr, "usage: %s\n" - "\t{flight-log} ...\n", program); + fprintf(stderr, "usage: %s [--crc] {flight.telem} ...\n",program); exit(1); } @@ -41,10 +41,8 @@ int main (int argc, char **argv) { char line[80]; - int c, i, ret; - char *s; + int c, i, ret = 0; FILE *file; - int serial; int ignore_crc = 0; while ((c = getopt_long(argc, argv, "c", options, NULL)) != -1) { switch (c) { @@ -63,11 +61,6 @@ main (int argc, char **argv) ret++; continue; } - s = strstr(argv[i], "-serial-"); - if (s) - serial = atoi(s + 8); - else - serial = 0; while (fgets(line, sizeof (line), file)) { union ao_telemetry_all telem; char call[AO_MAX_CALLSIGN+1]; @@ -104,7 +97,7 @@ main (int argc, char **argv) memcpy(version, telem.configuration.version, AO_MAX_VERSION); call[AO_MAX_CALLSIGN] = '\0'; version[AO_MAX_CALLSIGN] = '\0'; - printf ("device %3d flight %5d config %3d.%03d delay %2d main %4d", + printf ("device %3d flight %5d config %3d.%03d delay %2d main %4d log_max %5d", telem.configuration.device, telem.configuration.flight, telem.configuration.config_major,