/*
-* Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd All Rights Reserved
+* Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
#define CLIENT_CLEAN_UP_TIME 500
-char* get_tag()
+static Ecore_Timer* g_check_client_timer = NULL;
+
+const char* tts_tag()
{
return "ttsd";
}
{
return TTSD_MODE_DEFAULT;
}
-
-/* Main of TTS Daemon */
-int main()
-{
- SLOG(LOG_DEBUG, get_tag(), " ");
- SLOG(LOG_DEBUG, get_tag(), " ");
- SLOG(LOG_DEBUG, get_tag(), "===== TTS DAEMON DEFAULT INITIALIZE");
- if (!ecore_init()) {
- SLOG(LOG_ERROR, get_tag(), "[Main ERROR] fail ecore_init() \n");
- return -1;
- }
-
- if (0 != ttsd_initialize()) {
- printf("Fail to initialize tts-daemon \n");
- SLOG(LOG_ERROR, get_tag(), "[Main ERROR] fail to initialize tts-daemon");
- return EXIT_FAILURE;
- }
-
- if (0 != ttsd_dbus_open_connection()) {
- printf("Fail to initialize IPC connection \n");
- SLOG(LOG_ERROR, get_tag(), "[Main ERROR] fail to open dbus connection");
- return EXIT_FAILURE;
- }
-
- if (0 != ttsd_network_initialize()) {
- SLOG(LOG_ERROR, get_tag(), "[Main ERROR] fail to initialize network");
- return EXIT_FAILURE;
- }
-
- ecore_timer_add(CLIENT_CLEAN_UP_TIME, ttsd_cleanup_client, NULL);
-
- SLOG(LOG_DEBUG, get_tag(), "[Main] tts-daemon start...\n");
- SLOG(LOG_DEBUG, get_tag(), "=====");
- SLOG(LOG_DEBUG, get_tag(), " ");
- SLOG(LOG_DEBUG, get_tag(), " ");
-
- printf("Start tts-daemon ...\n");
-
- ecore_main_loop_begin();
-
- SLOG(LOG_DEBUG, get_tag(), "===== TTS DAEMON DEFAULT FINALIZE");
-
- ttsd_network_finalize();
-
- ttsd_dbus_close_connection();
-
- ttsd_finalize();
-
- ecore_shutdown();
-
- SLOG(LOG_DEBUG, get_tag(), "=====");
- SLOG(LOG_DEBUG, get_tag(), " ");
- SLOG(LOG_DEBUG, get_tag(), " ");
-
- return 0;
-}
-