gps->io.type=type;
gps->io.conn=RCVR_OFF;
gps->io.nmea=NULL;
+gps->io.nmea_cnt=0;
gps->data.lat=60.20;
gps->data.lon=22.20;
gps->connection_error=NULL;
gps->data.time=time(NULL);
gps_data_integerize(&gps->data);
if (gps->update_location!=NULL) {
- gps->update_location(gps, FALSE);
+ gps->update_location(gps);
}
gps->data.lheading=gps->data.heading;
if (*sptr)
*sptr = '\0'; /* take checksum out of the buffer. */
- gps->io.nmea=g_strdup(gps->io.buffer);
+ gps->io.nmea_cnt++;
+ gps->io.nmea=gps->io.buffer;
+
g_assert(gps->io.nmea);
- g_idle_add_full(G_PRIORITY_HIGH_IDLE, (GSourceFunc)gps_nmea_parse, gps, NULL);
+ g_debug("NMEA1 %d: (%s)", gps->io.nmea_cnt, gps->io.nmea);
+
+ gps_nmea_parse(gps);
} else {
/* There was a checksum, and it was bad. */
g_printerr("%s: Bad checksum in NMEA sentence:\n%s\n", __PRETTY_FUNCTION__, gps->io.buffer);