From 36a22e32e3973a437a80f2ca82690bc3dbae0592 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Tue, 5 Dec 2017 18:08:02 +0900 Subject: [PATCH] Add a new parameter for checking whether result is consumed Change-Id: Ie821ca2c330aa325455dc4304b08021069b6f374 Signed-off-by: sooyeon.kim --- include/vce.h | 3 ++- server/vcd_server.c | 9 ++++++++- server/vcd_server.h | 2 +- server/vce.c | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/vce.h b/include/vce.h index eff4061..a921cd1 100755 --- a/include/vce.h +++ b/include/vce.h @@ -644,6 +644,7 @@ int vce_main(int argc, char** argv, vce_request_callback_s *callback); * @param[in] non_fixed_result Non-fixed command result text * @param[in] nlu_result NLU result text * @param[in] msg Engine message (e.g. #VC_RESULT_MESSAGE_NONE, #VC_RESULT_MESSAGE_ERROR_TOO_LOUD) +* @param[out] user_info A user info (e.g. If ASR result is consumed, the value is 0x01. If not, the value is 0x00.) * @param[in] user_data The user data passed from set callback function * * @pre The vce_main() function should be invoked before this function is called. @@ -651,7 +652,7 @@ int vce_main(int argc, char** argv, vce_request_callback_s *callback); * * @see vce_stop_cb() */ -int vce_send_result(vce_result_event_e event, int* result_id, int count, const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, void *user_data); +int vce_send_result(vce_result_event_e event, int* result_id, int count, const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, int* user_info, void *user_data); /** * @brief Sends the ASR result to the engine service user. diff --git a/server/vcd_server.c b/server/vcd_server.c index 6e973f3..2908e9f 100755 --- a/server/vcd_server.c +++ b/server/vcd_server.c @@ -452,7 +452,7 @@ static void* __recorder_stop(void *data) return NULL; } -int vcd_send_result(vce_result_event_e event, int* result_id, int count, const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, void *user_data) +int vcd_send_result(vce_result_event_e event, int* result_id, int count, const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, int* user_info, void *user_data) { int ret = 0; @@ -511,11 +511,18 @@ int vcd_send_result(vce_result_event_e event, int* result_id, int count, const c if (true == enable) { SLOG(LOG_DEBUG, TAG_VCD, "[Server] Send ASR result to Widget client"); bool is_consumed = false; + if (NULL != user_info) { + *user_info = 0x00; + } if (0 != vcdc_send_asr_result(pid, event, all_result, VC_COMMAND_TYPE_WIDGET, &is_consumed)) { SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to send asr result"); } else { SLOG(LOG_DEBUG, TAG_VCD, "[Server] ASR result is consumed(%d)", is_consumed); if (true == is_consumed) { + if (NULL != user_info) { + *user_info = 0x01; + SLOG(LOG_DEBUG, TAG_VCD, "[Server] Send whether ASR result is consumed or not (%d)", *user_info); + } vcdc_send_show_tooltip(pid, false); if (-1 != vcd_client_manager_get_pid()) { /* Manager client is available */ diff --git a/server/vcd_server.h b/server/vcd_server.h index d317a3e..b328a7e 100644 --- a/server/vcd_server.h +++ b/server/vcd_server.h @@ -129,7 +129,7 @@ int vcd_server_set_language(const char* language); /* * For engine service */ -int vcd_send_result(vce_result_event_e event, int* result_id, int count, const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, void *user_data); +int vcd_send_result(vce_result_event_e event, int* result_id, int count, const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, int* user_info, void *user_data); int vcd_send_asr_result(vce_asr_result_event_e event, const char* asr_result, void *user_data); diff --git a/server/vce.c b/server/vce.c index 25f1f46..b7fb585 100755 --- a/server/vce.c +++ b/server/vce.c @@ -58,7 +58,7 @@ int vce_main(int argc, char** argv, vce_request_callback_s *callback) return 0; } -int vce_send_result(vce_result_event_e event, int* result_id, int count, const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, void *user_data) +int vce_send_result(vce_result_event_e event, int* result_id, int count, const char* all_result, const char* non_fixed_result, const char* nlu_result, const char* msg, int* user_info, void *user_data) { int ret = VCE_ERROR_NONE; @@ -66,7 +66,7 @@ int vce_send_result(vce_result_event_e event, int* result_id, int count, const c SLOG(LOG_ERROR, TAG_VCD, "[INFO] Input parameter is NULL. (no result)"); } - ret = vcd_send_result(event, result_id, count, all_result, non_fixed_result, nlu_result, msg, user_data); + ret = vcd_send_result(event, result_id, count, all_result, non_fixed_result, nlu_result, msg, user_info, user_data); if (0 != ret) { SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to send result"); } else { -- 2.7.4