sensord: add get wristup dbus interface 09/99909/2
authorminsoo kim <ms203.kim@samsung.com>
Thu, 6 Oct 2016 07:09:30 +0000 (16:09 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Wed, 30 Nov 2016 13:04:29 +0000 (22:04 +0900)
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 <ms203.kim@samsung.com>
src/server/dbus_util.cpp
src/server/dbus_util.h

index c29b61d..0aa0b90 100755 (executable)
@@ -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[] =
 "       <method name='wristup_total_cnt'>"
 "         <arg type='i' name='response' direction='out'/>"
 "       </method>"
+"       <method name='wristup_algo'>"
+"         <arg type='i' name='response' direction='out'/>"
+"       </method>"
 "  </interface>"
 "</node>";
 
@@ -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
index ce4ad54..f729e3b 100644 (file)
@@ -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);