#ifndef __MESSAGE_H__
#define __MESSAGE_H__
-bool message_sink_init(message_port_message_cb callback, void *user_data);
-void message_sink_shutdown(void);
bool send_message(const char *cmd, const char *data);
#endif /* __MESSAGE_H__ */
#define EVENT_NAME "event.org.tizen.sticker-receiver.user_event"
-static int port_id = -1;
-
-bool message_sink_init(message_port_message_cb callback, void *user_data)
-{
- port_id = message_port_register_local_port(MESSAGE_PORT_REMOTE_NAME, callback, user_data);
- if (port_id < 0)
- {
- LOGW("Function message_port_register_local_port() failed.");
- return false;
- }
-
- return true;
-}
-
-void message_sink_shutdown(void)
-{
- int ret;
- bool exists = false;
-
- port_id = -1;
-
- ret = message_port_check_remote_port(REMOTE_APP_ID, MESSAGE_PORT_REMOTE_NAME, &exists);
- if (exists)
- {
- ret = message_port_unregister_local_port(port_id);
- if (ret != MESSAGE_PORT_ERROR_NONE)
- LOGE("Function message_port_unregister_local_port() failed.");
- }
- else if (ret != MESSAGE_PORT_ERROR_NONE)
- {
- LOGE("Function message_port_check_remote_port() failed.");
- }
-}
-
bool send_message(const char *cmd, const char *data)
{
bool result = false;