From 7477399e2759129ed154c4cc25be199f088ec44c Mon Sep 17 00:00:00 2001 From: ulgal-park Date: Thu, 25 Aug 2022 18:50:02 +0900 Subject: [PATCH] fix issue that voice control client can not get service state update Change-Id: Ic2004192c199f807582b2d1a9512b396f61a0bce --- client/vc_mgr_tidl.c | 4 ++-- client/vc_widget_tidl.c | 4 ++-- common/vc_defs.h | 5 ++--- server/vcd_tidl.c | 9 ++------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/client/vc_mgr_tidl.c b/client/vc_mgr_tidl.c index 672ea2e..b6e3a23 100644 --- a/client/vc_mgr_tidl.c +++ b/client/vc_mgr_tidl.c @@ -118,7 +118,7 @@ static void __notify_cb(void *user_data, bundle *msg) } } /* VCD_MANAGER_METHOD_SET_VOLUME */ - else if (0 == strncmp(VCD_MANAGER_METHOD_SET_SERVICE_STATE, method, strlen(VCD_MANAGER_METHOD_SET_SERVICE_STATE))) { + else if (0 == strncmp(VCD_METHOD_SET_SERVICE_STATE, method, strlen(VCD_METHOD_SET_SERVICE_STATE))) { bundle_get_str(msg, VC_BUNDLE_SERVICE_STATE, &val); int state = 0; if (val) { @@ -126,7 +126,7 @@ static void __notify_cb(void *user_data, bundle *msg) SLOG(LOG_INFO, TAG_VCM, "@@ state changed : %d", state); __vc_mgr_cb_service_state(state); } - } /* VCD_MANAGER_METHOD_SET_SERVICE_STATE */ + } /* VCD_METHOD_SET_SERVICE_STATE */ else if (0 == strncmp(VCD_MANAGER_METHOD_SPEECH_DETECTED, method, strlen(VCD_MANAGER_METHOD_SPEECH_DETECTED))) { SLOG(LOG_INFO, TAG_VCM, "@@@ Get Speech detected"); diff --git a/client/vc_widget_tidl.c b/client/vc_widget_tidl.c index 36b68ec..2c7e705 100644 --- a/client/vc_widget_tidl.c +++ b/client/vc_widget_tidl.c @@ -73,7 +73,7 @@ static void __notify_cb(void *user_data, bundle *msg) } } /* VCD_METHOD_HELLO */ - else if (0 == strncmp(VCD_WIDGET_METHOD_SET_SERVICE_STATE, method, strlen(VCD_WIDGET_METHOD_SET_SERVICE_STATE))) { + else if (0 == strncmp(VCD_METHOD_SET_SERVICE_STATE, method, strlen(VCD_METHOD_SET_SERVICE_STATE))) { bundle_get_str(msg, VC_BUNDLE_SERVICE_STATE, &val); int state = 0; if (val) { @@ -81,7 +81,7 @@ static void __notify_cb(void *user_data, bundle *msg) SLOG(LOG_INFO, TAG_VCW, "@@ service state changed : %d", state); __vc_widget_cb_service_state(state); } - } /* VCD_WIDGET_METHOD_SET_SERVICE_STATE */ + } /* VCD_METHOD_SET_SERVICE_STATE */ else if (0 == strncmp(VCD_WIDGET_METHOD_SHOW_TOOLTIP, method, strlen(VCD_WIDGET_METHOD_SHOW_TOOLTIP))) { SLOG(LOG_DEBUG, TAG_VCW, "@@@ Show / Hide tooltip"); diff --git a/common/vc_defs.h b/common/vc_defs.h index 327038d..21b5251 100644 --- a/common/vc_defs.h +++ b/common/vc_defs.h @@ -95,6 +95,8 @@ extern "C" { #define VC_METHOD_HELLO "vc_method_hello" +#define VCD_METHOD_SET_SERVICE_STATE "vcd_method_set_service_state" + /****************************************************************************************** * Message Definitions for Client *******************************************************************************************/ @@ -117,7 +119,6 @@ extern "C" { #define VCD_METHOD_RESULT "vcd_method_result" #define VCD_METHOD_ERROR "vcd_method_error" #define VCD_METHOD_HELLO "vcd_method_hello" -#define VCD_METHOD_SET_SERVICE_STATE "vcd_method_set_service_state" #define VCD_METHOD_SEND_MANAGER_PID "vcd_method_send_manager_pid" #define VCD_METHOD_FEEDBACK_STREAMING "vcd_method_feedback_streaming" @@ -158,7 +159,6 @@ extern "C" { #define VCD_WIDGET_METHOD_ERROR "vcd_widget_method_error" #define VCD_WIDGET_METHOD_HELLO "vcd_widget_method_hello" #define VCD_WIDGET_METHOD_SHOW_TOOLTIP "vcd_widget_method_show_tooltip" -#define VCD_WIDGET_METHOD_SET_SERVICE_STATE "vcd_widget_method_set_service_state" /****************************************************************************************** @@ -201,7 +201,6 @@ extern "C" { #define VCD_MANAGER_METHOD_PRE_RESULT "vcd_manager_method_pre_result" #define VCD_MANAGER_METHOD_RESULT "vcd_manager_method_result" #define VCD_MANAGER_METHOD_SET_VOLUME "vcd_manager_method_set_volume" -#define VCD_MANAGER_METHOD_SET_SERVICE_STATE "vcd_manager_method_set_service_state" #define VCD_MANAGER_METHOD_DIALOG "vcd_manager_method_dialog" #define VCD_MANAGER_METHOD_SET_PRIVATE_DATA "vcd_manager_set_private_data" #define VCD_MANAGER_METHOD_GET_PRIVATE_DATA "vcd_manager_get_private_data" diff --git a/server/vcd_tidl.c b/server/vcd_tidl.c index a881cd7..52f403a 100644 --- a/server/vcd_tidl.c +++ b/server/vcd_tidl.c @@ -2278,16 +2278,11 @@ int vcdc_send_service_state(vcd_state_e state) bundle* msg = bundle_create(); snprintf(tmp_state, 10, "%d", (int)state); - bundle_add_str(msg, VC_BUNDLE_METHOD, VCD_MANAGER_METHOD_SET_SERVICE_STATE); - bundle_add_str(msg, VC_BUNDLE_SERVICE_STATE, tmp_state); - __send_signal(msg, VCD_CLIENT_TYPE_MANAGER); - bundle_add_str(msg, VC_BUNDLE_METHOD, VCD_METHOD_SET_SERVICE_STATE); bundle_add_str(msg, VC_BUNDLE_SERVICE_STATE, tmp_state); + + __send_signal(msg, VCD_CLIENT_TYPE_MANAGER); __send_signal(msg, VCD_CLIENT_TYPE_NORMAL); - - bundle_add_str(msg, VC_BUNDLE_METHOD, VCD_WIDGET_METHOD_SET_SERVICE_STATE); - bundle_add_str(msg, VC_BUNDLE_SERVICE_STATE, tmp_state); __send_signal(msg, VCD_CLIENT_TYPE_WIDGET); SLOG(LOG_DEBUG, TAG_VCD, ">>>> VCD SEND SIGNAL"); -- 2.7.4