/*
-* 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
#ifndef __STTD_MAIN_H_
#define __STTD_MAIN_H_
+#include <dlog.h>
+#include <errno.h>
+#include <glib.h>
#include <stdio.h>
-#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
+#include <tizen.h>
#include <unistd.h>
-#include <glib.h>
-#include <dlog.h>
-#include <errno.h>
+
#ifdef __cplusplus
extern "C" {
#define TAG_STTD "sttd"
-#define BASE_DIRECTORY_DEFAULT "/usr/lib/voice/stt/1.0/"
-#define ENGINE_DIRECTORY_DEFAULT "/usr/lib/voice/stt/1.0/engine"
-#define ENGINE_DIRECTORY_DEFAULT_SETTING "/usr/lib/voice/stt/1.0/setting"
-
-#define CONFIG_DIRECTORY "/opt/home/app/.voice"
-
-#define ENGINE_DIRECTORY_DOWNLOAD "/opt/usr/voice/stt/1.0/engine"
-#define ENGINE_DIRECTORY_DOWNLOAD_SETTING "/opt/usr/voice/stt/1.0/setting"
-
/* for debug message */
-#define RECORDER_DEBUG
-#define CLIENT_DATA_DEBUG
+//#define CLIENT_DATA_DEBUG
typedef enum {
- STTD_ERROR_NONE = 0, /**< Successful */
- STTD_ERROR_OUT_OF_MEMORY = -ENOMEM, /**< Out of Memory */
- STTD_ERROR_IO_ERROR = -EIO, /**< I/O error */
- STTD_ERROR_INVALID_PARAMETER = -EINVAL, /**< Invalid parameter */
- STTD_ERROR_TIMED_OUT = -ETIMEDOUT, /**< No answer from the daemon */
- STTD_ERROR_RECORDER_BUSY = -EBUSY, /**< Busy recorder */
- STTD_ERROR_OUT_OF_NETWORK = -ENETDOWN, /**< Out of network */
- STTD_ERROR_INVALID_STATE = -0x0100000 | 0x31, /**< Invalid state */
- STTD_ERROR_INVALID_LANGUAGE = -0x0100000 | 0x32, /**< Invalid language */
- STTD_ERROR_ENGINE_NOT_FOUND = -0x0100000 | 0x33, /**< No available engine */
- STTD_ERROR_OPERATION_FAILED = -0x0100000 | 0x34, /**< Operation failed */
- STTD_ERROR_NOT_SUPPORTED_FEATURE= -0x0100000 | 0x35 /**< Not supported feature of current engine */
-}stt_error_e;
+ STTD_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ STTD_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of Memory */
+ STTD_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
+ STTD_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
+ STTD_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< No answer from the STT service */
+ STTD_ERROR_RECORDER_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Device or resource busy */
+ STTD_ERROR_OUT_OF_NETWORK = TIZEN_ERROR_NETWORK_DOWN, /**< Network is down */
+ STTD_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
+ STTD_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< STT NOT supported */
+ STTD_ERROR_INVALID_STATE = TIZEN_ERROR_STT | 0x01, /**< Invalid state */
+ STTD_ERROR_INVALID_LANGUAGE = TIZEN_ERROR_STT | 0x02, /**< Invalid language */
+ STTD_ERROR_ENGINE_NOT_FOUND = TIZEN_ERROR_STT | 0x03, /**< No available engine */
+ STTD_ERROR_OPERATION_FAILED = TIZEN_ERROR_STT | 0x04, /**< Operation failed */
+ STTD_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_STT | 0x05, /**< Not supported feature of current engine */
+ STTD_ERROR_NO_SPEECH = TIZEN_ERROR_STT | 0x06, /**< No speech while recording */
+ STTD_ERROR_RECORDING_TIMED_OUT = TIZEN_ERROR_STT | 0x10, /**< Recording timed out */
+ STTD_ERROR_SERVICE_RESET = TIZEN_ERROR_STT | 0x11 /**< Service reset */
+} stt_error_e;
+
+typedef enum {
+ STTD_RESULT_STATE_DONE = 0, /**< Sync state change */
+ STTD_RESULT_STATE_NOT_DONE = 1 /**< Async state change */
+} sttd_result_state_e;
typedef struct {
char* engine_id;
char* engine_name;
char* ug_name;
-}engine_s;
-
-typedef struct {
- char* key;
- char* value;
-}engine_setting_s;
+} engine_s;
#ifdef __cplusplus
}