#define LOG_TAG "GESTURE_CLIENT_DBUS"
static int is_server_started = 0;
-static hand_gesture_recognition_cb g_callback;
-static hand_gesture_data_h g_gesture_data;
static hand_gesture_handtype_e g_hand_type = HAND_GESTURE_LEFT_HAND;
static hand_gesture_workmode_e g_work_mode = HAND_GESTURE_WORK_MODE_ONE_WAY;
static char *g_engine_app_id;
static char *g_engine_name;
-static void _free_gesture_data(hand_gesture_data_h gesture_data)
-{
- free(gesture_data);
- gesture_data = NULL;
-}
-
static void _server_appeared_cb(GDBusConnection *connection, const gchar *name, const gchar *name_owner, gpointer user_data)
{
LOGD("name : %s, name_owner : %s", name, name_owner);
g_free(printmsg);
LOGD("[event = %d] [gesture_type = %d] [ltype = %d] [levent = %d] [lcount = %d]", event, gesture_type, ltype, levent, lcount);
#endif
- if (g_gesture_data == NULL){
- LOGD("Can't send the result to Client because g_gesture_data is NULL");
- return;
- }
- LOGD("address = %p", g_gesture_data);
- g_gesture_data->gesture_type = ltype;
- g_gesture_data->event = levent;
- g_gesture_data->detected_Count = lcount;
-
-// g_callback(gesture_type, g_gesture_data, 0, HAND_GESTURE_ERROR_NONE, user_data);
if (_handle->recog_cb) {
LOGD("[CLIENT DBUS] Send recognition result. gesture_type(%d)", gesture_type);
_handle->recog_cb(_handle, gesture_type, 0, HAND_GESTURE_ERROR_NONE, _handle->recog_user_data);
{
LOGD("gesture_client_dbus_start_recognition start");
LOGD("client busname: %s", g_dbus_connection_get_unique_name(gdbus_connection));
- g_callback = callback;
- g_gesture_data = gesture_data;
GVariant *body = NULL;
body = g_variant_new("(iiiii)", gesture_type, g_hand_type, g_work_mode, g_option, g_sensitivity);
GDBusMessage *reply = NULL;
GVariant *body = NULL;
- /* free for gesture data struct */
- _free_gesture_data(g_gesture_data);
-
body = g_variant_new("()");
ret = gdbus_send_message_with_sync(gdbus_connection, body, &reply, GESTURE_CLIENT_MSG_STOP_RECOGNITION);
if (ret != HAND_GESTURE_ERROR_NONE)
body = g_variant_new("(i)", 100);
ret = gdbus_send_message_with_async(gdbus_connection, body, GESTURE_ENGINE_MSG_MAIN_START);
-#if 0
- GError *err = NULL;
- if (!g_dbus_connection_emit_signal(gdbus_connection,
- GESTURE_DBUS_NAME,
- GESTURE_OBJECT_PATH,
- GESTURE_INTERFACE_NAME,
- "psw_test",
- body,
- &err)) {
- if (err != NULL) {
- LOGE("Failed to send dbus message : %s", err->message);
- g_error_free(err);
- }
- return GESTURE_ENGINE_ERROR_NONE;
- }
-
- GDBusProxy *ap;
- g_dbus_proxy_new (gdbus_connection,
- G_DBUS_PROXY_FLAGS_NONE,
- NULL,
- GESTURE_DBUS_NAME, /* name */
- GESTURE_OBJECT_PATH, /* object path */
- GESTURE_INTERFACE_NAME, /* interface name */
- NULL, /* GCancellable */
- (GAsyncReadyCallback) proxy_new_cb,
- &ap);
-#endif
if (body)
g_variant_unref(body);
LOGD("[GESTURE_ENGINE_MSG_SEND_ENGINE_GET_INFO] called");
ret = gestured_engine_send_engine_get_info(parameters, &reply_body, sender);
}
- else if (g_strcmp0(method_name, "psw_test") == 0) {
- LOGD("[psw_test] called");
- }
if (ret == GESTURED_ERROR_NONE) {
LOGD("method_call successful, method_name : %s", method_name);
" <arg type='s' name='engine_name' direction='in'/>"
" </method>"
- " <method name='psw_test'>"
- " </method>"
- " <signal name='psw_test'/>"
" </interface>"
" </node>";