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];
110 struct aogps_tracking gps_tracking;
118 struct aodata prev_data;
122 gboolean ascent; /* going up? */
135 double max_acceleration;
139 struct aogps_tracking gps_tracking;
145 double pad_lat_total;
146 double pad_lon_total;
147 double pad_alt_total;
159 extern struct aostate aostate;
161 /* GPS is 'stable' when we've seen at least this many samples */
162 #define MIN_PAD_SAMPLES 10
165 aoview_monitor_disconnect(void);
168 aoview_monitor_connect(char *tty);
171 aoview_monitor_parse(const char *line);
174 aoview_monitor_set_channel(int channel);
177 aoview_monitor_reset(void);
179 struct aoview_serial *
180 aoview_serial_open(const char *tty);
183 aoview_serial_close(struct aoview_serial *serial);
185 typedef void (*aoview_serial_callback)(gpointer user_data, struct aoview_serial *serial, gint revents);
188 aoview_serial_set_callback(struct aoview_serial *serial,
189 aoview_serial_callback func);
192 aoview_serial_printf(struct aoview_serial *serial, char *format, ...);
195 aoview_serial_read(struct aoview_serial *serial, char *buf, int len);
198 aoview_serial_getc(struct aoview_serial *serial);
201 aoview_dev_dialog_init(GladeXML *xml);
204 aoview_state_notify(struct aodata *data);
207 aoview_state_new(void);
210 aoview_state_init(GladeXML *xml);
213 aoview_pres_to_altitude(int16_t pres);
216 aoview_altitude_to_pres(int16_t alt);
219 aoview_fullname (char *dir, char *file);
222 aoview_basename(char *file);
225 aoview_add_plain_text_column (GtkTreeView *view, const gchar *title, gint model_column, gint width);
228 aoview_mkdir(char *dir);
231 aoview_log_init(GladeXML *xml);
234 aoview_log_set_serial(int serial);
237 aoview_log_get_serial(void);
240 aoview_log_printf(char *format, ...);
243 aoview_log_new(void);
246 aoview_table_start(void);
249 aoview_table_add_row(int column, char *label, char *format, ...);
252 aoview_table_finish(void);
255 aoview_table_init(GladeXML *xml);
258 aoview_table_clear(void);
262 extern char *aoview_file_dir;
265 aoview_file_finish(struct aoview_file *file);
268 aoview_file_start(struct aoview_file *file);
271 aoview_file_name(struct aoview_file *file);
274 aoview_file_set_serial(struct aoview_file *file, int serial);
277 aoview_file_get_serial(struct aoview_file *file);
280 aoview_file_printf(struct aoview_file *file, char *format, ...);
283 aoview_file_vprintf(struct aoview_file *file, char *format, va_list ap);
286 aoview_file_new(char *ext);
289 aoview_file_destroy(struct aoview_file *file);
292 aoview_file_init(GladeXML *xml);
294 /* aoview_eeprom.c */
297 aoview_eeprom_save(const char *device);
300 aoview_eeprom_init(GladeXML *xml);
303 void aoview_voice_open(void);
305 void aoview_voice_close(void);
307 void aoview_voice_speak(char *format, ...);
311 void aoview_label_init(GladeXML *xml);
314 aoview_label_show(struct aostate *state);
319 aoview_flite_start(void);
322 aoview_flite_stop(void);
326 extern char *aoview_tty;
328 /* aoview_channel.c */
331 aoview_channel_current(void);
334 aoview_channel_init(GladeXML *xml);
336 #endif /* _AOVIEW_H_ */