ao-tools: Parse TeleGPS state value from gps location packet
[fw/altos] / ao-tools / ao-telem / ao-telem.c
index 893e2340342bb3b2cfa7781fee121c83f58d63a1..75f94ec14aa0a8c37a764e9e3a9eccef4e7ca5c3 100644 (file)
@@ -145,6 +145,8 @@ main (int argc, char **argv)
                                                        telem.location.ground_speed / 100.0,
                                                        telem.location.climb_rate / 100.0,
                                                        telem.location.course * 2);
+                                       if ((telem.location.state & AO_GPS_STATE_VALID))
+                                               printf (" state %1d", telem.location.state & ~(AO_GPS_STATE_VALID));
                                        printf ("\n");
                                        break;
                                case AO_TELEMETRY_SATELLITE:
@@ -158,7 +160,8 @@ main (int argc, char **argv)
                                        printf ("\n");
                                        break;
                                case AO_TELEMETRY_MEGA_SENSOR:
-                                       printf ("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",
+                                       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,
                                                telem.mega_sensor.pres,
                                                telem.mega_sensor.temp,
@@ -214,6 +217,19 @@ main (int argc, char **argv)
                                                telem.metrum_data.accel_plus_g,
                                                telem.metrum_data.accel_minus_g);
                                        break;
+                               case AO_TELEMETRY_MINI:
+                                       printf ("state %1d v_batt %5d sense_a %5d sense_m %5d pres %9d temp %6.2f acceleration %6.2f speed %6.2f height %5d ground_pres %9d\n",
+                                               telem.mini.state,
+                                               telem.mini.v_batt,
+                                               telem.mini.sense_a,
+                                               telem.mini.sense_m,
+                                               telem.mini.pres,
+                                               telem.mini.temp / 100.0,
+                                               telem.mini.acceleration / 16.0,
+                                               telem.mini.speed / 16.0,
+                                               telem.mini.height,
+                                               telem.mini.ground_pres);
+                                       break;
                                default:
                                        printf("\n");
                                }