summaryrefslogtreecommitdiff
path: root/ao-tools/ao-telem
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-06-21 09:51:17 -0700
committerKeith Packard <keithp@keithp.com>2012-06-21 09:51:17 -0700
commit0b5548d6ced67201311e1072d37fbedd3d9929c9 (patch)
tree3417356ab65ec8889ce43d19bfc5a3e8bcca28d6 /ao-tools/ao-telem
parent6f421818fd7062f03bfaf9e606d6a4cfdcb13b49 (diff)
ao-tools: Support MM telemetry packets in ao-telem
Parse the new packet formats Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/ao-telem')
-rw-r--r--ao-tools/ao-telem/ao-telem.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/ao-tools/ao-telem/ao-telem.c b/ao-tools/ao-telem/ao-telem.c
index 384b2fc8..e7fc8e26 100644
--- a/ao-tools/ao-telem/ao-telem.c
+++ b/ao-tools/ao-telem/ao-telem.c
@@ -82,7 +82,6 @@ main (int argc, char **argv)
case AO_TELEMETRY_SENSOR_TELEMETRUM:
case AO_TELEMETRY_SENSOR_TELEMINI:
case AO_TELEMETRY_SENSOR_TELENANO:
- case AO_TELEMETRY_SENSOR_MEGAMETRUM:
printf ("state %1d accel %5d pres %5d ",
telem.sensor.state, telem.sensor.accel, telem.sensor.pres);
printf ("accel %6.2f speed %6.2f height %5d ",
@@ -153,6 +152,43 @@ 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",
+ telem.mega_sensor.accel,
+ telem.mega_sensor.pres,
+ telem.mega_sensor.temp,
+ telem.mega_sensor.accel_x,
+ telem.mega_sensor.accel_y,
+ telem.mega_sensor.accel_z,
+ telem.mega_sensor.gyro_x,
+ telem.mega_sensor.gyro_y,
+ telem.mega_sensor.gyro_z,
+ telem.mega_sensor.mag_x,
+ telem.mega_sensor.mag_y,
+ telem.mega_sensor.mag_z);
+ break;
+ case AO_TELEMETRY_MEGA_DATA:
+ printf ("state %1d v_batt %5d v_pyro %5d ",
+ telem.mega_data.state,
+ telem.mega_data.v_batt,
+ telem.mega_data.v_pyro);
+ for (c = 0; c < 6; c++)
+ printf ("s%1d %5d ", c,
+ telem.mega_data.sense[c] |
+ (telem.mega_data.sense[c] << 8));
+
+ printf ("ground_pres %5d ground_accel %5d accel_plus %5d accel_minus %5d ",
+ telem.mega_data.ground_pres,
+ telem.mega_data.ground_accel,
+ telem.mega_data.accel_plus_g,
+ telem.mega_data.accel_minus_g);
+
+ printf ("accel %6.2f speed %6.2f height %5d\n",
+ telem.mega_data.acceleration / 16.0,
+ telem.mega_data.speed / 16.0,
+ telem.mega_data.height);
+
+ break;
default:
printf("\n");
}