Commit d0f27e51 authored by Jussi Kukkonen's avatar Jussi Kukkonen

change current_position to just read from the gpsdata-struct (and not query gpsd)

parent 95b3f114
...@@ -139,24 +139,20 @@ gboolean geoclue_position_service_provider(GeocluePosition *obj, char** name, GE ...@@ -139,24 +139,20 @@ gboolean geoclue_position_service_provider(GeocluePosition *obj, char** name, GE
gboolean geoclue_position_current_position(GeocluePosition *obj, gdouble* OUT_latitude, gdouble* OUT_longitude, GError **error ) gboolean geoclue_position_current_position(GeocluePosition *obj, gdouble* OUT_latitude, gdouble* OUT_longitude, GError **error )
{ {
/* if everything is fine, we can just read obj->gpsdata */
g_print(" Querying GPSD\n"); if (obj->gpsdata->status &&
gps_query(obj->gpsdata, "w+x\n"); obj->gpsdata->online &&
obj->gpsdata->fix.mode > 1 &&
*OUT_latitude = obj->gpsdata->fix.latitude; (obj->gpsdata->set & (LATLON_SET | ALTITUDE_SET))) {
*OUT_longitude = obj->gpsdata->fix.longitude;
*OUT_latitude = obj->gpsdata->fix.latitude;
g_print("Sending back %f %f\n", *OUT_latitude, *OUT_longitude); *OUT_longitude = obj->gpsdata->fix.longitude;
//*OUT_latitude = obj->gpsdata->newdata.latitude; g_debug ("Sending back %f %f", *OUT_latitude, *OUT_longitude);
//*OUT_longitude = obj->gpsdata->newdata.longitude; return TRUE;
} else {
// g_print("Sending back %f %f\n", *OUT_latitude, *OUT_longitude); return FALSE;
}
return TRUE;
} }
gboolean geoclue_position_current_position_error(GeocluePosition *obj, gdouble* OUT_latitude_error, gdouble* OUT_longitude_error, GError **error ) gboolean geoclue_position_current_position_error(GeocluePosition *obj, gdouble* OUT_latitude_error, gdouble* OUT_longitude_error, GError **error )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment