#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);