Add a new parameter for checking whether result is consumed 88/162788/1
authorsooyeon.kim <sooyeon.kim@samsung.com>
Tue, 5 Dec 2017 09:08:02 +0000 (18:08 +0900)
committersooyeon.kim <sooyeon.kim@samsung.com>
Tue, 5 Dec 2017 09:08:02 +0000 (18:08 +0900)
Change-Id: Ie821ca2c330aa325455dc4304b08021069b6f374
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
include/vce.h
server/vcd_server.c
server/vcd_server.h
server/vce.c

index eff4061..a921cd1 100755 (executable)
@@ -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.
index 6e973f3..2908e9f 100755 (executable)
@@ -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 */
index d317a3e..b328a7e 100644 (file)
@@ -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);
 
index 25f1f46..b7fb585 100755 (executable)
@@ -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 {