Add ttse_terminate
[platform/core/uifw/tts.git] / server / ttse.c
index 0e8ee96..0f40802 100755 (executable)
@@ -23,6 +23,7 @@
 #include <Ecore.h>
 
 #include "ttse.h"
+#include "ttse_internal.h"
 
 static ttsd_mode_e g_tts_mode = TTSD_MODE_DEFAULT;
 
@@ -32,6 +33,8 @@ const char* tts_tag()
                return "ttsdnoti";
        } else if (TTSD_MODE_SCREEN_READER == g_tts_mode) {
                return "ttsdsr";
+       } else if (TTSD_MODE_INTERRUPT == g_tts_mode) {
+               return "ttsdinterrupt";
        } else {
                return "ttsd";
        }
@@ -63,6 +66,8 @@ int ttse_main(int argc, char** argv, ttse_request_callback_s *callback)
                                        mode = TTSD_MODE_NOTIFICATION;
                                } else if (!strcmp("sr", val)) {
                                        mode = TTSD_MODE_SCREEN_READER;
+                               } else if (!strcmp("interrupt", val)) {
+                                       mode = TTSD_MODE_INTERRUPT;
                                } else {
                                        SLOG(LOG_WARN, tts_tag(), "[WARNING] mode (%s)", val);
                                }
@@ -110,6 +115,13 @@ int ttse_main(int argc, char** argv, ttse_request_callback_s *callback)
        return TTSE_ERROR_NONE;
 }
 
+int ttse_terminate()
+{
+       ttsd_terminate();
+
+       return TTSE_ERROR_NONE;
+}
+
 int ttse_get_speed_range(int* min, int* normal, int* max)
 {
        if (NULL == min || NULL == normal || NULL == max) {
@@ -159,11 +171,6 @@ int ttse_send_error(ttse_error_e error, const char* msg)
 {
        int ret;
 
-       if (NULL == msg) {
-               SLOG(LOG_ERROR, tts_tag(), "[ERROR] Input parameter is null");
-               return TTSE_ERROR_INVALID_PARAMETER;
-       }
-
        ret = ttsd_send_error(error, msg);
 
        if (0 != ret) {