Add iotcon_remote_resource_get_options API
authorsung.goo.kim <sung.goo.kim@samsung.com>
Wed, 11 Nov 2015 04:55:36 +0000 (13:55 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Thu, 19 Nov 2015 05:54:46 +0000 (14:54 +0900)
Change-Id: I198dc00fd80cefe381ebd32323dc6d5e6b2182bd

lib/icl-remote-resource.c
lib/include/iotcon-remote-resource.h

index 8a759608308c3db30547f1bf1d9b08a5a60e218d..f3960c5cbdca6da583ddcf39f9d938a9f4332afd 100644 (file)
@@ -380,6 +380,16 @@ API int iotcon_remote_resource_is_observable(iotcon_remote_resource_h resource,
        return IOTCON_ERROR_NONE;
 }
 
+API int iotcon_remote_resource_get_options(iotcon_remote_resource_h resource,
+               iotcon_options_h *options)
+{
+       RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
+       RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
+
+       *options = resource->header_options;
+
+       return IOTCON_ERROR_NONE;
+}
 
 /* if header_options is NULL, then client's header_options is unset */
 API int iotcon_remote_resource_set_options(iotcon_remote_resource_h resource,
index b45ce51662bd63328e008fe17f59b55c7b274124..af5b7154186df093b6333f571651798fbfec121a 100644 (file)
@@ -636,6 +636,33 @@ int iotcon_remote_resource_get_interfaces(iotcon_remote_resource_h resource, int
 int iotcon_remote_resource_is_observable(iotcon_remote_resource_h resource,
                bool *observable);
 
+
+/**
+ * @brief Gets options of the remote resource
+ *
+ * @since_tizen 3.0
+ *
+ * @remarks @a options must not be released using iotcon_options_destroy().
+ *
+ * @param[in] resource The handle of the remote resource
+ * @param[out] options The handle of the header options
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE  Successful
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
+ *
+ * @see iotcon_remote_resource_get_uri_path()
+ * @see iotcon_remote_resource_get_host_address()
+ * @see iotcon_remote_resource_get_connectivity_type()
+ * @see iotcon_remote_resource_get_device_id()
+ * @see iotcon_remote_resource_get_types()
+ * @see iotcon_remote_resource_get_interfaces()
+ * @see iotcon_remote_resource_set_options()
+ * @see iotcon_remote_resource_is_observable()
+ */
+int iotcon_remote_resource_get_options(iotcon_remote_resource_h resource,
+               iotcon_options_h *options);
+
 /**
  * @brief Sets options into the remote resource
  *
@@ -654,6 +681,7 @@ int iotcon_remote_resource_is_observable(iotcon_remote_resource_h resource,
  * @see iotcon_remote_resource_get_device_id()
  * @see iotcon_remote_resource_get_types()
  * @see iotcon_remote_resource_get_interfaces()
+ * @see iotcon_remote_resource_get_options()
  * @see iotcon_remote_resource_is_observable()
  */
 int iotcon_remote_resource_set_options(iotcon_remote_resource_h resource,