#include "gps-conn.h"
#include "track.h"
-#define GPSD_NMEA "r+\r\n"
-#define GPSD_PORT (2947)
+#ifdef WITH_GPSBT
+#include <gpsbt.h>
+static gpsbt_t ctx = {0};
+#endif
static gboolean gps_channel_cb_error(GIOChannel *src, GIOCondition condition, gpointer data);
static gboolean gps_channel_cb_input(GIOChannel *src, GIOCondition condition, gpointer data);
static gboolean gps_connect_socket(Gps *gps);
static gboolean gps_connect_file(Gps *gps);
+#define GPSD_NMEA "r+\r\n"
+#define GPSD_PORT (2947)
+
/**
* Init GPS structure
*/
gps->io.fd=-1;
}
+#ifdef WITH_GPSBT
+if (gps->io.type==GPS_IO_GPSD) {
+ gint r;
+ r=gpsbt_stop(&ctx);
+ if (r!=0)
+ g_warning("Failed to stop gpsd\n");
+}
+#endif
+
#ifdef WITH_HILDON_DBUS_BT
if (gps->io.type==GPS_IO_HILDON_DBUS && gps->io.rfcomm_req_proxy) {
GError *error = NULL;
} else {
return FALSE;
}
+#ifdef WITH_GPSBT
+ if (gps->io.type==GPS_IO_GPSD) {
+ gint r;
+ gchar ebuf[128];
+ r=gpsbt_start(NULL, 0, 0, 0, ebuf, 128, 0, &ctx);
+ if (r!=0) {
+ g_warning("Failed to start gpsd");
+ return FALSE;
+ }
+ }
+#endif
break;
case GPS_IO_HILDON_DBUS:
#ifdef WITH_HILDON_DBUS_BT