]> err.no Git - mapper/commitdiff
Add field with default gps address/ip
authorKaj-Michael Lang <milang@tal.org>
Mon, 4 Feb 2008 07:44:52 +0000 (09:44 +0200)
committerKaj-Michael Lang <milang@tal.org>
Mon, 4 Feb 2008 07:44:52 +0000 (09:44 +0200)
src/gps.c
src/gps.h

index 0523be5ce03136432e9487b915d6810770b81c23..629d529b041fe310f196a19365ce6b3b3773b40e 100644 (file)
--- a/src/gps.c
+++ b/src/gps.c
@@ -66,6 +66,8 @@ static gboolean gps_connect_file(Gps *gps, gchar *file);
 
 #define GPSD_NMEA "r+\r\n"
 #define GPSD_PORT (2947)
+#define LOCALHOST "127.0.0.1"
+#define GPS_DEVICE_FILE "/dev/ttyS0"
 
 const GpsTypes gps_types[] = {
 #ifdef WITH_BLUEZ
@@ -77,11 +79,11 @@ const GpsTypes gps_types[] = {
 #ifdef WITH_BLUEZ_DBUS_BT
        { GPS_IO_BLUEZ_DBUS,    "Bluetooth connection (new)", TRUE, TRUE, FALSE},
 #endif
-       { GPS_IO_GPSD,                  "GPSD Connection", FALSE, TRUE, TRUE, GPSD_PORT },
-       { GPS_IO_FILE,                  "File or device", FALSE, TRUE, FALSE},
-       { GPS_IO_TCP,                   "TCP Connection", FALSE, TRUE, TRUE, 1024 },
+       { GPS_IO_GPSD,                  "GPSD Connection", FALSE, TRUE, TRUE, GPSD_PORT, LOCALHOST },
+       { GPS_IO_FILE,                  "File or device", FALSE, TRUE, FALSE, 0, GPS_DEVICE_FILE },
+       { GPS_IO_TCP,                   "TCP Connection", FALSE, TRUE, TRUE, 1024, LOCALHOST },
 #ifdef WITH_GYPSY
-       { GPS_IO_GYPSY,                 "Gypsy", FALSE, TRUE, FALSE},
+       { GPS_IO_GYPSY,                 "Gypsy", FALSE, TRUE, FALSE },
 #endif
        { GPS_IO_SIMULATION,    "Simulation (random)", FALSE, FALSE, FALSE},
        { 0 }
@@ -614,9 +616,9 @@ switch (gps->io.type) {
                        g_debug("GPS: Requesting NMEA mode from GPSD using cmd %s", GPSD_NMEA);
                        status=g_io_channel_write_chars(gps->io.channel, GPSD_NMEA, strlen(GPSD_NMEA), &written, &error);
                        if (status==G_IO_STATUS_NORMAL && written==strlen(GPSD_NMEA)) {
-                               g_debug("GPS: NMEA mode set (%d %d)", written, status);
+                               g_debug("GPS: NMEA mode set (%d %d)", (gint)written, (gint)status);
                        } else {
-                               g_printerr("Failed to set gpsd to NMEA mode: %d %d %s\n",status, written, error->message);
+                               g_printerr("Failed to set gpsd to NMEA mode: %d %d %s\n",(gint)status,(gint)written, error->message);
                                g_error_free(error);
                                gps_disconnect(gps);
                                gps_connect_later(gps);
index 498d3e6e3705fa094f3e3cd38cf190fee47874c8..c60f8955cadb6427d5211b127c382b2b5b3b4216 100644 (file)
--- a/src/gps.h
+++ b/src/gps.h
@@ -59,7 +59,7 @@ struct _GpsTypes {
     gboolean address;  /* Needs address */
        gboolean port;          /* Needs port */
        guint port_def;         /* Default port */
-       
+       const gchar *address_def; /* Default mac/ip/device */
 };
 
 /** This enumerated type defines the possible connection states. */