diff options
author | Keith Packard <keithp@keithp.com> | 2009-11-03 00:40:38 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-11-03 00:40:38 -0800 |
commit | 1de322b960005c9a16051afa1881fadb00f4bcd6 (patch) | |
tree | 7b60481ac08b3f4e0362efdecab5fcefe299cad2 /src | |
parent | b529e5e8998702986909111a457f3ce9932e1ccf (diff) |
Pass accel calibration over telemetry stream. Telemetry data format change.
This allows the ground station to convert the accelerometer sensor
values into acceleration and speed data. This requires a new telemetry
data structure, and so TeleMetrum and TeleDongle units must be updated
synchronously. ao-view will parse either telemetry stream, and the
serial format from TeleDongle now has a version number to allow for
future changes.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/ao.h | 3 | ||||
-rw-r--r-- | src/ao_monitor.c | 18 | ||||
-rw-r--r-- | src/ao_telemetry.c | 2 |
3 files changed, 16 insertions, 7 deletions
@@ -784,6 +784,7 @@ ao_gps_report_init(void); */ #define AO_MAX_CALLSIGN 8 +#define AO_TELEMETRY_VERSION 1 struct ao_telemetry { uint8_t addr; @@ -793,6 +794,8 @@ struct ao_telemetry { int32_t flight_vel; int16_t flight_pres; int16_t ground_pres; + int16_t accel_plus_g; + int16_t accel_minus_g; struct ao_adc adc; struct ao_gps_data gps; char callsign[AO_MAX_CALLSIGN]; diff --git a/src/ao_monitor.c b/src/ao_monitor.c index d0c1da34..cd0d693e 100644 --- a/src/ao_monitor.c +++ b/src/ao_monitor.c @@ -37,12 +37,14 @@ ao_monitor(void) if (state > ao_flight_invalid) state = ao_flight_invalid; if (recv.status & PKT_APPEND_STATUS_1_CRC_OK) { - printf ("CALL %s SERIAL %3d RSSI %4d STATUS %02x STATE %7s ", - callsign, - recv.telemetry.addr, - (int) recv.rssi - 74, recv.status, - ao_state_names[state]); - printf("%5u a: %5d p: %5d t: %5d v: %5d d: %5d m: %5d fa: %5d ga: %d fv: %7ld fp: %5d gp: %5d ", + printf("VERSION %d CALL %s SERIAL %3d RSSI %4d STATUS %02x STATE %7s ", + AO_TELEMETRY_VERSION, + callsign, + recv.telemetry.addr, + (int) recv.rssi - 74, recv.status, + ao_state_names[state]); + printf("%5u a: %5d p: %5d t: %5d v: %5d d: %5d m: %5d " + "fa: %5d ga: %d fv: %7ld fp: %5d gp: %5d a+: %5d a-: %5d ", recv.telemetry.adc.tick, recv.telemetry.adc.accel, recv.telemetry.adc.pres, @@ -54,7 +56,9 @@ ao_monitor(void) recv.telemetry.ground_accel, recv.telemetry.flight_vel, recv.telemetry.flight_pres, - recv.telemetry.ground_pres); + recv.telemetry.ground_pres, + recv.telemetry.accel_plus_g, + recv.telemetry.accel_minus_g); ao_gps_print(&recv.telemetry.gps); putchar(' '); ao_gps_tracking_print(&recv.telemetry.gps_tracking); diff --git a/src/ao_telemetry.c b/src/ao_telemetry.c index d52e589c..9c923984 100644 --- a/src/ao_telemetry.c +++ b/src/ao_telemetry.c @@ -32,6 +32,8 @@ ao_telemetry(void) ao_config_get(); memcpy(telemetry.callsign, ao_config.callsign, AO_MAX_CALLSIGN); telemetry.addr = ao_serial_number; + telemetry.accel_plus_g = ao_config.accel_plus_g; + telemetry.accel_minus_g = ao_config.accel_minus_g; ao_rdf_time = ao_time(); for (;;) { while (ao_telemetry_interval == 0) |