+static void cb_service_enabled (GObject *self, guint status, gpointer userdata)
+{
+ LocationObject *loc = (LocationObject*)userdata;
+ LocationAccuracy *acc = NULL;
+ LocationPosition *pos = NULL;
+ LocationVelocity *vel = NULL;
+ LocationAddress *addr = NULL;
+ LocationMethod method;
+
+ g_object_get(loc, "method", &method, NULL);
+ g_debug("Get property>> method:%d", method);
+
+ if (LOCATION_ERROR_NONE == location_get_position (loc, &pos, &acc)) {
+ g_debug ("SYNC>> Current position> time: %d, lat: %f, long: %f, alt: %f, status: %d",
+ pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ location_position_free(pos);
+ location_accuracy_free(acc);
+ } else g_warning ("SYNC>> Current position> failed");
+
+ if (LOCATION_ERROR_NONE == location_get_velocity (loc, &vel, &acc)) {
+ g_debug ("SYNC>> Current velocity> time: %d, speed: %f, direction:%f, climb:%f",
+ vel->timestamp, vel->speed, vel->direction, vel->climb);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ location_velocity_free(vel);
+ location_accuracy_free(acc);
+ } else g_warning ("SYNC>> Current velocity> failed");
+
+ if (LOCATION_ERROR_NONE == location_get_address(loc, &addr, &acc)) {
+ g_debug ("SYNC>> Current address> %s %s %s %s %s %s %s",
+ addr->building_number, addr->street, addr->district, addr->city, addr->state, addr->postal_code, addr->country_code);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ location_address_free(addr);
+ location_accuracy_free(acc);
+ } else g_warning ("SYNC>> Current address> failed");
+}
+
+static void
+cb_service_updated (GObject *self,
+ guint type,
+ gpointer data,
+ gpointer accuracy,
+ gpointer userdata)
+{
+ LocationAccuracy *acc = (LocationAccuracy*) accuracy;
+ switch (type) {
+ case POSITION_UPDATED: {
+ LocationPosition *pos = (LocationPosition*) data;
+ g_debug ("ASYNC>> Current position> time: %d, lat: %f, long: %f, alt: %f, status: %d",
+ pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ }
+ break;
+ case VELOCITY_UPDATED: {
+ LocationVelocity *vel = (LocationVelocity*) data;
+ g_debug ("ASYNC>> Current velocity> time: %d, speed: %f, direction:%f, climb:%f",
+ vel->timestamp, vel->speed, vel->direction, vel->climb);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ }
+ break;
+ default:
+ g_warning ("ASYNC>> Undefined update type");
+ break;
+ }
+}
+
+