demo: Fixed issue with incorrect comparision of command in receive_request_result
authorSaurav Babu <saurav.babu@samsung.com>
Thu, 5 Apr 2018 14:22:30 +0000 (19:52 +0530)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 2 Jul 2018 10:38:49 +0000 (19:38 +0900)
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
capi/demo/comp-manager.c

index a32adb1..66a1748 100644 (file)
@@ -47,32 +47,36 @@ static int run_devices_find(MManager *mm, struct menu_data *menu);
 
 void receive_request_result(char *cmd, char *arg, int ret, void *user_data)
 {
-       msg("_request_result_cb is called");
+       msg("_request_result_cb is called command %s", cmd);
 
        if (cmd == NULL) {
                msgp("cmd is null [%s(0x%X)]", comp_error_to_string(ret), ret);
                return;
        }
 
-       if (strcmp("1", cmd) == 0) {
-               msgp("[CMD] Request Create Group [%s(0x%X)]", comp_error_to_string(ret), ret);
+       if (strcmp("COMP_REQ_CREATE_GROUP", cmd) == 0) {
+               msgp("[CMD] Request Create Group [%s(0x%X)]", comp_error_to_string(ret),
+                        ret);
                if (ret == COMP_ERROR_NONE && arg != NULL) {
                        msgb("Created Group name is %s", arg);
                        run_group_find(NULL, NULL);
                        run_devices_find(NULL, NULL);
                }
-       } else if (strcmp("2", cmd) == 0) {
+       } else if (strcmp("COMP_REQ_INVITE_DEVICE", cmd) == 0) {
                msgp("[CMD] Request Invite [%s(0x%X)]", comp_error_to_string(ret), ret);
                if (ret == COMP_ERROR_NONE && arg != NULL)
                        msgb("Invited Device ID is %s", arg);
-       } else if (strcmp("3", cmd) == 0) {
+       } else if (strcmp("COMP_REQ_EJECT_DEVICE", cmd) == 0) {
                msgp("[CMD] Request Eject [%s(0x%X)]", comp_error_to_string(ret), ret);
                if (ret == COMP_ERROR_NONE && arg != NULL)
                        msgb("Ejected Device ID is %s", arg);
-       } else if (strcmp("4", cmd) == 0) {
-               msgp("[CMD] Request Delete Group [%s(0x%X)]", comp_error_to_string(ret), ret);
+       } else if (strcmp("COMP_REQ_DELETE_GROUP", cmd) == 0) {
+               msgp("[CMD] Request Delete Group [%s(0x%X)]", comp_error_to_string(ret),
+                        ret);
                if (ret == COMP_ERROR_NONE && arg != NULL)
                        msgb("Deleted Group name is %s", arg);
+       } else if (strcmp("COMP_REQ_SEND_DATA", cmd) == 0) {
+               msgp("Received data [%d] %s", strlen(arg), arg);
        } else {
                msgp("[Recv][%d] %s", strlen(arg), arg);
        }