1 /* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
\r
3 * PROPRIETARY/CONFIDENTIAL
\r
5 * This software is the confidential and proprietary information of SAMSUNG
\r
6 * ELECTRONICS ("Confidential Information"). You agree and acknowledge that
\r
7 * this software is owned by Samsung and you shall not disclose such
\r
8 * Confidential Information and shall use it only in accordance with the terms
\r
9 * of the license agreement you entered into with SAMSUNG ELECTRONICS.
\r
10 * SAMSUNG make no representations or warranties about the suitability of the
\r
11 * software, either express or implied, including but not limited to the
\r
12 * implied warranties of merchantability, fitness for a particular purpose,
\r
13 * or non-infringement. SAMSUNG shall not be liable for any damages suffered
\r
14 * by licensee arising out of or releated to this software.
\r
18 #include "email-ipc-build.h"
\r
19 #include "email-ipc.h"
\r
20 #include "email-ipc-api-info.h"
\r
21 #include "email-ipc-param-list.h"
\r
22 #include "email-ipc-socket.h"
\r
23 #include "email-proxy-main.h"
\r
25 #include "email-debug-log.h"
\r
26 #include "email-api.h"
\r
27 #include "email-types.h"
\r
29 EXPORT_API int emipc_initialize_proxy()
\r
31 EM_DEBUG_FUNC_BEGIN();
\r
33 int err = emipc_initialize_proxy_main();
\r
35 EM_DEBUG_FUNC_END();
\r
39 EXPORT_API int emipc_finalize_proxy()
\r
41 EM_DEBUG_FUNC_BEGIN();
\r
42 return emipc_finalize_proxy_main();
\r
45 EXPORT_API bool emipc_execute_proxy_api(HIPC_API api)
\r
47 EM_DEBUG_FUNC_BEGIN();
\r
49 int err = EMF_ERROR_NONE;
\r
50 emipc_email_api_info *api_info = (emipc_email_api_info *)api;
\r
52 EM_DEBUG_LOG("API [%p]", api_info);
\r
54 if(api_info == NULL) {
\r
55 EM_DEBUG_EXCEPTION("EMF_ERROR_INVALID_PARAM");
\r
56 return EMF_ERROR_INVALID_PARAM;
\r
59 EM_DEBUG_LOG("APIID [%s], ResponseID [%d], APPID[%d]", EM_APIID_TO_STR(emipc_get_api_id_of_api_info(api_info)), emipc_get_response_id_of_api_info(api_info), emipc_get_app_id_of_api_info(api_info));
\r
61 ret = emipc_execute_api_of_proxy_main(api_info);
\r
63 /* connection retry */
\r
65 emipc_finalize_proxy();
\r
67 err = emipc_initialize_proxy();
\r
68 if (err != EMF_ERROR_NONE) {
\r
69 EM_DEBUG_EXCEPTION("Failed to open the socket : [%d]", err);
\r
70 return EMF_ERROR_CONNECTION_FAILURE;
\r
73 ret = emipc_execute_api_of_proxy_main(api_info);
\r
75 EM_DEBUG_EXCEPTION("emipc_proxy_main : emipc_execute_api failed [%d]", err);
\r
76 return EMF_ERROR_CONNECTION_FAILURE;
\r
79 EM_DEBUG_FUNC_END("err [%d]", err);
\r