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.
35 #include <sys/types.h>
43 #include <glade/glade.h>
44 #include <gconf/gconf-client.h>
56 struct aogps_time gps_time;
57 double lat; /* degrees (+N -S) */
58 double lon; /* degrees (+E -W) */
61 int gps_extended; /* has extra data */
62 double ground_speed; /* m/s */
63 int course; /* degrees */
64 double climb_rate; /* m/s */
65 double hdop; /* unitless? */
70 #define SIRF_SAT_STATE_ACQUIRED (1 << 0)
71 #define SIRF_SAT_STATE_CARRIER_PHASE_VALID (1 << 1)
72 #define SIRF_SAT_BIT_SYNC_COMPLETE (1 << 2)
73 #define SIRF_SAT_SUBFRAME_SYNC_COMPLETE (1 << 3)
74 #define SIRF_SAT_CARRIER_PULLIN_COMPLETE (1 << 4)
75 #define SIRF_SAT_CODE_LOCKED (1 << 5)
76 #define SIRF_SAT_ACQUISITION_FAILED (1 << 6)
77 #define SIRF_SAT_EPHEMERIS_AVAILABLE (1 << 7)
85 struct aogps_tracking {
87 struct aogps_sat sats[12];
108 struct aogps_tracking gps_tracking;
116 struct aodata prev_data;
120 gboolean ascent; /* going up? */
133 double max_acceleration;
137 struct aogps_tracking gps_tracking;
143 double pad_lat_total;
144 double pad_lon_total;
145 double pad_alt_total;
157 extern struct aostate aostate;
159 /* GPS is 'stable' when we've seen at least this many samples */
160 #define MIN_PAD_SAMPLES 10
163 aoview_monitor_disconnect(void);
166 aoview_monitor_connect(char *tty);
169 aoview_monitor_parse(const char *line);
172 aoview_monitor_set_channel(int channel);
175 aoview_monitor_reset(void);
177 struct aoview_serial *
178 aoview_serial_open(const char *tty);
181 aoview_serial_close(struct aoview_serial *serial);
183 typedef void (*aoview_serial_callback)(gpointer user_data, struct aoview_serial *serial, gint revents);
186 aoview_serial_set_callback(struct aoview_serial *serial,
187 aoview_serial_callback func);
190 aoview_serial_printf(struct aoview_serial *serial, char *format, ...);
193 aoview_serial_read(struct aoview_serial *serial, char *buf, int len);
196 aoview_serial_getc(struct aoview_serial *serial);
199 aoview_dev_dialog_init(GladeXML *xml);
202 aoview_state_notify(struct aodata *data);
205 aoview_state_new(void);
208 aoview_state_init(GladeXML *xml);
211 aoview_pres_to_altitude(int16_t pres);
214 aoview_altitude_to_pres(int16_t alt);
217 aoview_fullname (char *dir, char *file);
220 aoview_basename(char *file);
223 aoview_add_plain_text_column (GtkTreeView *view, const gchar *title, gint model_column, gint width);
226 aoview_mkdir(char *dir);
229 aoview_log_init(GladeXML *xml);
232 aoview_log_set_serial(int serial);
235 aoview_log_get_serial(void);
238 aoview_log_printf(char *format, ...);
241 aoview_log_new(void);
244 aoview_table_start(void);
247 aoview_table_add_row(int column, char *label, char *format, ...);
250 aoview_table_finish(void);
253 aoview_table_init(GladeXML *xml);
256 aoview_table_clear(void);
260 extern char *aoview_file_dir;
263 aoview_file_finish(struct aoview_file *file);
266 aoview_file_start(struct aoview_file *file);
269 aoview_file_name(struct aoview_file *file);
272 aoview_file_set_serial(struct aoview_file *file, int serial);
275 aoview_file_get_serial(struct aoview_file *file);
278 aoview_file_printf(struct aoview_file *file, char *format, ...);
281 aoview_file_vprintf(struct aoview_file *file, char *format, va_list ap);
284 aoview_file_new(char *ext);
287 aoview_file_destroy(struct aoview_file *file);
290 aoview_file_init(GladeXML *xml);
292 /* aoview_eeprom.c */
295 aoview_eeprom_save(const char *device);
298 aoview_eeprom_init(GladeXML *xml);
301 void aoview_voice_open(void);
303 void aoview_voice_close(void);
305 void aoview_voice_speak(char *format, ...);
309 void aoview_label_init(GladeXML *xml);
312 aoview_label_show(struct aostate *state);
317 aoview_flite_start(void);
320 aoview_flite_stop(void);
324 extern char *aoview_tty;
326 /* aoview_channel.c */
329 aoview_channel_current(void);
332 aoview_channel_init(GladeXML *xml);
334 #endif /* _AOVIEW_H_ */