RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == device_id, IOTCON_ERROR_INVALID_PARAMETER);
+ RETVM_IF(NULL == resource->device_id, IOTCON_ERROR_NO_DATA,
+ "If you want to get device ID, you should call iotcon_find_resource().");
*device_id = resource->device_id;
RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == resource->header_options, IOTCON_ERROR_NO_DATA);
*options = resource->header_options;
RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == uri_path, IOTCON_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == repr->uri_path, IOTCON_ERROR_NO_DATA);
*uri_path = repr->uri_path;
RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == types, IOTCON_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == repr->res_types, IOTCON_ERROR_NO_DATA);
*types = repr->res_types;
RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == ifaces, IOTCON_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == repr->interfaces, IOTCON_ERROR_NO_DATA);
*ifaces = repr->interfaces;
ERR("Invalid index(%d)", index);
return IOTCON_ERROR_INVALID_PARAMETER;
}
+ RETV_IF(NULL == parent->children[index], IOTCON_ERROR_NO_DATA);
*child = parent->children[index];
char **uri_path);
/**
- * @brief Gets connectivity type of the remote resource
+ * @brief Gets a connectivity type of the remote resource
*
* @since_tizen 3.0
*
iotcon_connectivity_type_e *connectivity_type);
/**
- * @brief Gets an host address of the remote resource
+ * @brief Gets a host address of the remote resource
*
* @since_tizen 3.0
*
char **host_address);
/**
- * @brief Gets an device id of the remote resource
+ * @brief Gets a device id of the remote resource
*
* @since_tizen 3.0
*
- * @remarks @a device_id must not be released using free().
+ * @remarks @a device_id must not be released using free().\n
+ * If @a resource is created by calling iotcon_remote_resource_create(), you cannot get
+ * @a device_id. In this case, the return value of this function is #IOTCON_ERROR_NO_DATA.
*
* @param[in] resource The handle of the remote resource
* @param[out] device_id The device id of the remote resource
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_NOT_SUPPORTED Not supported
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #IOTCON_ERROR_NO_DATA No data available
*
* @see iotcon_remote_resource_get_uri_path()
* @see iotcon_remote_resource_get_host_address()
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_NOT_SUPPORTED Not supported
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #IOTCON_ERROR_NO_DATA No data available
*
* @see iotcon_remote_resource_get_uri_path()
* @see iotcon_remote_resource_get_host_address()
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_NOT_SUPPORTED Not supported
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #IOTCON_ERROR_NO_DATA No data available
*/
int iotcon_representation_get_uri_path(iotcon_representation_h repr, char **uri_path);
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_NOT_SUPPORTED Not supported
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #IOTCON_ERROR_NO_DATA No data available
*/
int iotcon_representation_get_resource_types(iotcon_representation_h repr,
iotcon_resource_types_h *types);
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_NOT_SUPPORTED Not supported
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #IOTCON_ERROR_NO_DATA No data available
*/
int iotcon_representation_get_resource_interfaces(iotcon_representation_h repr,
iotcon_resource_interfaces_h *ifaces);
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_NOT_SUPPORTED Not supported
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #IOTCON_ERROR_NO_DATA No data available
*
* @see iotcon_resource_get_number_of_children()
* @see iotcon_resource_get_uri_path()