From 7ad17f06545f11d99c867fa7c3bccf632b51a9b2 Mon Sep 17 00:00:00 2001 From: Kwangyoun Kim Date: Wed, 4 Jan 2017 17:13:48 +0900 Subject: [PATCH] Change command collect timing Change-Id: I974664edf6c44dd7148b46c249bef55549e875bb (cherry picked from commit 705d95e146a43803ff7184b5ee087a607ef8a6f9) --- server/vcd_client_data.c | 12 +++++++++++- server/vcd_server.c | 13 ------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/server/vcd_client_data.c b/server/vcd_client_data.c index 562b77a..010bde0 100644 --- a/server/vcd_client_data.c +++ b/server/vcd_client_data.c @@ -444,6 +444,16 @@ int vcd_client_foreach_command(client_foreach_command_cb callback, void* user_da return VCD_ERROR_INVALID_PARAMETER; } + if (0 != vcd_client_command_collect_command()) { + SLOG(LOG_ERROR, TAG_VCD, "[Client Data ERROR] Fail to collect command"); + return VCD_ERROR_OPERATION_FAILED; + } + + if (0 >= vcd_client_get_length()) { + SLOG(LOG_ERROR, TAG_VCD, "[Client Data ERROR] No current command"); + return VCD_ERROR_OPERATION_FAILED; + } + // int id_count = 1; GSList *iter = NULL; vc_cmd_s* temp_cmd; @@ -1380,4 +1390,4 @@ int vcd_client_widget_get_asr_result_enabled(int pid, bool* enable) *enable = info->asr_result_enabled; return 0; -} \ No newline at end of file +} diff --git a/server/vcd_server.c b/server/vcd_server.c index cd4088d..dcefbac 100755 --- a/server/vcd_server.c +++ b/server/vcd_server.c @@ -1451,19 +1451,6 @@ static int __start_internal_recognition() { int ret; - /* 2. Get commands */ - ret = vcd_client_command_collect_command(); - if (0 != ret) { - SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to collect command : %d", ret); - return VCD_ERROR_OPERATION_FAILED; - } - - ret = vcd_client_get_length(); - if (0 == ret) { - SLOG(LOG_WARN, TAG_VCD, "[Server WARNIING] No current command : %d", ret); - return VCD_ERROR_OPERATION_FAILED; - } - /* 3. Set command to engine */ ret = vcd_engine_set_commands(); if (0 != ret) { -- 2.7.4