#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)