X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Fao-telem%2Fao-telem.c;h=984184d65b88e5189e6a1f7e353d628bb1780376;hb=f32488556ce25e439fbab941f8019db639824f98;hp=7ab2310a5dc4a4ec3620147087b2305d4249a788;hpb=6f729ff46b2f4531db68f0af85e7e9fe0f6d1969;p=fw%2Faltos diff --git a/ao-tools/ao-telem/ao-telem.c b/ao-tools/ao-telem/ao-telem.c index 7ab2310a..984184d6 100644 --- a/ao-tools/ao-telem/ao-telem.c +++ b/ao-tools/ao-telem/ao-telem.c @@ -31,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); } @@ -44,7 +43,6 @@ main (int argc, char **argv) char line[80]; 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, @@ -122,7 +115,7 @@ main (int argc, char **argv) (telem.location.flags & (1 << 6)) ? ",date" : "", (telem.location.flags & (1 << 7)) ? ",course" : ""); printf (" alt %5d lat %12.7f lon %12.7f", - telem.location.altitude, + AO_TELEMETRY_LOCATION_ALTITUDE(&telem.location), telem.location.latitude / 1e7, telem.location.longitude / 1e7); if ((telem.location.flags & (1 << 6)) != 0) { @@ -157,7 +150,8 @@ main (int argc, char **argv) } printf ("\n"); break; - case AO_TELEMETRY_MEGA_SENSOR: + case AO_TELEMETRY_MEGA_SENSOR_MPU: + case AO_TELEMETRY_MEGA_SENSOR_BMX160: printf ("orient %3d accel %5d pres %9d temp %5d accel_x %5d accel_y %5d accel_z %5d gyro_x %5d gyro_y %5d gyro_z %5d mag_x %5d mag_y %5d mag_z %5d\n", telem.mega_sensor.orient, telem.mega_sensor.accel,