2 * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
7 * Unless required by applicable law or agreed to in writing, software
8 * distributed under the License is distributed on an "AS IS" BASIS,
9 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 * See the License for the specific language governing permissions and
11 * limitations under the License.
17 #include "stt_network.h"
18 #include "sttd_dbus.h"
19 #include "sttd_main.h"
20 #include "sttd_server.h"
23 #define CLIENT_CLEAN_UP_TIME 500
25 static Ecore_Timer* g_check_client_timer = NULL;
27 int main(int argc, char** argv)
29 SLOG(LOG_DEBUG, TAG_STTD, " ");
30 SLOG(LOG_DEBUG, TAG_STTD, " ");
31 SLOG(LOG_DEBUG, TAG_STTD, "===== STT Daemon Initialize");
34 SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to initialize Ecore");
38 if (0 != sttd_dbus_open_connection()) {
39 SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to open connection");
43 if (0 != sttd_initialize()) {
44 SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to initialize stt-daemon");
48 stt_network_initialize();
50 g_check_client_timer = ecore_timer_add(CLIENT_CLEAN_UP_TIME, sttd_cleanup_client, NULL);
51 if (NULL == g_check_client_timer) {
52 SLOG(LOG_WARN, TAG_STTD, "[Main Warning] Fail to create timer of client check");
55 SLOG(LOG_DEBUG, TAG_STTD, "[Main] stt-daemon start...");
57 SLOG(LOG_DEBUG, TAG_STTD, "=====");
58 SLOG(LOG_DEBUG, TAG_STTD, " ");
59 SLOG(LOG_DEBUG, TAG_STTD, " ");
61 ecore_main_loop_begin();
63 SLOG(LOG_DEBUG, TAG_STTD, "===== STT Daemon Finalize");
65 if (NULL != g_check_client_timer) {
66 ecore_timer_del(g_check_client_timer);
69 stt_network_finalize();
75 SLOG(LOG_DEBUG, TAG_STTD, "=====");
76 SLOG(LOG_DEBUG, TAG_STTD, " ");
77 SLOG(LOG_DEBUG, TAG_STTD, " ");