Fixed vce_get_command_count 99/173899/1
authorsungrae jo <seongrae.jo@samsung.com>
Tue, 27 Mar 2018 01:48:23 +0000 (10:48 +0900)
committersungrae jo <seongrae.jo@samsung.com>
Tue, 27 Mar 2018 01:48:23 +0000 (10:48 +0900)
Change-Id: I8f6c75a8bf2ec034e8790ecb19ca3cccd8f3128f
Signed-off-by: sungrae jo <seongrae.jo@samsung.com>
server/vcd_engine_agent.c
server/vcd_engine_agent.h
server/vcd_server.c
server/vcd_server.h
server/vce.c

index cd861bc..6c9dd57 100644 (file)
@@ -725,11 +725,12 @@ int vcd_engine_agent_get_foreach_command(vce_cmd_h vce_command, vce_command_cb c
        return vcd_client_foreach_command((client_foreach_command_cb)callback, user_data);
 }
 
-int vcd_engine_agent_get_command_count(vce_cmd_h vce_command)
+int vcd_engine_agent_get_command_count(vce_cmd_h vce_command, int* count)
 {
        SLOG(LOG_DEBUG, TAG_VCD, "[Engine Agent] Request command length from engine");
 
-       return vcd_client_get_length();
+       *count = vcd_client_get_length();
+       return 0;
 }
 
 int vcd_engine_agent_get_audio_type(char** audio_type)
index 4fa59d8..a327584 100644 (file)
@@ -83,7 +83,7 @@ int vcd_engine_process_haptic_event(int pid, const char* event);
 /* for engine service */
 int vcd_engine_agent_get_foreach_command(vce_cmd_h vce_command, vce_command_cb callback, void* user_data);
 
-int vcd_engine_agent_get_command_count(vce_cmd_h vce_command);
+int vcd_engine_agent_get_command_count(vce_cmd_h vce_command, int* count);
 
 int vcd_engine_agent_get_audio_type(char** audio_type);
 
index 9c976a5..3157967 100644 (file)
@@ -2542,13 +2542,13 @@ int vcd_get_foreach_command(vce_cmd_h vce_command, vce_command_cb callback, void
        return ret;
 }
 
-int vcd_get_command_count(vce_cmd_h vce_command)
+int vcd_get_command_count(vce_cmd_h vce_command, int* count)
 {
        SLOG(LOG_DEBUG, TAG_VCD, "[Server] Get command count");
 
        int ret = 0;
-       ret = vcd_engine_agent_get_command_count(vce_command);
-       if (0 > ret) {
+       ret = vcd_engine_agent_get_command_count(vce_command, count);
+       if (0 != ret) {
                SLOG(LOG_ERROR, TAG_VCD, "[Server ERROR] Fail to get command count : ret(%d)", ret);
        }
 
index 6df0154..70bc3d9 100644 (file)
@@ -139,7 +139,7 @@ int vcd_send_error(vce_error_e error, const char* msg, void *user_data);
 
 int vcd_get_foreach_command(vce_cmd_h vce_command, vce_command_cb callback, void* user_data);
 
-int vcd_get_command_count(vce_cmd_h vce_command);
+int vcd_get_command_count(vce_cmd_h vce_command, int* count);
 
 int vcd_get_audio_type(char** audio_type);
 
index ea9fb76..078b241 100644 (file)
@@ -148,7 +148,11 @@ int vce_get_command_count(vce_cmd_h vce_command, int* count)
 {
        int ret = VCE_ERROR_NONE;
 
-       ret = vcd_get_command_count(vce_command);
+       if (NULL == count) {
+               SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Invalid parameter");
+               return VCE_ERROR_INVALID_PARAMETER;
+       }
+       ret = vcd_get_command_count(vce_command, count);
        if (0 != ret) {
                SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to get command count");
        }