ao-tools: Handle TeleMega v4.0 telemetry in ao-telem
[fw/altos] / ao-tools / ao-telem / ao-telem.c
index ea0aa8d9b7d9cc8cd4d94e4e88bf5cec386c88cd..984184d65b88e5189e6a1f7e353d628bb1780376 100644 (file)
@@ -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);
 }
 
@@ -116,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) {
@@ -151,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,