Unify bundle data in client, mgr, and widget
[platform/core/uifw/voice-control.git] / client / vc_mgr_tidl.c
index 7376fd5..eaa5ddf 100644 (file)
@@ -97,10 +97,10 @@ static void __notify_cb(void *user_data, bundle *msg)
 
        SLOG(LOG_DEBUG, TAG_VCM, "__notify_cb is invoked");
 
-       bundle_get_str(msg, VC_MANAGER_BUNDLE_METHOD, &method);
+       bundle_get_str(msg, VC_BUNDLE_METHOD, &method);
 
        if (0 == strncmp(VCD_MANAGER_METHOD_SET_VOLUME, method, strlen(VCD_MANAGER_METHOD_SET_VOLUME))) {
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_MESSAGE, &val);
+               bundle_get_str(msg, VC_BUNDLE_VOLUME, &val);
                float volume = 0;
 
                if (val) {
@@ -119,7 +119,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))) {
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_MESSAGE, &val);
+               bundle_get_str(msg, VC_BUNDLE_SERVICE_STATE, &val);
                int state = 0;
                if (val) {
                        state = atoi(val);
@@ -139,7 +139,7 @@ static void __notify_cb(void *user_data, bundle *msg)
        else if (0 == strncmp(VCD_MANAGER_METHOD_ALL_RESULT, method, strlen(VCD_MANAGER_METHOD_ALL_RESULT))) {
                SLOG(LOG_INFO, TAG_VCM, "@@@ Get All Result");
 
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_MESSAGE, &val);
+               bundle_get_str(msg, VC_BUNDLE_RESULT, &val);
 
                if (val) {
                        __vc_mgr_cb_all_result((vc_result_type_e)atoi(val));
@@ -153,8 +153,8 @@ static void __notify_cb(void *user_data, bundle *msg)
                char* event = NULL;
                char* pre_result = NULL;
 
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_EVENT, &event);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_PRE_RESULT, &pre_result);
+               bundle_get_str(msg, VC_BUNDLE_EVENT, &event);
+               bundle_get_str(msg, VC_BUNDLE_PRE_RESULT, &pre_result);
 
                if (NULL != pre_result) {
                        __vc_mgr_cb_pre_result((vc_pre_result_event_e)atoi(event), pre_result);
@@ -169,9 +169,9 @@ static void __notify_cb(void *user_data, bundle *msg)
                char* event = NULL;
                char* result = NULL;
 
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_ENGINE_APP_ID, &engine_app_id);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_EVENT, &event);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_RESULT, &result);
+               bundle_get_str(msg, VC_BUNDLE_ENGINE_APP_ID, &engine_app_id);
+               bundle_get_str(msg, VC_BUNDLE_EVENT, &event);
+               bundle_get_str(msg, VC_BUNDLE_RESULT, &result);
 
                if (NULL != result) {
                        gsize decodingSize=0;
@@ -201,10 +201,10 @@ static void __notify_cb(void *user_data, bundle *msg)
                char* utt_text = NULL;
                char* continous = NULL;
 
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_MESSAGE, &pid);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_DISP_TEXT, &disp_text);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_UTT_TEXT, &utt_text);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_CONTINUOUS, &continous);
+               bundle_get_str(msg, VC_BUNDLE_PID, &pid);
+               bundle_get_str(msg, VC_BUNDLE_DISP_TEXT, &disp_text);
+               bundle_get_str(msg, VC_BUNDLE_UTT_TEXT, &utt_text);
+               bundle_get_str(msg, VC_BUNDLE_CONTINUOUS, &continous);
 
                if (!strncmp(disp_text, "#NULL", strlen("#NULL") + 1))
                        disp_text = NULL;
@@ -222,9 +222,9 @@ static void __notify_cb(void *user_data, bundle *msg)
                char* daemon_pid = NULL;
                char* err_msg = NULL;
 
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_REASON, &reason);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_DAEMON_PID, &daemon_pid);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_ERROR_MESSAGE, &err_msg);
+               bundle_get_str(msg, VC_BUNDLE_REASON, &reason);
+               bundle_get_str(msg, VC_BUNDLE_DAEMON_PID, &daemon_pid);
+               bundle_get_str(msg, VC_BUNDLE_ERR_MSG, &err_msg);
 
                char* temp_msg = NULL;
                if (NULL != err_msg && strncmp(err_msg, "#NULL", strlen("#NULL") + 1)) {
@@ -246,9 +246,9 @@ static void __notify_cb(void *user_data, bundle *msg)
                char* key = NULL;
                char* private_data = NULL;
 
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_MESSAGE, &pid);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_KEY, &key);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_PRIVATE_DATA, &private_data);
+               bundle_get_str(msg, VC_BUNDLE_PID, &pid);
+               bundle_get_str(msg, VC_BUNDLE_KEY, &key);
+               bundle_get_str(msg, VC_BUNDLE_PRIVATE_DATA, &private_data);
 
                SLOG(LOG_INFO, TAG_VCM, "@@ vc mgr get request set private data : pid(%d) ", atoi(pid));
                if (pid > 0) {
@@ -266,9 +266,9 @@ static void __notify_cb(void *user_data, bundle *msg)
                char* audio_type = NULL;
                char* rate = NULL;
 
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_AUDIO_CHANNEL, &channel);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_AUDIO_TYPE, &audio_type);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_AUDIO_RATE, &rate);
+               bundle_get_str(msg, VC_BUNDLE_AUDIO_CHANNEL, &channel);
+               bundle_get_str(msg, VC_BUNDLE_AUDIO_TYPE, &audio_type);
+               bundle_get_str(msg, VC_BUNDLE_AUDIO_RATE, &rate);
 
                __vc_mgr_cb_feedback_audio_format(atoi(rate), (vc_audio_channel_e)atoi(channel), (vc_audio_type_e)atoi(audio_type));
 
@@ -284,8 +284,8 @@ static void __notify_cb(void *user_data, bundle *msg)
        //      int pid = 0;
        //      int value = 0;
 
-       //      bundle_get_str(msg, VC_MANAGER_BUNDLE_MESSAGE, &temp_pid);
-       //      bundle_get_str(msg, VC_MANAGER_BUNDLE_VALUE, &temp_value);
+       //      bundle_get_str(msg, VC_BUNDLE_PID, &temp_pid);
+       //      bundle_get_str(msg, VC_BUNDLE_VALUE, &temp_value);
        //      pid = atoi(temp_pid);
        //      value = atoi(temp_value);
 
@@ -308,7 +308,7 @@ static void __send_buffer_cb(void *user_data, rpc_port_proxy_vc_mgr_proxy_array_
 
        SLOG(LOG_DEBUG, TAG_VCM, "__send_buffer_cb is invoked");
 
-       bundle_get_str(msg, VC_MANAGER_BUNDLE_METHOD, &method);
+       bundle_get_str(msg, VC_BUNDLE_METHOD, &method);
 
        if (0 == strncmp(VCD_MANAGER_METHOD_FEEDBACK_STREAMING, method, strlen(VCD_MANAGER_METHOD_FEEDBACK_STREAMING))) {
                char *utt_id = NULL;
@@ -316,9 +316,9 @@ static void __send_buffer_cb(void *user_data, rpc_port_proxy_vc_mgr_proxy_array_
                char* buffer = NULL;
                int len = 0;
 
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_MESSAGE, &val);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_UTTID, &utt_id);
-               bundle_get_str(msg, VC_MANAGER_BUNDLE_EVENT, &event);
+               bundle_get_str(msg, VC_BUNDLE_PID, &val);
+               bundle_get_str(msg, VC_BUNDLE_UTT_ID, &utt_id);
+               bundle_get_str(msg, VC_BUNDLE_EVENT, &event);
 
                rpc_port_proxy_vc_mgr_proxy_array_char_get(data_in, &buffer, &len);
                __vc_mgr_cb_feedback_streaming(atoi(val), atoi(utt_id), atoi(event), buffer, len);