/*
-* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
+* Copyright © 2021 Samsung Electronics co., Ltd. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
static int _connected = 0;
static mmi_state _state = MMI_STATE_NONE;
+rpc_port_mmifw_focus_event_cb_h focus_cb_h;
+rpc_port_mmifw_state_change_event_cb_h state_change_cb_h;
+rpc_port_mmifw_wakeup_event_cb_h wakeup_cb_h;
+rpc_port_mmifw_key_event_cb_h key_cb_h;
+rpc_port_mmifw_gesture_event_cb_h gesture_cb_h;
+rpc_port_mmifw_voice_event_cb_h voice_cb_h;
+rpc_port_mmifw_action_event_cb_h action_cb_h;
+rpc_port_mmifw_feedback_event_cb_h feedback_cb_h;
+
rpc_port_proxy_mmifw_h
mmi_ipc_get_rpc_h(void)
{
return _stub_appid;
}
+/* event callbacks */
+static void _focus_event_cb(void *user_data, rpc_port_focus_event_h args)
+{
+ //TODO : create event
+}
+
+static void _state_change_event_cb(void *user_data, rpc_port_state_change_event_h args)
+{
+ //TODO : create event
+}
+
+static void _wakeup_event_cb(void *user_data, rpc_port_wakeup_event_h args)
+{
+ //TODO : create event
+}
+
+static void _key_event_cb(void *user_data, rpc_port_key_event_h args)
+{
+ //TODO : create event
+}
+
+static void _gesture_event_cb(void *user_data, rpc_port_gesture_event_h args)
+{
+ //TODO : create event
+}
+
+static void _voice_event_cb(void *user_data, rpc_port_voice_event_h args)
+{
+ //TODO : create event
+}
+
+static void _action_event_cb(void *user_data, rpc_port_action_event_h args)
+{
+ //TODO : create event
+}
+
+static void _feedback_event_cb(void *user_data, rpc_port_feedback_event_h args)
+{
+ //TODO : create event
+}
+
static void _on_connected(rpc_port_proxy_mmifw_h h, void *user_data)
{
int r;
LOGI("...");
_connected = 1;
+
+ focus_cb_h = rpc_port_mmifw_focus_event_cb_create(_focus_event_cb, false, NULL);
+ state_change_cb_h = rpc_port_mmifw_state_change_event_cb_create(_state_change_event_cb, false, NULL);
+ wakeup_cb_h = rpc_port_mmifw_wakeup_event_cb_create(_wakeup_event_cb, false, NULL);
+ key_cb_h = rpc_port_mmifw_key_event_cb_create(_key_event_cb, false, NULL);
+ gesture_cb_h = rpc_port_mmifw_gesture_event_cb_create(_gesture_event_cb, false, NULL);
+ voice_cb_h = rpc_port_mmifw_voice_event_cb_create(_voice_event_cb, false, NULL);
+ action_cb_h = rpc_port_mmifw_action_event_cb_create(_action_event_cb, false, NULL);
+ feedback_cb_h = rpc_port_mmifw_feedback_event_cb_create(_feedback_event_cb, false, NULL);
+
+ if (!focus_cb_h || !state_change_cb_h || !wakeup_cb_h || !key_cb_h
+ || !gesture_cb_h || !voice_cb_h || !action_cb_h || !feedback_cb_h)
+ {
+ LOGE("Failed to create event callbacks !");
+ //TODO: Disconnect by destroying rpc_port_proxy_mmifw_h
+ return;
+ }
+
+ r = rpc_port_proxy_mmifw_invoke_register_cb(h, focus_cb_h, state_change_cb_h, wakeup_cb_h,
+ key_cb_h, gesture_cb_h, voice_cb_h, action_cb_h, feedback_cb_h);
+ if (r != RPC_PORT_ERROR_NONE)
+ {
+ LOGE("Failed to register event callbacks !\n");
+ //TODO: Disconnect by destroying rpc_port_proxy_mmifw_h
+ return;
+ }
}
static void _on_disconnected(rpc_port_proxy_mmifw_h h, void *user_data)
{
/* initialize handles */
_rpc_h = NULL;
+ focus_cb_h = NULL;
+ state_change_cb_h = NULL;
+ wakeup_cb_h = NULL;
+ key_cb_h = NULL;
+ gesture_cb_h = NULL;
+ voice_cb_h = NULL;
+ action_cb_h = NULL;
+ feedback_cb_h = NULL;
_uid = tzplatform_getuid(TZ_SYS_DEFAULT_USER);
LOGI("uid=%d\n", _uid);
void
mmi_ipc_shutdown(void)
{
+ rpc_port_mmifw_focus_event_cb_destroy(focus_cb_h);
+ rpc_port_mmifw_state_change_event_cb_destroy(state_change_cb_h);
+ rpc_port_mmifw_wakeup_event_cb_destroy(wakeup_cb_h);
+ rpc_port_mmifw_key_event_cb_destroy(key_cb_h);
+ rpc_port_mmifw_gesture_event_cb_destroy(gesture_cb_h);
+ rpc_port_mmifw_voice_event_cb_destroy(voice_cb_h);
+ rpc_port_mmifw_action_event_cb_destroy(action_cb_h);
+ rpc_port_mmifw_feedback_event_cb_destroy(feedback_cb_h);
+ focus_cb_h = NULL;
+ state_change_cb_h = NULL;
+ wakeup_cb_h = NULL;
+ key_cb_h = NULL;
+ gesture_cb_h = NULL;
+ voice_cb_h = NULL;
+ action_cb_h = NULL;
+ feedback_cb_h = NULL;
+
rpc_port_proxy_mmifw_destroy(_rpc_h);
_rpc_h = NULL;
}