From 3bc6857dcc3186812471d9be06808d952c00daa0 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Thu, 17 Jan 2008 16:54:43 +0200 Subject: [PATCH] Add GpsIO struct --- src/gps.h | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/src/gps.h b/src/gps.h index b9c3603..1327157 100644 --- a/src/gps.h +++ b/src/gps.h @@ -23,31 +23,55 @@ #define GPS_READ_BUF_SIZE 1024 +/** + * Types of GPS data sources + */ +typedef enum { + GPS_IO_DIRECT=1, + GPS_IO_FILE, + GPS_IO_TCP, + GPS_IO_GPSD, + GPS_IO_GYPSY +} GpsIOSourceType; + +/** + * GPS IO variables + * + */ +typedef struct _GpsIO GpsIO; +struct _GpsIO { + gint fd; + guint connect_sid; + guint error_sid; + guint input_sid; + guint clater_sid; + GIOChannel *channel; + DBusGProxy *rfcomm_req_proxy; + GpsIOSourceType src_type; + + gchar buf[GPS_READ_BUF_SIZE]; + gchar *curr; + gchar *last; +}; + +GpsIO gpsio; + gchar _gps_read_buf[GPS_READ_BUF_SIZE]; gchar *_gps_read_buf_curr; gchar *_gps_read_buf_last; DBusGProxy *_rfcomm_req_proxy; -/** The GIOChannel through which communication with the GPS receiver is - * performed. */ GIOChannel *_channel; - -/** The Source ID of the connect watch. */ guint _connect_sid; -/** The Source ID of the error watch. */ guint _error_sid; -/** The Source ID of the input watch. */ guint _input_sid; - -/** The Source ID of the "Connect Later" idle. */ guint _clater_sid; gint _gmtoffset; /** GPS data. */ GpsData _gps; -GpsSatelliteData _gps_sat[12]; Point _pos; void gps_init(void); -- 2.39.5