X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Fao-telem%2Fao-telem.c;h=ea0aa8d9b7d9cc8cd4d94e4e88bf5cec386c88cd;hp=f1755b824f82ef233a89d6ec9312bdea623700c9;hb=72bcff4c1af10571314e5cbbe29f073de818088e;hpb=488a527267decece48e6682e0e0c7fc29cbed329 diff --git a/ao-tools/ao-telem/ao-telem.c b/ao-tools/ao-telem/ao-telem.c index f1755b82..ea0aa8d9 100644 --- a/ao-tools/ao-telem/ao-telem.c +++ b/ao-tools/ao-telem/ao-telem.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -41,10 +42,8 @@ int main (int argc, char **argv) { char line[80]; - int c, i, ret; - char *s; + 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 +62,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 +98,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, @@ -158,7 +152,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, @@ -172,6 +167,15 @@ main (int argc, char **argv) telem.mega_sensor.mag_y, telem.mega_sensor.mag_z); break; + case AO_TELEMETRY_COMPANION: + printf("board_id %3d update_period %3d channels %2d", + telem.companion.board_id, + telem.companion.update_period, + telem.companion.channels); + for (c = 0; c < telem.companion.channels; c++) + printf(" %6d", telem.companion.companion_data[c]); + printf("\n"); + break; case AO_TELEMETRY_MEGA_DATA: printf ("state %1d v_batt %5d v_pyro %5d ", telem.mega_data.state, @@ -181,7 +185,7 @@ main (int argc, char **argv) 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,