From 4d4ea9c3698077451ecf91c27d45e6503aa1cd0b Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 24 Dec 2012 18:57:39 +0100 Subject: iface-modem-location: fix periodic reporting of the GPS location info The Location property was never being updated properly. --- src/mm-iface-modem-location.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mm-iface-modem-location.c b/src/mm-iface-modem-location.c index fe6332ca..32f9a731 100644 --- a/src/mm-iface-modem-location.c +++ b/src/mm-iface-modem-location.c @@ -248,7 +248,8 @@ mm_iface_modem_location_gps_update (MMIfaceModemLocation *self, if (mm_gdbus_modem_location_get_enabled (skeleton) & MM_MODEM_LOCATION_SOURCE_GPS_NMEA) { g_assert (ctx->location_gps_nmea != NULL); if (mm_location_gps_nmea_add_trace (ctx->location_gps_nmea, nmea_trace) && - ctx->location_gps_nmea_last_time >= MM_LOCATION_GPS_REFRESH_TIME_SECS) { + (ctx->location_gps_nmea_last_time == 0 || + time (NULL) - ctx->location_gps_nmea_last_time >= MM_LOCATION_GPS_REFRESH_TIME_SECS)) { ctx->location_gps_nmea_last_time = time (NULL); update_nmea = TRUE; } @@ -257,7 +258,8 @@ mm_iface_modem_location_gps_update (MMIfaceModemLocation *self, if (mm_gdbus_modem_location_get_enabled (skeleton) & MM_MODEM_LOCATION_SOURCE_GPS_RAW) { g_assert (ctx->location_gps_raw != NULL); if (mm_location_gps_raw_add_trace (ctx->location_gps_raw, nmea_trace) && - ctx->location_gps_raw_last_time >= MM_LOCATION_GPS_REFRESH_TIME_SECS) { + (ctx->location_gps_raw_last_time == 0 || + time (NULL) - ctx->location_gps_raw_last_time >= MM_LOCATION_GPS_REFRESH_TIME_SECS)) { ctx->location_gps_raw_last_time = time (NULL); update_raw = TRUE; } -- cgit v1.2.3-70-g09d2