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.
23 #ifndef AO_GPS_ORIG_ALTITUDE
24 #define AO_GPS_ORIG_ALTITUDE(l) ((l)->altitude)
28 ao_gps_print(__xdata struct ao_gps_orig *gps_data) __reentrant
32 if (gps_data->flags & AO_GPS_VALID)
33 state = AO_TELEM_GPS_STATE_LOCKED;
34 else if (gps_data->flags & AO_GPS_RUNNING)
35 state = AO_TELEM_GPS_STATE_UNLOCKED;
37 state = AO_TELEM_GPS_STATE_ERROR;
38 printf(AO_TELEM_GPS_STATE " %c "
39 AO_TELEM_GPS_NUM_SAT " %d ",
41 (gps_data->flags & AO_GPS_NUM_SAT_MASK) >> AO_GPS_NUM_SAT_SHIFT);
42 if (!(gps_data->flags & AO_GPS_VALID))
44 printf(AO_TELEM_GPS_LATITUDE " %ld "
45 AO_TELEM_GPS_LONGITUDE " %ld "
46 AO_TELEM_GPS_ALTITUDE " %d ",
47 (long) gps_data->latitude,
48 (long) gps_data->longitude,
49 AO_GPS_ORIG_ALTITUDE(gps_data));
51 if (gps_data->flags & AO_GPS_DATE_VALID)
52 printf(AO_TELEM_GPS_YEAR " %d "
53 AO_TELEM_GPS_MONTH " %d "
54 AO_TELEM_GPS_DAY " %d ",
59 printf(AO_TELEM_GPS_HOUR " %d "
60 AO_TELEM_GPS_MINUTE " %d "
61 AO_TELEM_GPS_SECOND " %d ",
66 printf(AO_TELEM_GPS_HDOP " %d ",
69 if (gps_data->flags & AO_GPS_COURSE_VALID) {
70 printf(AO_TELEM_GPS_HERROR " %d "
71 AO_TELEM_GPS_VERROR " %d "
72 AO_TELEM_GPS_VERTICAL_SPEED " %d "
73 AO_TELEM_GPS_HORIZONTAL_SPEED " %d "
74 AO_TELEM_GPS_COURSE " %d ",
78 gps_data->ground_speed,
79 (int) gps_data->course * 2);
84 ao_gps_tracking_print(__xdata struct ao_gps_tracking_orig *gps_tracking_data) __reentrant
87 __xdata struct ao_gps_sat_orig *sat;
89 n = gps_tracking_data->channels;
93 sat = gps_tracking_data->sats;
95 for (c = 0; c < n; c++) {
101 printf (AO_TELEM_SAT_NUM " %d ",
104 sat = gps_tracking_data->sats;
106 for (c = 0; c < n; c++) {
108 printf (AO_TELEM_SAT_SVID "%d %d "
109 AO_TELEM_SAT_C_N_0 "%d %d ",