2 * Copyright © 2009 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 ao_gps_print(__xdata struct ao_gps_orig *gps_data) __reentrant
28 if (gps_data->flags & AO_GPS_VALID)
29 state = AO_TELEM_GPS_STATE_LOCKED;
30 else if (gps_data->flags & AO_GPS_RUNNING)
31 state = AO_TELEM_GPS_STATE_UNLOCKED;
33 state = AO_TELEM_GPS_STATE_ERROR;
34 printf(AO_TELEM_GPS_STATE " %c "
35 AO_TELEM_GPS_NUM_SAT " %d ",
37 (gps_data->flags & AO_GPS_NUM_SAT_MASK) >> AO_GPS_NUM_SAT_SHIFT);
38 if (!(gps_data->flags & AO_GPS_VALID))
40 printf(AO_TELEM_GPS_LATITUDE " %ld "
41 AO_TELEM_GPS_LONGITUDE " %ld "
42 AO_TELEM_GPS_ALTITUDE " %d ",
43 (long) gps_data->latitude,
44 (long) gps_data->longitude,
47 if (gps_data->flags & AO_GPS_DATE_VALID)
48 printf(AO_TELEM_GPS_YEAR " %d "
49 AO_TELEM_GPS_MONTH " %d "
50 AO_TELEM_GPS_DAY " %d ",
55 printf(AO_TELEM_GPS_HOUR " %d "
56 AO_TELEM_GPS_MINUTE " %d "
57 AO_TELEM_GPS_SECOND " %d ",
62 printf(AO_TELEM_GPS_HDOP " %d ",
65 if (gps_data->flags & AO_GPS_COURSE_VALID) {
66 printf(AO_TELEM_GPS_HERROR " %d "
67 AO_TELEM_GPS_VERROR " %d "
68 AO_TELEM_GPS_VERTICAL_SPEED " %d "
69 AO_TELEM_GPS_HORIZONTAL_SPEED " %d "
70 AO_TELEM_GPS_COURSE " %d ",
74 gps_data->ground_speed,
75 (int) gps_data->course * 2);
80 ao_gps_tracking_print(__xdata struct ao_gps_tracking_orig *gps_tracking_data) __reentrant
83 __xdata struct ao_gps_sat_orig *sat;
85 n = gps_tracking_data->channels;
89 sat = gps_tracking_data->sats;
91 for (c = 0; c < n; c++) {
97 printf (AO_TELEM_SAT_NUM " %d ",
100 sat = gps_tracking_data->sats;
102 for (c = 0; c < n; c++) {
104 printf (AO_TELEM_SAT_SVID "%d %d "
105 AO_TELEM_SAT_C_N_0 "%d %d ",