summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkj7.sung <kj7.sung@samsung.com>2016-08-01 19:46:30 +0900
committerkj7.sung <kj7.sung@samsung.com>2016-08-22 11:30:03 +0900
commitd64c087a0bcb5e93f234425e15fb29ede24890b4 (patch)
treee08375c8e3da2666dd8c41e57365a698ca48f613
parent7c7984ea9cd4fdb7c55d89495a3b4515baa3cf85 (diff)
downloadlbs-dbus-d64c087a0bcb5e93f234425e15fb29ede24890b4.tar.gz
lbs-dbus-d64c087a0bcb5e93f234425e15fb29ede24890b4.tar.bz2
lbs-dbus-d64c087a0bcb5e93f234425e15fb29ede24890b4.zip
Change-Id: I155b29a1104d3aaa4c86dc138e1eabfb263feba9 Signed-off-by: kj7.sung <kj7.sung@samsung.com>
-rwxr-xr-xclient/src/lbs_dbus_client.c57
-rw-r--r--introspection/lbs.xml4
-rw-r--r--packaging/liblbs-dbus.changes6
-rw-r--r--packaging/liblbs-dbus.spec2
-rw-r--r--server/src/lbs_dbus_server.c9
5 files changed, 22 insertions, 56 deletions
diff --git a/client/src/lbs_dbus_client.c b/client/src/lbs_dbus_client.c
index 8d10e1e..266c4a1 100755
--- a/client/src/lbs_dbus_client.c
+++ b/client/src/lbs_dbus_client.c
@@ -43,7 +43,6 @@ typedef struct _lbs_client_dbus_s {
int privacy_evt_id;
lbs_client_cb user_cb;
lbs_client_cb batch_cb;
- lbs_client_cb set_mock_cb;
void *user_data;
} lbs_client_dbus_s;
@@ -636,9 +635,8 @@ lbs_client_start(lbs_client_dbus_h lbs_client, unsigned int interval, lbs_client
param = g_variant_ref_sink(g_variant_new("(@a{sv})", g_variant_builder_end(builder)));
method = g_variant_ref_sink(g_variant_new("(i)", handle->method));
- proxy = g_dbus_proxy_new_sync(handle->conn, /* GDBusConnection */
- G_DBUS_PROXY_FLAGS_NONE, /* GDbusProxyFlags */
- NULL, SERVICE_NAME, SERVICE_PATH, "org.tizen.lbs.Manager", NULL, &error);
+ proxy = g_dbus_proxy_new_sync(handle->conn, G_DBUS_PROXY_FLAGS_NONE, NULL,
+ SERVICE_NAME, SERVICE_PATH, "org.tizen.lbs.Manager", NULL, &error);
if (error && error->message) {
if (error->code == G_DBUS_ERROR_ACCESS_DENIED) {
@@ -749,9 +747,8 @@ lbs_client_stop(lbs_client_dbus_h lbs_client)
method = g_variant_ref_sink(g_variant_new("(i)", handle->method));
GDBusProxy *proxy = NULL;
- proxy = g_dbus_proxy_new_sync(handle->conn, /* GDBusConnection */
- G_DBUS_PROXY_FLAGS_NONE, /*GDbusProxyFlags */
- NULL, SERVICE_NAME, SERVICE_PATH, "org.tizen.lbs.Manager", NULL, &error);
+ proxy = g_dbus_proxy_new_sync(handle->conn, G_DBUS_PROXY_FLAGS_NONE, NULL,
+ SERVICE_NAME, SERVICE_PATH, "org.tizen.lbs.Manager", NULL, &error);
if (error && error->message) {
if (error->code == G_DBUS_ERROR_ACCESS_DENIED) {
@@ -942,7 +939,6 @@ lbs_client_destroy(lbs_client_dbus_h lbs_client)
handle->user_cb = NULL;
handle->batch_cb = NULL;
- handle->set_mock_cb = NULL;
handle->user_data = NULL;
if (handle->conn) {
@@ -959,40 +955,19 @@ lbs_client_destroy(lbs_client_dbus_h lbs_client)
static void __dbus_set_location_callback(GObject *source_object, GAsyncResult *res, gpointer user_data)
{
- LBS_CLIENT_LOGD("ENTER >>> __dbus_set_location_callback");
+ LBS_CLIENT_LOGD(">>> __dbus_set_location_callback");
g_return_if_fail(source_object);
g_return_if_fail(res);
- lbs_client_dbus_s *handle = (lbs_client_dbus_s *)user_data;
GError *error = NULL;
gboolean success = FALSE;
- gchar *sig = NULL;
- GVariant *param = NULL;
-
LbsManager *proxy = (LbsManager *)source_object;
/* TODO: lbs-server will send method and status via DBUS. Have to change lbs.xml */
success = lbs_manager_call_set_mock_location_finish(proxy, res, &error);
- if (success) {
- if (handle && handle->set_mock_cb) {
- sig = g_strdup("SetLocation");
- param = g_variant_new("(ii)", LBS_CLIENT_METHOD_MOCK, 5); /* LBS_STATUS_BATCH + 1 */
- handle->set_mock_cb(sig, param, handle->user_data);
-
- g_free(sig);
- g_variant_unref(param);
- }
- } else {
+ if (success != TRUE) {
LBS_CLIENT_LOGW("SetLocation failed!!!");
- if (handle && handle->set_mock_cb) {
- sig = g_strdup("SetLocation");
- param = g_variant_new("(ii)", LBS_CLIENT_METHOD_MOCK, 6); /* LBS_STATUS_BATCH + 2 */
- handle->set_mock_cb(sig, param, handle->user_data);
-
- g_free(sig);
- g_variant_unref(param);
- }
if (error && error->message) {
if (error->code == G_DBUS_ERROR_ACCESS_DENIED)
@@ -1003,20 +978,12 @@ static void __dbus_set_location_callback(GObject *source_object, GAsyncResult *r
g_error_free(error);
}
}
-
- LBS_CLIENT_LOGD("EXIT <<<");
}
EXPORT_API int
-lbs_client_set_mock_location_async(lbs_client_dbus_h lbs_client,
- gint method,
- gdouble latitude,
- gdouble longitude,
- gdouble altitude,
- gdouble speed,
- gdouble direction,
- gdouble accuracy,
- lbs_client_cb callback, void *user_data)
+lbs_client_set_mock_location_async(lbs_client_dbus_h lbs_client, gint method,
+ gdouble latitude, gdouble longitude, gdouble altitude, gdouble speed, gdouble direction,
+ gdouble accuracy, lbs_client_cb callback, void *user_data)
{
LBS_CLIENT_LOGD("ENTER >>> lbs_client_set_mock_location_async");
g_return_val_if_fail(lbs_client, LBS_CLIENT_ERROR_PARAMETER);
@@ -1024,14 +991,12 @@ lbs_client_set_mock_location_async(lbs_client_dbus_h lbs_client,
lbs_client_dbus_s *handle = (lbs_client_dbus_s *)lbs_client;
int ret = LBS_CLIENT_ERROR_NONE;
- handle->set_mock_cb = callback;
handle->user_data = user_data;
LbsManager *proxy = NULL;
GError *error = NULL;
- proxy = lbs_manager_proxy_new_sync(handle->conn, G_DBUS_PROXY_FLAGS_NONE,
- SERVICE_NAME, SERVICE_PATH, NULL, &error);
+ proxy = lbs_manager_proxy_new_sync(handle->conn, G_DBUS_PROXY_FLAGS_NONE, SERVICE_NAME, SERVICE_PATH, NULL, &error);
if (proxy) {
lbs_manager_call_set_mock_location(proxy, method, latitude, longitude, altitude, speed, direction,
@@ -1051,7 +1016,7 @@ lbs_client_set_mock_location_async(lbs_client_dbus_h lbs_client,
g_error_free(error);
}
}
- LBS_CLIENT_LOGD("EXIT <<<");
return ret;
}
+
diff --git a/introspection/lbs.xml b/introspection/lbs.xml
index 192648e..0c93a2d 100644
--- a/introspection/lbs.xml
+++ b/introspection/lbs.xml
@@ -30,10 +30,6 @@
<arg direction="in" type="d" name="speed"/>
<arg direction="in" type="d" name="direction"/>
<arg direction="in" type="d" name="accuracy"/>
- <!--
- <arg direction="out" type="i" name="method"/>
- <arg direction="out" type="i" name="status"/>
- -->
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
</method>
</interface>
diff --git a/packaging/liblbs-dbus.changes b/packaging/liblbs-dbus.changes
index 13b8901..a3adb86 100644
--- a/packaging/liblbs-dbus.changes
+++ b/packaging/liblbs-dbus.changes
@@ -1,3 +1,9 @@
+[Version] lbs-dbus_1.0.1
+[Date] 16 Aug 2016
+[Changes] Fix mock location
+[Developer] Kyoungjun Sung <kj7.sung@samsung.com>
+================================================================================
+
[Version] lbs-dbus_1.0.0
[Date] 20 January 2016
[Changes] Supported mock location
diff --git a/packaging/liblbs-dbus.spec b/packaging/liblbs-dbus.spec
index fa7aa8c..cfbb0fc 100644
--- a/packaging/liblbs-dbus.spec
+++ b/packaging/liblbs-dbus.spec
@@ -1,6 +1,6 @@
Name: liblbs-dbus
Summary: DBus interface for Location Based Service
-Version: 1.0.0
+Version: 1.0.1
Release: 1
Group: Location/Libraries
License: Apache-2.0
diff --git a/server/src/lbs_dbus_server.c b/server/src/lbs_dbus_server.c
index f6df48d..c4416f8 100644
--- a/server/src/lbs_dbus_server.c
+++ b/server/src/lbs_dbus_server.c
@@ -350,8 +350,8 @@ lbs_server_remove_client(lbs_server_dbus_s *ctx, const char *client, int method)
if (ctx->shutdown_cb) {
ctx->shutdown_cb(ctx->userdata, shutdown_arr);
- LBS_SERVER_LOGD("shutdown_cb called.. gps:%d, nps:%d, mock:%d",
- shutdown_arr[LBS_SERVER_METHOD_GPS], shutdown_arr[LBS_SERVER_METHOD_NPS], shutdown_arr[LBS_SERVER_METHOD_MOCK]);
+ LBS_SERVER_LOGD("shutdown_cb called.. gps:%d, nps:%d",
+ shutdown_arr[LBS_SERVER_METHOD_GPS], shutdown_arr[LBS_SERVER_METHOD_NPS]);
}
g_free(shutdown_arr);
@@ -529,8 +529,8 @@ lbs_remove_client_by_force(const char *client, void *data)
if (ctx->shutdown_cb) {
ctx->shutdown_cb(ctx->userdata, shutdown_arr);
- LBS_SERVER_LOGD("shutdown_cb called.. gps:%d, nps:%d, mock:%d",
- shutdown_arr[LBS_SERVER_METHOD_GPS], shutdown_arr[LBS_SERVER_METHOD_NPS], shutdown_arr[LBS_SERVER_METHOD_MOCK]);
+ LBS_SERVER_LOGD("shutdown_cb called.. gps:%d, nps:%d",
+ shutdown_arr[LBS_SERVER_METHOD_GPS], shutdown_arr[LBS_SERVER_METHOD_NPS]);
}
if (ctx->update_interval_cb) {
@@ -708,7 +708,6 @@ lbs_server_emit_position_changed(lbs_server_dbus_h lbs_server,
gint arg_method, gint arg_fields, gint arg_timestamp, gdouble arg_latitude, gdouble arg_longitude, gdouble arg_altitude,
gdouble arg_speed, gdouble arg_direction, gdouble arg_climb, GVariant *arg_accuracy)
{
- LBS_SERVER_LOGD("method:%d", arg_method);
g_return_val_if_fail(lbs_server, LBS_SERVER_ERROR_PARAMETER);
g_return_val_if_fail(arg_accuracy, LBS_SERVER_ERROR_PARAMETER);