demo: fix problem finding MOT enabled devices instead MOWNED devices
authorsaerome.kim <saerome.kim@samsung.com>
Wed, 24 Jan 2018 06:34:23 +0000 (15:34 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 2 Jul 2018 10:38:47 +0000 (19:38 +0900)
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
capi/demo/comp-manager.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index f0c723d..dbc44c1
@@ -100,12 +100,15 @@ static int run_device_eject(MManager *mm, struct menu_data *menu)
                }
        }
 
-       if (found_device_list) {
-               device = g_list_nth_data(found_device_list, idx - 1);
-               if (NULL == device) {
-                       msgr("Failed to g_hash_table_find");
-                       return RET_FAILURE;
-               }
+       if (NULL == found_device_list) {
+               msgr("Find device first");
+               return RET_FAILURE;
+       }
+
+       device = g_list_nth_data(found_device_list, idx - 1);
+       if (NULL == device) {
+               msgr("Failed to g_hash_table_find");
+               return RET_FAILURE;
        }
 
        ret = companion_device_eject(group, device, _device_eject_result_cb, NULL );
@@ -156,12 +159,15 @@ static int run_device_invite(MManager *mm, struct menu_data *menu)
                }
        }
 
-       if (found_device_list) {
-               device = g_list_nth_data(found_device_list, idx - 1);
-               if (NULL == device) {
-                       msgr("Failed to g_hash_table_find");
-                       return RET_FAILURE;
-               }
+       if (NULL == found_device_list) {
+               msgr("Find device first");
+               return RET_FAILURE;
+       }
+
+       device = g_list_nth_data(found_device_list, idx - 1);
+       if (NULL == device) {
+               msgr("Failed to g_hash_table_find");
+               return RET_FAILURE;
        }
 
        ret = companion_device_invite(group, device, pin,_device_invite_result_cb, NULL );
@@ -368,12 +374,12 @@ int run_device_show_found(MManager *mm, struct menu_data *menu)
 
        msg("");
 
-       ret = companion_device_get_found_devices(&devices, &count);
+       ret = companion_device_get_found_mowned_devices(&devices, &count);
        if (COMP_ERROR_NONE != ret) {
                msgr("Failed to Get Found Devices: [%s(0x%X)]", comp_error_to_string(ret), ret);
                return RET_FAILURE;
        }
-       msg(" - companion_device_get_found_devices() ret: [0x%X] [%s]", ret, comp_error_to_string(ret));
+       msg(" - companion_device_get_found_mowned_devices() ret: [0x%X] [%s]", ret, comp_error_to_string(ret));
 
        for (int i = 0; i < count; i++) {
                char *device_id = NULL;