aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-12-24 18:57:39 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-12-24 18:57:39 +0100
commit4d4ea9c3698077451ecf91c27d45e6503aa1cd0b (patch)
treea80b0ab550e93840169791d0e4ac6acc00478678
parent850a7737b809ad844fd91de1befa273a66cbe8d3 (diff)
iface-modem-location: fix periodic reporting of the GPS location info
The Location property was never being updated properly.
-rw-r--r--src/mm-iface-modem-location.c6
1 files changed, 4 insertions, 2 deletions
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;
}