From: sooyeon.kim Date: Wed, 21 Apr 2021 11:08:29 +0000 (+0900) Subject: Change return value when VC Engine sends error X-Git-Tag: accepted/tizen/unified/20210428.040504^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4cce91b7cd02017288321a2f2992daa93c27289;p=platform%2Fcore%2Fuifw%2Fvoice-control.git Change return value when VC Engine sends error Change-Id: Iddadfcea14efe97e2dc7f53f5781217e7884ce9f Signed-off-by: sooyeon.kim --- diff --git a/server/vcd_engine_agent.c b/server/vcd_engine_agent.c index 04cbb6a..2ebb68b 100644 --- a/server/vcd_engine_agent.c +++ b/server/vcd_engine_agent.c @@ -401,7 +401,7 @@ int vcd_engine_recognize_start(bool silence) ret = g_dynamic_engine.callbacks->start(silence); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent] Fail to start engine error(%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } else { SLOG(LOG_INFO, TAG_VCD, "[Engine Agent] Engine is not available (Cannot start)"); @@ -433,7 +433,7 @@ int vcd_engine_recognize_audio(const void* data, unsigned int length, vce_speech if (VCE_ERROR_OUT_OF_NETWORK == ret) { return VCD_ERROR_TIMED_OUT; } - return VCD_ERROR_OPERATION_FAILED; + return ret; } } @@ -452,7 +452,7 @@ int vcd_engine_recognize_stop() ret = g_dynamic_engine.callbacks->stop(); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to stop dynamic engine error(%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } else { SLOG(LOG_WARN, TAG_VCD, "[Engine Agent] Dynamic engine is not recording state"); @@ -474,7 +474,7 @@ int vcd_engine_recognize_cancel() ret = g_dynamic_engine.callbacks->cancel(); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to cancel dynamic engine error(%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } @@ -493,7 +493,7 @@ int vcd_engine_set_audio_type(const char* audio) ret = g_dynamic_engine.callbacks->set_audio_type(audio); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to set audio type(%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } @@ -531,7 +531,7 @@ int vcd_engine_set_domain(int pid, const char* domain) ret = g_dynamic_engine.callbacks->set_domain(domain); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to set domain (%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } @@ -555,7 +555,7 @@ int vcd_engine_get_nlu_base_info(int pid, const char* key, char** value) ret = g_dynamic_engine.internal_callbacks->nlu_base_info_request(key, value); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to get nlu base info (%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } else { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent INFO] Engine is not loaded or There is no nlu_base_info_request callback"); @@ -580,7 +580,7 @@ int vcd_engine_set_private_data(int pid, const char* key, const char* data) ret = g_dynamic_engine.internal_callbacks->private_data_set(key, data); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to set private data (%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } else { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent INFO] Engine is not loaded or There is no private_data_set callback"); @@ -607,7 +607,7 @@ int vcd_engine_get_private_data(int pid, const char* key, char** data) ret = g_dynamic_engine.internal_callbacks->private_data_request(key, data); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to get private data (%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } else { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent INFO] Engine is not loaded or There is no private_data_request callback"); @@ -629,7 +629,7 @@ int vcd_engine_send_specific_engine_request(const char* engine_app_id, const cha ret = g_dynamic_engine.internal_callbacks->specific_engine_request(engine_app_id, event, request); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to set specific engine request (%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } else { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent INFO] Engine is not loaded or There is no specific_engine_request callback"); @@ -651,7 +651,7 @@ int vcd_engine_process_text(int pid, const char* text) ret = g_dynamic_engine.callbacks->process_text(text); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to process text (%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } @@ -670,7 +670,7 @@ int vcd_engine_process_list_event(int pid, const char* event) ret = g_dynamic_engine.callbacks->process_list_event(event); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to process list event (%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } @@ -689,7 +689,7 @@ int vcd_engine_process_haptic_event(int pid, const char* event) ret = g_dynamic_engine.callbacks->process_haptic_event(event); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to process haptic event (%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } @@ -710,7 +710,7 @@ int vcd_engine_request_tts(int pid, int utt_id, const char* text, const char* la ret = g_dynamic_engine.internal_callbacks->request_tts(pid, utt_id, text, language, g_dynamic_engine.internal_callbacks->request_tts_user_data); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to set request tts (%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } else { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Engine is not loaded or There is no request tts callback"); @@ -732,7 +732,7 @@ int vcd_engine_cancel_tts(int pid, int utt_id) ret = g_dynamic_engine.internal_callbacks->cancel_tts(pid, utt_id, g_dynamic_engine.internal_callbacks->cancel_tts_user_data); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to set cancel tts (%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } else { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Engine is not loaded or There is no cancel tts callback"); @@ -754,7 +754,7 @@ int vcd_engine_get_tts_audio_format(int* rate, int* channel, int* audio_type) ret = g_dynamic_engine.internal_callbacks->get_tts_audio_format(rate, channel, audio_type, g_dynamic_engine.internal_callbacks->get_tts_audio_format_user_data); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Fail to get tts audio format(%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } } else { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] Engine is not loaded or There is no get tts audio format callback"); @@ -783,7 +783,7 @@ int vcd_engine_get_audio_format(const char* audio_id, vce_audio_type_e* types, i int ret = g_dynamic_engine.callbacks->get_recording_format(audio_id, types, rate, channels); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] get recording format(%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } return 0; @@ -821,7 +821,7 @@ int vcd_engine_supported_langs(GList** lang_list) int ret = g_dynamic_engine.callbacks->foreach_langs(__supported_language_cb, (void*)lang_list); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[Engine Agent ERROR] get language list error(%d)", ret); - return VCD_ERROR_OPERATION_FAILED; + return ret; } return 0; diff --git a/server/vcd_server.c b/server/vcd_server.c old mode 100755 new mode 100644 index 721b265..4355e2d --- a/server/vcd_server.c +++ b/server/vcd_server.c @@ -142,7 +142,7 @@ static int __server_recorder_callback(const void* data, const unsigned int lengt if (VCE_ERROR_OUT_OF_NETWORK == ret) { vcdc_send_error_signal_to_manager(vcd_client_manager_get_pid(), VCD_ERROR_TIMED_OUT, "voice_framework.error.engine.set_recording_fail"); } else { - vcdc_send_error_signal_to_manager(vcd_client_manager_get_pid(), VCD_ERROR_OPERATION_FAILED, "voice_framework.error.engine.set_recording_fail"); + vcdc_send_error_signal_to_manager(vcd_client_manager_get_pid(), ret, "voice_framework.error.engine.set_recording_fail"); } return 0; } @@ -1911,8 +1911,8 @@ static int __start_internal_recognition() /* Send error cb to manager */ int pid = vcd_client_widget_get_foreground_pid(); if (-1 != pid) - vcdc_send_error_signal_to_manager(vcd_client_manager_get_pid(), VCD_ERROR_OPERATION_FAILED, "voice_framework.error.engine.start_fail"); - return VCD_ERROR_OPERATION_FAILED; + vcdc_send_error_signal_to_manager(vcd_client_manager_get_pid(), ret, "voice_framework.error.engine.start_fail"); + return ret; } SLOG(LOG_ERROR, TAG_VCD, "[Server Success] Start engine");