fn-manager: Get Resource informations of found resources
authorSaurav Babu <saurav.babu@samsung.com>
Mon, 8 Jan 2018 13:37:29 +0000 (19:07 +0530)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 2 Jul 2018 10:38:38 +0000 (19:38 +0900)
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
src/fn-manager/src/fn_group.c
src/fn-manager/src/fn_iot.c

index 9dd3b203ae4484851e8e442694d0bc85466dfc74..ddd78dd9c598db153719c0acd5c790660551304a 100755 (executable)
@@ -23,6 +23,7 @@ int fn_group_create(char* name)
 
        return FN_ERROR_NONE;
 }
+
 int fn_group_destroy(fn_group_t *handle)
 {
 
index d65c05f7697d072141b748c8f01e9fe3a2a076c6..4421296f8fcc6b8d84b983b37cc734d80bf37741 100755 (executable)
@@ -92,17 +92,50 @@ static bool _found_resource(iotcon_remote_resource_h resource,
        int ret;
        char *resource_uri_path = NULL;
        iotcon_resource_types_h resource_types;
+       char *resource_device_id;
+       char *resource_device_name;
+       char *resource_host;
 
-       LOG_DEBUG("thread id : ");
+       LOG_DEBUG("Resource Found");
 
+       /* get the resource URI */
        ret = iotcon_remote_resource_get_uri_path(resource, &resource_uri_path);
        if (IOTCON_ERROR_NONE != ret) {
                LOG_ERR("Failed to get resource uri path");
                return IOTCON_FUNC_CONTINUE;
        }
+       LOG_DEBUG("resource uri : %s", resource_uri_path);
+
+       /* get the resource device id */
+       ret = iotcon_remote_resource_get_device_id(resource, &resource_device_id);
+       if (IOTCON_ERROR_NONE != ret) {
+               LOG_ERR("Failed to get resource device id");
+               return IOTCON_FUNC_CONTINUE;
+       }
+       LOG_DEBUG("resource device id : %s", resource_device_id);
+
+       /* get the resource device name */
+       ret = iotcon_remote_resource_get_device_name(resource,
+                                                                &resource_device_name);
+       if (IOTCON_ERROR_NONE != ret) {
+               LOG_ERR("Failed to get resource device name");
+               return IOTCON_FUNC_CONTINUE;
+       }
+       LOG_DEBUG("resource device name : %s", resource_device_name);
+
+       /* get the resource host address */
+       ret = iotcon_remote_resource_get_host_address(resource, &resource_host);
+       if (IOTCON_ERROR_NONE != ret) {
+               LOG_ERR("Failed to get resource host address");
+               return IOTCON_FUNC_CONTINUE;
+       }
+       LOG_DEBUG("resource host : %s", resource_host);
 
        ret = iotcon_remote_resource_get_types(resource, &resource_types);
-       LOG_DEBUG("resource uri : %s", resource_uri_path);
+       if (IOTCON_ERROR_NONE != ret) {
+               LOG_ERR("Failed to get resource types");
+               return IOTCON_FUNC_CONTINUE;
+       }
 
        return IOTCON_FUNC_CONTINUE;
 }