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>
41 #include <glade/glade.h>
42 #include <gconf/gconf-client.h>
64 struct aogps_time gps_time;
65 double lat; /* degrees (+N -S) */
66 double lon; /* degrees (+E -W) */
69 int gps_extended; /* has extra data */
70 double ground_speed; /* m/s */
71 int course; /* degrees */
72 double climb_rate; /* m/s */
73 double hdop; /* unitless? */
78 #define SIRF_SAT_STATE_ACQUIRED (1 << 0)
79 #define SIRF_SAT_STATE_CARRIER_PHASE_VALID (1 << 1)
80 #define SIRF_SAT_BIT_SYNC_COMPLETE (1 << 2)
81 #define SIRF_SAT_SUBFRAME_SYNC_COMPLETE (1 << 3)
82 #define SIRF_SAT_CARRIER_PULLIN_COMPLETE (1 << 4)
83 #define SIRF_SAT_CODE_LOCKED (1 << 5)
84 #define SIRF_SAT_ACQUISITION_FAILED (1 << 6)
85 #define SIRF_SAT_EPHEMERIS_AVAILABLE (1 << 7)
93 struct aogps_tracking {
95 struct aogps_sat sats[12];
116 struct aogps_tracking gps_tracking;
124 struct aodata prev_data;
128 gboolean ascent; /* going up? */
141 double max_acceleration;
145 struct aogps_tracking gps_tracking;
151 double pad_lat_total;
152 double pad_lon_total;
153 double pad_alt_total;
165 extern struct aostate aostate;
167 /* GPS is 'stable' when we've seen at least this many samples */
168 #define MIN_PAD_SAMPLES 10
171 aoview_monitor_disconnect(void);
174 aoview_monitor_connect(char *tty);
177 aoview_monitor_parse(const char *line);
180 aoview_monitor_reset(void);
182 struct aoview_serial *
183 aoview_serial_open(const char *tty);
186 aoview_serial_close(struct aoview_serial *serial);
188 typedef void (*aoview_serial_callback)(gpointer user_data, struct aoview_serial *serial, gint revents);
191 aoview_serial_set_callback(struct aoview_serial *serial,
192 aoview_serial_callback func);
195 aoview_serial_printf(struct aoview_serial *serial, char *format, ...);
198 aoview_serial_read(struct aoview_serial *serial, char *buf, int len);
201 aoview_serial_getc(struct aoview_serial *serial);
204 aoview_dev_dialog_init(GladeXML *xml);
207 aoview_usb_scan(struct usbdev ***devs_ret);
210 aoview_usbdev_free(struct usbdev *usbdev);
213 aoview_state_notify(struct aodata *data);
216 aoview_state_new(void);
219 aoview_state_init(GladeXML *xml);
222 aoview_pres_to_altitude(int16_t pres);
225 aoview_altitude_to_pres(int16_t alt);
228 aoview_fullname (char *dir, char *file);
231 aoview_basename(char *file);
234 aoview_add_plain_text_column (GtkTreeView *view, const gchar *title, gint model_column, gint width);
237 aoview_mkdir(char *dir);
240 aoview_log_init(GladeXML *xml);
243 aoview_log_set_serial(int serial);
246 aoview_log_get_serial(void);
249 aoview_log_printf(char *format, ...);
252 aoview_log_new(void);
255 aoview_table_start(void);
258 aoview_table_add_row(int column, char *label, char *format, ...);
261 aoview_table_finish(void);
264 aoview_table_init(GladeXML *xml);
267 aoview_table_clear(void);
271 extern char *aoview_file_dir;
274 aoview_file_finish(struct aoview_file *file);
277 aoview_file_start(struct aoview_file *file);
280 aoview_file_name(struct aoview_file *file);
283 aoview_file_set_serial(struct aoview_file *file, int serial);
286 aoview_file_get_serial(struct aoview_file *file);
289 aoview_file_printf(struct aoview_file *file, char *format, ...);
292 aoview_file_vprintf(struct aoview_file *file, char *format, va_list ap);
295 aoview_file_new(char *ext);
298 aoview_file_destroy(struct aoview_file *file);
301 aoview_file_init(GladeXML *xml);
303 /* aoview_eeprom.c */
306 aoview_eeprom_save(const char *device);
309 aoview_eeprom_init(GladeXML *xml);
312 void aoview_voice_open(void);
314 void aoview_voice_close(void);
316 void aoview_voice_speak(char *format, ...);
320 void aoview_label_init(GladeXML *xml);
323 aoview_label_show(struct aostate *state);
328 aoview_flite_start(void);
331 aoview_flite_stop(void);
335 extern char *aoview_tty;
337 #endif /* _AOVIEW_H_ */