- /* send error msg */
- int reason = (int)STTD_ERROR_INVALID_STATE;
- if (0 != sttdc_send_error_signal(*uid, reason, "[ERROR] Fail to send recognition result")) {
- SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to send error info ");
- }
+ } else if (STTP_RESULT_EVENT_PARTIAL_RESULT == event) {
+ SLOG(LOG_DEBUG, TAG_STTD, "[Server] The partial result from engine is event[%d] data_count[%d]", event, data_count);
+
+ sttd_config_time_save();
+ sttd_config_time_reset();
+
+ if (0 != sttdc_send_result(uid, event, data, data_count, msg)) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to send result");
+ int reason = (int)STTD_ERROR_OPERATION_FAILED;
+
+ if (0 != sttdc_send_error_signal(uid, reason, "Fail to send recognition result")) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to send error info . Remove client data");
+ }
+ }
+
+ } else if (STTP_RESULT_EVENT_ERROR == event) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] The event of recognition result is ERROR");
+
+ /* Delete timer for processing time out */
+ if (NULL != g_processing_timer) {
+ ecore_timer_del(g_processing_timer);
+ g_processing_timer = NULL;
+ }
+ sttd_config_time_reset();
+
+ if (0 != sttdc_send_result(uid, event, NULL, 0, msg)) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to send result ");
+
+ /* send error msg */
+ int reason = (int)STTD_ERROR_INVALID_STATE;
+ if (0 != sttdc_send_error_signal(uid, reason, "[ERROR] Fail to send recognition result")) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to send error info ");