From: Saurav Babu Date: Thu, 5 Apr 2018 14:22:30 +0000 (+0530) Subject: demo: Fixed issue with incorrect comparision of command in receive_request_result X-Git-Tag: submit/tizen/20190131.065036~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b90f871616427119b0c70661882a47f8bdb21e8d;p=platform%2Fcore%2Fapi%2Fmulti-device-group.git demo: Fixed issue with incorrect comparision of command in receive_request_result Signed-off-by: Saurav Babu --- diff --git a/capi/demo/comp-manager.c b/capi/demo/comp-manager.c index a32adb1..66a1748 100644 --- a/capi/demo/comp-manager.c +++ b/capi/demo/comp-manager.c @@ -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); }