From: minsoo kim Date: Thu, 6 Oct 2016 07:09:30 +0000 (+0900) Subject: sensord: add get wristup dbus interface X-Git-Tag: accepted/tizen/3.0/common/20161207.194152~1^2~9 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fsystem%2Fsensord.git;a=commitdiff_plain;h=7b82ada72d9325ba5192621a9366d915668793b8 sensord: add get wristup dbus interface SENSORD_BUS_NAME : "org.tizen.system.sensord" SENSORD_OBJECT_PATH : "/Org/Tizen/System/SensorD" SENSORD_INTERFACE_NAME : SENSORD_BUS_NAME WRISTUP_ALGO_METHOD : "wristup_algo" Change-Id: Ic7992b874b2456da2ede823de6bb7ffeb579f1a0 Signed-off-by: minsoo kim --- diff --git a/src/server/dbus_util.cpp b/src/server/dbus_util.cpp index c29b61d..0aa0b90 100755 --- a/src/server/dbus_util.cpp +++ b/src/server/dbus_util.cpp @@ -23,6 +23,7 @@ static int wrist_up_total_cnt; static int wrist_up_lcdon_cnt; +static int wrist_up_algo; static GDBusNodeInfo *introspection_data = NULL; static guint owner_id; @@ -39,6 +40,9 @@ static const gchar introspection_xml[] = " " " " " " +" " +" " +" " " " ""; @@ -59,6 +63,9 @@ static void method_call_handler(GDBusConnection *conn, } else if (g_strcmp0(method_name, "wristup_total_cnt") == 0) { _D("wristup_total_cnt called, %d", wrist_up_total_cnt); ret = wrist_up_total_cnt; + } else if (g_strcmp0(method_name, "wristup_algo") == 0) { + _D("wristup_algo called, %d", wrist_up_algo); + ret = wrist_up_algo; } else { _D("No matched method call"); ret = DBUS_FAILED; @@ -141,6 +148,11 @@ void reset_total_count(void) wrist_up_total_cnt = 0; } +void set_wrist_up_algo(int mode) +{ + wrist_up_algo = mode; +} + void init_dbus(void) { #ifndef GLIB_VERSION_2_36 diff --git a/src/server/dbus_util.h b/src/server/dbus_util.h index ce4ad54..f729e3b 100644 --- a/src/server/dbus_util.h +++ b/src/server/dbus_util.h @@ -37,6 +37,7 @@ void reset_lcdon_count(void); int get_total_count(void); void increase_total_count(void); void reset_total_count(void); +void set_wrist_up_algo(int mode); void init_dbus(void); void fini_dbus(void);