return STT_CONFIG_ERROR_NONE;
}
+ /* Make directories */
+ if (0 != access(STT_CONFIG_BASE, F_OK)) {
+ if (0 != mkdir(STT_CONFIG_BASE, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
+ SLOG(LOG_ERROR, stt_tag(), "[ERROR] Fail to make directory : %s", STT_CONFIG_BASE);
+ __stt_config_release_client(uid);
+ return STT_CONFIG_ERROR_OPERATION_FAILED;
+ } else {
+ SLOG(LOG_DEBUG, stt_tag(), "Success to make directory : %s", STT_CONFIG_BASE);
+ }
+ }
+
+ if (0 != access(STT_HOME, F_OK)) {
+ if (0 != mkdir(STT_HOME, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
+ SLOG(LOG_ERROR, stt_tag(), "[ERROR] Fail to make directory : %s", STT_HOME);
+ __stt_config_release_client(uid);
+ return STT_CONFIG_ERROR_OPERATION_FAILED;
+ } else {
+ SLOG(LOG_DEBUG, stt_tag(), "Success to make directory : %s", STT_HOME);
+ }
+ }
+
+ if (0 != access(STT_DOWNLOAD_BASE, F_OK)) {
+ if (0 != mkdir(STT_DOWNLOAD_BASE, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
+ SLOG(LOG_ERROR, stt_tag(), "[ERROR] Fail to make directory : %s", STT_DOWNLOAD_BASE);
+ __stt_config_release_client(uid);
+ return STT_CONFIG_ERROR_OPERATION_FAILED;
+ } else {
+ SLOG(LOG_DEBUG, stt_tag(), "Success to make directory : %s", STT_DOWNLOAD_BASE);
+ }
+ }
+
+ if (0 != access(STT_DOWNLOAD_ENGINE_INFO, F_OK)) {
+ if (0 != mkdir(STT_DOWNLOAD_ENGINE_INFO, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
+ SLOG(LOG_ERROR, stt_tag(), "[ERROR] Fail to make directory : %s", STT_DOWNLOAD_ENGINE_INFO);
+ __stt_config_release_client(uid);
+ return STT_CONFIG_ERROR_OPERATION_FAILED;
+ } else {
+ SLOG(LOG_DEBUG, stt_tag(), "Success to make directory : %s", STT_DOWNLOAD_ENGINE_INFO);
+ }
+ }
+
+
/* Get file name from default engine directory */
g_engine_list = NULL;
info->start_time = start_time;
info->end_time = end_time;
+ SLOG(LOG_DEBUG, stt_tag(), "[DEBUG] inside stt_config_mgr_add_time_info: index(%d), text(%s), start time(%d), end_time(%d)", info->index, (NULL == info->text) ? "NULL" : info->text, info->start_time, info->end_time);
+
/* Add item to global list */
g_time_list = g_slist_append(g_time_list, info);
+ SLOG(LOG_DEBUG, stt_tag(), "[DEBUG] inside stt_config_mgr_add_time_info: g_time_list length(%d)", g_slist_length(g_time_list));
+
return 0;
}
* Defines for configuration
*******************************************************************************************/
-#define STT_TIME_INFO_PATH tzplatform_mkpath(TZ_USER_HOME, "share/.voice/stt-time.xml")
-
+#define STT_CONFIG_BASE tzplatform_mkpath(TZ_USER_HOME, "share/.voice")
#define STT_CONFIG tzplatform_mkpath(TZ_USER_HOME, "share/.voice/stt-config.xml")
#define STT_DEFAULT_CONFIG tzplatform_mkpath(TZ_SYS_RO_SHARE, "/voice/stt/1.0/stt-config.xml")
+#define STT_TIME_INFO_PATH tzplatform_mkpath(TZ_USER_HOME, "share/.voice/stt-time.xml")
+
#define STT_DEFAULT_ENGINE tzplatform_mkpath(TZ_SYS_RO_SHARE, "/voice/stt/1.0/engine")
#define STT_DEFAULT_ENGINE_INFO tzplatform_mkpath(TZ_SYS_RO_SHARE, "/voice/stt/1.0/engine-info")
#define STT_DEFAULT_ENGINE_SETTING tzplatform_mkpath(TZ_SYS_RO_SHARE, "/voice/stt/1.0/engine-setting")
SLOG(LOG_DEBUG, TAG_STTD, "[Server] index(%d) event(%d) text(%s) start(%ld) end(%ld)",
index, event, text, start_time, end_time);
- if (0 == index) {
- int ret;
- ret = sttd_config_time_add(index, (int)event, text, start_time, end_time);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to add time info");
- pthread_mutex_unlock(&stte_result_time_mutex);
- return false;
- }
- } else {
+ int ret;
+ ret = sttd_config_time_add(index, (int)event, text, start_time, end_time);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to add time info");
pthread_mutex_unlock(&stte_result_time_mutex);
return false;
}