From: Saurav Babu Date: Mon, 8 Jan 2018 13:37:29 +0000 (+0530) Subject: fn-manager: Get Resource informations of found resources X-Git-Tag: submit/tizen/20190131.065036~272 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=660f7925497f8577105b11085dc53690c7a83859;p=platform%2Fcore%2Fapi%2Fmulti-device-group.git fn-manager: Get Resource informations of found resources Signed-off-by: Saurav Babu --- diff --git a/src/fn-manager/src/fn_group.c b/src/fn-manager/src/fn_group.c index 9dd3b20..ddd78dd 100755 --- a/src/fn-manager/src/fn_group.c +++ b/src/fn-manager/src/fn_group.c @@ -23,6 +23,7 @@ int fn_group_create(char* name) return FN_ERROR_NONE; } + int fn_group_destroy(fn_group_t *handle) { diff --git a/src/fn-manager/src/fn_iot.c b/src/fn-manager/src/fn_iot.c index d65c05f..4421296 100755 --- a/src/fn-manager/src/fn_iot.c +++ b/src/fn-manager/src/fn_iot.c @@ -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; }