X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Fao-telem%2Fao-telem.c;h=7ab2310a5dc4a4ec3620147087b2305d4249a788;hb=14900d539c9d379a39ec157bb7e1914aad8fde3c;hp=893e2340342bb3b2cfa7781fee121c83f58d63a1;hpb=7314bf807544eecf2fd970e93c752ff15688bb42;p=fw%2Faltos diff --git a/ao-tools/ao-telem/ao-telem.c b/ao-tools/ao-telem/ao-telem.c index 893e2340..7ab2310a 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,8 +42,7 @@ 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; @@ -158,7 +158,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 +173,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 +191,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, @@ -214,6 +224,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"); }