-# Copyright (c) 2011-2014 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.
/*
-* Copyright (c) 2011-2014 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
SLOG(LOG_DEBUG, TAG_STTC, "===== Set credential");
if (NULL == credential) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL, stt(%s), credential(%a)", stt, credential);
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Input parameter is NULL");
return STT_ERROR_INVALID_PARAMETER;
}
return STT_ERROR_INVALID_STATE;
}
- if (STT_INTERNAL_STATE_NONE != client->internal_state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is NOT none : %d", client->internal_state);
+ if (STT_INTERNAL_STATE_STARTING == client->internal_state) {
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STARTING : %d", client->internal_state);
+ return STT_ERROR_IN_PROGRESS_TO_RECORDING;
+ } else if (STT_INTERNAL_STATE_CANCELING == client->internal_state) {
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is CANCELING : %d", client->internal_state);
+ return STT_ERROR_IN_PROGRESS_TO_READY;
+ } else if (STT_INTERNAL_STATE_STOPPING == client->internal_state) {
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STOPPING : %d", client->internal_state);
return STT_ERROR_IN_PROGRESS_TO_PROCESSING;
}
SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to stop : %s", __stt_get_error_code(ret));
} else {
SLOG(LOG_DEBUG, TAG_STTC, "[SUCCESS] Stop is successful but not done");
- client->internal_state = STT_INTERNAL_STATE_STOPING;
+ client->internal_state = STT_INTERNAL_STATE_STOPPING;
}
SLOG(LOG_DEBUG, TAG_STTC, "=====");
return STT_ERROR_INVALID_STATE;
}
- if (STT_INTERNAL_STATE_NONE != client->internal_state) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is NOT none : %d", client->internal_state);
+ if (STT_INTERNAL_STATE_STARTING == client->internal_state) {
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STARTING : %d", client->internal_state);
+ return STT_ERROR_IN_PROGRESS_TO_RECORDING;
+ } else if (STT_INTERNAL_STATE_STOPPING == client->internal_state) {
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is STOPPING : %d", client->internal_state);
+ return STT_ERROR_IN_PROGRESS_TO_PROCESSING;
+ } else if (STT_INTERNAL_STATE_CANCELING == client->internal_state) {
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Invalid State : Internal state is CANCELING : %d", client->internal_state);
return STT_ERROR_IN_PROGRESS_TO_READY;
}
if (STT_INTERNAL_STATE_STARTING == client->internal_state && STT_STATE_RECORDING == client->current_state) {
client->internal_state = STT_INTERNAL_STATE_NONE;
SLOG(LOG_DEBUG, TAG_STTC, "Internal state change to NONE");
- } else if (STT_INTERNAL_STATE_STOPING == client->internal_state && STT_STATE_PROCESSING == client->current_state) {
+ } else if (STT_INTERNAL_STATE_STOPPING == client->internal_state && STT_STATE_PROCESSING == client->current_state) {
client->internal_state = STT_INTERNAL_STATE_NONE;
SLOG(LOG_DEBUG, TAG_STTC, "Internal state change to NONE");
} else if (STT_INTERNAL_STATE_CANCELING == client->internal_state && STT_STATE_READY == client->current_state) {
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
typedef enum {
STT_INTERNAL_STATE_NONE = 0,
STT_INTERNAL_STATE_STARTING = 1,
- STT_INTERNAL_STATE_STOPING = 2,
+ STT_INTERNAL_STATE_STOPPING = 2,
STT_INTERNAL_STATE_CANCELING = 3
} stt_internal_state_e;
/*
-* Copyright (c) 2011-2014 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
dbus_error_init(&err);
/* connect to the DBUS system bus, and check for errors */
- g_conn_sender = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Dbus Connection Error (%s)", err.message);
- dbus_error_free(&err);
+ if (NULL == g_conn_sender) {
+ g_conn_sender = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
+ if (dbus_error_is_set(&err)) {
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Dbus Connection Error (%s)", err.message);
+ dbus_error_free(&err);
+ }
}
if (NULL == g_conn_sender) {
dbus_connection_set_exit_on_disconnect(g_conn_sender, false);
/* connect to the DBUS system bus, and check for errors */
- g_conn_listener = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
-
- if (dbus_error_is_set(&err)) {
- SLOG(LOG_ERROR, TAG_STTC, "Dbus Connection Error (%s)", err.message);
- dbus_error_free(&err);
+ if (NULL == g_conn_listener) {
+ g_conn_listener = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
+ if (dbus_error_is_set(&err)) {
+ SLOG(LOG_ERROR, TAG_STTC, "Dbus Connection Error (%s)", err.message);
+ dbus_error_free(&err);
+ }
}
if (NULL == g_conn_listener) {
dbus_connection_close(g_conn_sender);
dbus_connection_close(g_conn_listener);
+ dbus_connection_unref(g_conn_sender);
+ dbus_connection_unref(g_conn_listener);
+
g_conn_sender = NULL;
g_conn_listener = NULL;
DBusMessage* msg;
msg = dbus_message_new_method_call(
- STT_SERVER_SERVICE_NAME,
- STT_SERVER_SERVICE_OBJECT_PATH,
- STT_SERVER_SERVICE_INTERFACE,
+ STT_SERVER_SERVICE_NAME,
+ STT_SERVER_SERVICE_OBJECT_PATH,
+ STT_SERVER_SERVICE_INTERFACE,
STT_METHOD_SET_PRIVATE_DATA);
if (NULL == msg) {
DBusMessage* msg;
msg = dbus_message_new_method_call(
- STT_SERVER_SERVICE_NAME,
- STT_SERVER_SERVICE_OBJECT_PATH,
- STT_SERVER_SERVICE_INTERFACE,
+ STT_SERVER_SERVICE_NAME,
+ STT_SERVER_SERVICE_OBJECT_PATH,
+ STT_SERVER_SERVICE_INTERFACE,
STT_METHOD_GET_PRIVATE_DATA);
if (NULL == msg) {
SLOG(LOG_DEBUG, TAG_STTC, "<<<< stt get private data : result = %d", result);
if (NULL != temp) {
*data = strdup(temp);
- free(temp);
- temp = NULL;
}
} else {
SLOG(LOG_ERROR, TAG_STTC, "<<<< stt get private data : result = %d", result);
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/* Default language is STT_BASE_LANGUAGE */
if (0 == strcmp(STT_BASE_LANGUAGE, engine_lang)) {
*language = strdup(engine_lang);
- SLOG(LOG_DEBUG, stt_tag(), "Selected language : %s", *language);
+ SLOG(LOG_DEBUG, stt_tag(), "Selected language : %s", (NULL == *language) ? "NULL" : *language);
return 0;
}
}
/* Not support STT_BASE_LANGUAGE */
if (NULL != engine_lang) {
*language = strdup(engine_lang);
- SLOG(LOG_DEBUG, stt_tag(), "Selected language : %s", *language);
+ SLOG(LOG_DEBUG, stt_tag(), "Selected language : %s", (NULL == *language) ? "NULL" : *language);
return 0;
}
}
/*Get handle data from list*/
lang = iter_lang->data;
- SLOG(LOG_DEBUG, stt_tag(), " %s", lang);
if (NULL != lang) {
+ SLOG(LOG_DEBUG, stt_tag(), " %s", lang);
if (false == callback(engine_info->uuid, lang, user_data))
break;
}
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
ret = engine->pefuncs->initialize(result_cb, silence_cb);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to initialize : %s", __stt_get_engine_error_code(ret));
- return ret;
}
- return 0;
+ return ret;
}
int stt_engine_deinitialize(int engine_id)
SLOG(LOG_WARN, stt_tag(), "[Engine WARNING] Fail to deinitialize : %s", __stt_get_engine_error_code(ret));
}
- return 0;
+ return ret;
}
static bool __supported_language_cb(const char* language, void* user_data)
ret = engine->pefuncs->foreach_langs(__supported_language_cb, (void*)lang_list);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] get language list error : %s", __stt_get_engine_error_code(ret));
- return ret;
}
- return 0;
+ return ret;
}
int stt_engine_is_valid_language(int engine_id, const char* language, bool *is_valid)
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to set private data(%d)", ret);
}
- return STTP_ERROR_NONE;
+ return ret;
}
int stt_engine_get_private_data(int engine_id, const char* key, char** data)
char* temp = NULL;
int ret = engine->pefuncs->get_private_data(key, &temp);
if (0 != ret) {
- SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to set private data(%d)", ret);
+ SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to get private data(%d)", ret);
+ return ret;
}
*data = strdup(temp);
ret = engine->pefuncs->get_audio_format(types, rate, channels);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to get audio format : %s", __stt_get_engine_error_code(ret));
- return ret;
}
- return 0;
+ return ret;
}
/* Set option */
return STTP_ERROR_NOT_SUPPORTED_FEATURE;
} else if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to set silence detection : %d", ret);
- return ret;
}
- return 0;
+ return ret;
}
int stt_engine_check_app_agreed(int engine_id, const char* appid, bool* value)
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to get app agreement : %s", __stt_get_engine_error_code(ret));
*value = false;
- return ret;
}
- return 0;
+ return ret;
}
/* Recognition */
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start recognition : %s", __stt_get_engine_error_code(ret));
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start recognition : lang(%s), recognition_type(%s), credential(%s)", lang, recognition_type, credential);
- return ret;
}
- return 0;
+ return ret;
}
int stt_engine_set_recording_data(int engine_id, const void* data, unsigned int length)
int ret = engine->pefuncs->set_recording(data, length);
if (0 != ret) {
SLOG(LOG_WARN, stt_tag(), "[Engine WARNING] Fail to set recording : %s", __stt_get_engine_error_code(ret));
- return ret;
}
- return 0;
+ return ret;
}
int stt_engine_recognize_stop(int engine_id)
int ret = engine->pefuncs->stop();
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to stop : %s", __stt_get_engine_error_code(ret));
- return ret;
}
- return 0;
+ return ret;
}
int stt_engine_recognize_cancel(int engine_id)
int ret = engine->pefuncs->cancel();
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to cancel : %s", __stt_get_engine_error_code(ret));
- return ret;
}
- return 0;
+ return ret;
}
int stt_engine_foreach_result_time(int engine_id, void* time_info, sttpe_result_time_cb callback, void* user_data)
int ret = engine->pefuncs->foreach_result_time(time_info, callback, user_data);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to foreach result time : %s", __stt_get_engine_error_code(ret));
- return ret;
}
- return 0;
+ return ret;
}
int stt_engine_recognize_start_file(int engine_id, const char* lang, const char* recognition_type,
int ret = engine->pefuncs->start_file(lang, recognition_type, filepath, audio_type, sample_rate, user_param);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start file recognition : %s", __stt_get_engine_error_code(ret));
- return ret;
}
- return 0;
+ return ret;
}
int stt_engine_recognize_cancel_file(int engine_id)
int ret = engine->pefuncs->cancel_file();
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start file recognition : %s", __stt_get_engine_error_code(ret));
- return ret;
}
- return 0;
+ return ret;
}
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
- * Copyright (c) 2011-2014 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.
/*
- * Copyright (c) 2011-2014 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.
STT_ERROR_NO_SPEECH = TIZEN_ERROR_STT | 0x06, /**< No speech while recording */
STT_ERROR_IN_PROGRESS_TO_READY = TIZEN_ERROR_STT | 0x07, /**< Progress to ready is not finished */
STT_ERROR_IN_PROGRESS_TO_RECORDING = TIZEN_ERROR_STT | 0x08, /**< Progress to recording is not finished */
- STT_ERROR_IN_PROGRESS_TO_PROCESSING = TIZEN_ERROR_STT | 0x09 /**< Progress to processing is not finished */
+ STT_ERROR_IN_PROGRESS_TO_PROCESSING = TIZEN_ERROR_STT | 0x09, /**< Progress to processing is not finished */
+ STT_ERROR_RECORDING_TIMED_OUT = TIZEN_ERROR_STT | 0x10 /**< Recording timed out */
} stt_error_e;
/**
* @retval #STT_ERROR_INVALID_STATE Invalid state
* @retval #STT_ERROR_OPERATION_FAILED Operation failure
* @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
+ * @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
* @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
*
* @pre The state should be #STT_STATE_RECORDING.
* @retval #STT_ERROR_OPERATION_FAILED Operation failure
* @retval #STT_ERROR_NOT_SUPPORTED STT NOT supported
* @retval #STT_ERROR_IN_PROGRESS_TO_READY Progress to ready is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_RECORDING Progress to recording is not finished
+ * @retval #STT_ERROR_IN_PROGRESS_TO_PROCESSING Progress to processing is not finished
*
* @pre The state should be #STT_STATE_RECORDING or #STT_STATE_PROCESSING.
* @post It will invoke stt_state_changed_cb(), if you register a callback with stt_state_changed_cb(). \n
/*
- * Copyright (c) 2011-2014 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.
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
dbus_connection_close(g_conn_listener);
dbus_connection_close(g_conn_sender);
+ dbus_connection_unref(g_conn_sender);
+ dbus_connection_unref(g_conn_listener);
+
g_conn_listener = NULL;
g_conn_sender = NULL;
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
dbus_error_free(&err);
ret = STTD_ERROR_OPERATION_FAILED;
} else {
- SLOG(LOG_DEBUG, TAG_STTD, "[IN] stt get private data : uid(%d)", uid);
+ SLOG(LOG_DEBUG, TAG_STTD, "[IN] stt get private data : uid(%d), key(%s)", uid, (NULL == key) ? "NULL" : key);
ret = sttd_server_get_private_data(uid, key, &data);
}
DBUS_TYPE_INVALID);
if (0 == ret) {
- SLOG(LOG_DEBUG, TAG_STTD, "[OUT SUCCESS] Result(%d)", ret);
+ SLOG(LOG_DEBUG, TAG_STTD, "[OUT SUCCESS] Result(%d), data(%s)", ret, (NULL == data) ? "NULL" : data);
} else {
SLOG(LOG_ERROR, TAG_STTD, "[OUT ERROR] Result(%d)", ret);
}
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
int ret = stt_engine_get_supported_langs(engine->engine_id, lang_list);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] get language list error(%d)", ret);
- return ret;
}
- return 0;
+ return ret;
}
int sttd_engine_agent_get_default_lang(int uid, char** lang)
ret = stt_engine_set_private_data(engine->engine_id, key, data);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to set private data");
- return ret;
}
- return 0;
+ return ret;
}
int sttd_engine_agent_get_private_data(int uid, const char* key, char** data)
ret = stt_engine_get_private_data(engine->engine_id, key, data);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to get private data");
- return ret;
}
- return 0;
+ return ret;
}
int sttd_engine_agent_get_option_supported(int uid, bool* silence)
int ret = stt_engine_set_recording_data(engine->engine_id, data, length);
if (0 != ret) {
SLOG(LOG_WARN, TAG_STTD, "[Engine Agent WARNING] set recording error(%d)", ret);
- return ret;
}
- return 0;
+ return ret;
}
int sttd_engine_agent_recognize_stop_recorder(int uid)
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
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_NO_SPEECH = TIZEN_ERROR_STT | 0x06, /**< No speech while recording */
+ STTD_ERROR_RECORDING_TIMED_OUT = TIZEN_ERROR_STT | 0x10 /**< Recording timed out */
} stt_error_e;
typedef enum {
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
/*
-* Copyright (c) 2011-2014 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
STTP_ERROR_ENGINE_NOT_FOUND = TIZEN_ERROR_STT | 0x03, /**< No available engine */
STTP_ERROR_OPERATION_FAILED = TIZEN_ERROR_STT | 0x04, /**< Operation failed */
STTP_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_STT | 0x05, /**< Not supported feature of current engine */
- STTP_ERROR_NO_SPEECH = TIZEN_ERROR_STT | 0x06 /**< No speech while recording */
+ STTP_ERROR_NO_SPEECH = TIZEN_ERROR_STT | 0x06, /**< No speech while recording */
+ STTP_ERROR_RECORDING_TIMED_OUT = TIZEN_ERROR_STT | 0x10 /**< Recording timed out */
}sttp_error_e;
/**
* @retval #STTP_ERROR_INVALID_LANGUAGE Invalid language
* @retval #STTP_ERROR_OPERATION_FAILED Operation failed
* @retval #STTP_ERROR_OUT_OF_NETWORK Out of network
+* @retval #STTP_ERROR_PERMISSION_DENIED Permission denied
*
* @pre The engine is not in recognition processing.
*
/*
-* Copyright (c) 2011-2014 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