*
*/
-#include <common.h>
+#include <sensor_log.h>
#include <dbus_util.h>
#include <gio/gio.h>
-#define SENSORD_BUS_NAME "org.tizen.system.sensord"
-#define SENSORD_OBJECT_PATH "/Org/Tizen/System/SensorD"
-#define SENSORD_INTERFACE_NAME SENSORD_BUS_NAME
+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;
" <method name='check_privilege'>"
" <arg type='i' name='response' direction='out'/>"
" </method>"
+" <method name='wristup_lcdon_cnt'>"
+" <arg type='i' name='response' direction='out'/>"
+" </method>"
+" <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>";
if (g_strcmp0(method_name, "check_privilege") == 0) {
_D("check_privilege called");
ret = DBUS_SUCCESS;
+ } else if (g_strcmp0(method_name, "wristup_lcdon_cnt") == 0) {
+ _D("wristup_lcdon_cnt called, %d", wrist_up_lcdon_cnt);
+ ret = wrist_up_lcdon_cnt;
+ } 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;
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(i)", ret));
-
}
static const GDBusInterfaceVTable interface_vtable =
NULL
};
-static void on_bus_acquired (GDBusConnection *connection,
- const gchar *name,
- gpointer user_data)
+static void on_bus_acquired(GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
{
guint registration_id;
_E("Dbus name is lost!");
}
-void init_dbus(void)
+int get_lcdon_count(void)
{
+ return wrist_up_lcdon_cnt;
+}
+
+void increase_lcdon_count(void)
+{
+ wrist_up_lcdon_cnt++;
+}
+
+void reset_lcdon_count(void)
+{
+ wrist_up_lcdon_cnt = 0;
+}
- #ifndef GLIB_VERSION_2_36
+int get_total_count(void)
+{
+ return wrist_up_total_cnt;
+}
+
+void increase_total_count(void)
+{
+ wrist_up_total_cnt++;
+}
+
+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
g_type_init();
- #endif
+#endif
introspection_data = g_dbus_node_info_new_for_xml(introspection_xml, NULL);
if (introspection_data == NULL) {
on_name_lost,
NULL,
NULL);
+ wrist_up_total_cnt = 0;
+ wrist_up_lcdon_cnt = 0;
}
void fini_dbus(void)