2 * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd All Rights Reserved
\r
4 * Licensed under the Apache License, Version 2.0 (the License);
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an AS IS BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
18 #include "vcd_dbus.h"
\r
19 #include "vcd_main.h"
\r
20 #include "vcd_server.h"
\r
22 #define CLIENT_CLEAN_UP_TIME 500
\r
24 static Ecore_Timer* g_check_client_timer = NULL;
\r
26 int main(int argc, char** argv)
\r
28 SLOG(LOG_DEBUG, TAG_VCD, "@@@ VC Daemon Initialize");
\r
30 if (!ecore_init()) {
\r
31 SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail ecore_init()");
\r
35 if (0 != vcd_dbus_open_connection()) {
\r
36 SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to open connection");
\r
38 return EXIT_FAILURE;
\r
41 if (0 != vcd_initialize()) {
\r
42 SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to initialize vc-daemon");
\r
44 return EXIT_FAILURE;
\r
47 g_check_client_timer = ecore_timer_add(CLIENT_CLEAN_UP_TIME, vcd_cleanup_client_all, NULL);
\r
48 if (NULL == g_check_client_timer) {
\r
49 SLOG(LOG_WARN, TAG_VCD, "[Main Warning] Fail to create timer of client check");
\r
52 SLOG(LOG_DEBUG, TAG_VCD, "[Main] vc-daemon start");
\r
54 SLOG(LOG_DEBUG, TAG_VCD, "@@@");
\r
56 ecore_main_loop_begin();
\r
58 SLOG(LOG_DEBUG, TAG_VCD, "@@@ VC Daemon Finalize");
\r
60 if (NULL != g_check_client_timer) {
\r
61 ecore_timer_del(g_check_client_timer);
\r
66 vcd_dbus_close_connection();
\r
70 SLOG(LOG_DEBUG, TAG_VCD, "@@@");
\r