case IOTCON_CONNECTIVITY_IPV6:
oic_conn_type = CT_IP_USE_V6;
break;
- case IOTCON_CONNECTIVITY_EDR:
+ case IOTCON_CONNECTIVITY_BT_EDR:
oic_conn_type = CT_ADAPTER_RFCOMM_BTEDR;
break;
- case IOTCON_CONNECTIVITY_LE:
+ case IOTCON_CONNECTIVITY_BT_LE:
oic_conn_type = CT_ADAPTER_GATT_BTLE;
break;
case IOTCON_CONNECTIVITY_ALL:
conn_type = IOTCON_CONNECTIVITY_IPV6;
break;
case OC_ADAPTER_RFCOMM_BTEDR:
- conn_type = IOTCON_CONNECTIVITY_EDR;
+ conn_type = IOTCON_CONNECTIVITY_BT_EDR;
break;
case OC_ADAPTER_GATT_BTLE:
- conn_type = IOTCON_CONNECTIVITY_LE;
+ conn_type = IOTCON_CONNECTIVITY_BT_LE;
break;
default:
ERR("Invalid Adpater");
*adapter = OC_ADAPTER_IP;
*flag = OC_IP_USE_V6;
break;
- case IOTCON_CONNECTIVITY_EDR:
+ case IOTCON_CONNECTIVITY_BT_EDR:
*adapter = OC_ADAPTER_RFCOMM_BTEDR;
*flag = OC_DEFAULT_FLAGS;
break;
- case IOTCON_CONNECTIVITY_LE:
+ case IOTCON_CONNECTIVITY_BT_LE:
*adapter = OC_ADAPTER_GATT_BTLE;
*flag = OC_DEFAULT_FLAGS;
break;
* The Iotcon API provides to register resources, discover resources and access them via
* RESTful API.\n\n
*
- * @addtogroup CAPI_IOT_CONNECTIVITY_SERVER_MODULE
- * @{
* @subsection CAPI_IOT_CONNECTIVITY_MODULE_RESOURCE Resource
* A Resource is a component in a server that can be viewed and conrolled by another client.\n
* There are different resource types, for example a temperature sensor, a light controller etc.\n\n
iotcon_resource_types_destroy(resource_types);
}
* @endcode
- * @}
*
- * @addtogroup CAPI_IOT_CONNECTIVITY_CLIENT_MODULE
- * @{
* @subsection CAPI_IOT_CONNECTIVITY_MODULE_FINDING_RESOURCE Finding a resource.
* This operation returns all resources of given type on the network service.\n
* This operation is sent via multicast to all services.\n
}
}
* @endcode
- * @}
*
- * @addtogroup CAPI_IOT_CONNECTIVITY_SERVER_MODULE
- * @{
* @subsection CAPI_IOT_CONNECTIVITY_MODULE_OBSERVING_RESOURCE Observing resource
* This operation fetches and registers as an observer for the value of simple specific resource.\n
* An observable resource can handle any number of observers.\n
return;
}
* @endcode
- * @}
*
*/
return G_SOURCE_REMOVE;
}
-API int iotcon_request_device_info(const char *host_address,
+API int iotcon_get_device_info(const char *host_address,
iotcon_connectivity_type_e connectivity_type,
iotcon_device_info_cb cb,
void *user_data)
return G_SOURCE_REMOVE;
}
-API int iotcon_request_platform_info(const char *host_address,
+API int iotcon_get_platform_info(const char *host_address,
iotcon_connectivity_type_e connectivity_type,
iotcon_platform_info_cb cb,
void *user_data)
}
-API int iotcon_request_tizen_info(const char *host_address,
+API int iotcon_get_tizen_info(const char *host_address,
iotcon_connectivity_type_e connectivity_type,
iotcon_tizen_info_cb cb,
void *user_data)
}
-API int iotcon_remote_resource_observer_stop(iotcon_remote_resource_h resource)
+API int iotcon_remote_resource_stop_observing(iotcon_remote_resource_h resource)
{
int ret;
RET_IF(NULL == resource);
if (resource->observe_handle)
- iotcon_remote_resource_observer_stop(resource);
+ iotcon_remote_resource_stop_observing(resource);
icl_remote_resource_crud_stop(resource);
* @remarks The length of @a resource_type should be less than or equal to 61.\n
* The @a resource_type must start with a lowercase alphabetic character, followed by a sequence
* of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space.\n
+ * You must destroy @a presence by calling iotcon_unsubscribe_presence()
+ * if @a presence is no longer needed.
*
* @param[in] host_address The address or addressable name of the server
* @param[in] connectivity_type The connectivity type
/**
* @brief Specifies the type of function passed to iotcon_find_resource().
* @details Called when a resource is found from the remote server.
+ * The @a result could be one of #iotcon_error_e.
*
* @since_tizen 3.0
*
*
* @see iotcon_find_resource()
*/
-typedef void (*iotcon_found_resource_cb)(iotcon_remote_resource_h resource, int result,
- void *user_data);
+typedef void (*iotcon_found_resource_cb)(iotcon_remote_resource_h resource,
+ iotcon_error_e result, void *user_data);
/**
* @brief Finds resources.
* @details Request to find a resource of @a host_address server with @a resource_type.\n
+ * @a host_address could be #IOTCON_MULTICAST_ADDRESS for IPv4 multicast.\n
* If succeed to find the resource, iotcon_found_resource_cb() will be invoked with
* information of the resource.
*
* @retval #IOTCON_ERROR_SYSTEM System error
* @retval #IOTCON_ERROR_PERMISSION_DENIED Permission denied
*
- * @post When the resource is found, iotcon_found_resource_cb() will be called.
+ * @pre iotcon_connect() should be called to connect a connection to the iotcon.
+ * @post iotcon_found_resource_cb() will be invoked.
*
* @see iotcon_found_resource_cb()
+ * @see iotcon_set_timeout()
*/
int iotcon_find_resource(const char *host_address,
iotcon_connectivity_type_e connectivity_type,
void *user_data);
/**
- * @brief Specifies the type of function passed to iotcon_request_device_info().
+ * @brief Specifies the type of function passed to iotcon_get_device_info().
+ * @details The @a result could be one of #iotcon_error_e.
*
* @since_tizen 3.0
*
* @param[in] result The result code (0 on success, other wise a negative error value)
* @param[in] user_data The user data to pass to the function
*
- * @pre iotcon_request_device_info() will invoke this callback function.
+ * @pre iotcon_get_device_info() will invoke this callback function.
*
- * @see iotcon_request_device_info()
+ * @see iotcon_get_device_info()
* @see iotcon_device_info_get_property()
*/
-typedef void (*iotcon_device_info_cb)(iotcon_device_info_h device_info, int result,
- void *user_data);
+typedef void (*iotcon_device_info_cb)(iotcon_device_info_h device_info,
+ iotcon_error_e result, void *user_data);
/**
- * @brief Calls a function for device information of remote server.
+ * @brief Gets the device information of remote server.
* @details Request device information to server and pass the information by calling
* iotcon_device_info_cb().\n
- * iotcon_device_info_cb() will be called when success on getting device information.
+ * @a host_address could be #IOTCON_MULTICAST_ADDRESS for IPv4 multicast.\n
+ * If succeed to getting device information, iotcon_device_info_cb() will be invoked with
+ * information.
*
* @since_tizen 3.0
* @privlevel public
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_PERMISSION_DENIED Permission denied
*
- * @post iotcon_device_info_cb() will be called when success on getting device information.
+ * @pre iotcon_connect() should be called to connect a connection to the iotcon.
+ * @post iotcon_device_info_cb() will be invoked.
*
* @see iotcon_device_info_cb()
* @see iotcon_device_info_get_property()
+ * @see iotcon_set_timeout()
*/
-int iotcon_request_device_info(const char *host_address,
+int iotcon_get_device_info(const char *host_address,
iotcon_connectivity_type_e connectivity_type,
iotcon_device_info_cb cb,
void *user_data);
/**
- * @brief Get device properties from the device information handle
+ * @brief Gets device properties from the device information handle
*
* @since_tizen 3.0
*
+ * @remarks @a value must not be released using free().
+ *
* @param[in] device_info The handle of the device information
* @param[in] property The properties of the device information
* @param[out] value The value of the property
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see iotcon_device_info_cb()
- * @see iotcon_request_device_info()
+ * @see iotcon_get_device_info()
*/
int iotcon_device_info_get_property(iotcon_device_info_h device_info,
iotcon_device_info_e property, char **value);
/**
- * @brief Specifies the type of function passed to iotcon_request_platform_info().
+ * @brief Specifies the type of function passed to iotcon_get_platform_info().
+ * @details The @a result could be one of #iotcon_error_e.
*
* @since_tizen 3.0
*
* @param[in] result The result code (0 on success, other wise a negative error value)
* @param[in] user_data The user data to pass to the function
*
- * @pre iotcon_request_platform_info() will invoke this callback function.
+ * @pre iotcon_get_platform_info() will invoke this callback function.
*
- * @see iotcon_request_platform_info()
+ * @see iotcon_get_platform_info()
* @see iotcon_platform_info_get_property()
*/
-typedef void (*iotcon_platform_info_cb)(iotcon_platform_info_h platform_info, int result,
- void *user_data);
+typedef void (*iotcon_platform_info_cb)(iotcon_platform_info_h platform_info,
+ iotcon_error_e result, void *user_data);
/**
- * @brief Calls a function for platform information of remote server.
+ * @brief Gets the platform information of remote server.
* @details Request platform information to server and pass the information by calling
* iotcon_platform_info_cb().\n
- * iotcon_platform_info_cb() will be called when success on getting device information.
+ * @a host_address could be #IOTCON_MULTICAST_ADDRESS for IPv4 multicast.\n
+ * If succeed to getting platform information, iotcon_platform_info_cb() will be invoked
+ * with information.
*
* @since_tizen 3.0
* @privlevel public
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_PERMISSION_DENIED Permission denied
*
- * @post iotcon_platform_info_cb() will be called when success on getting device information.
+ * @pre iotcon_connect() should be called to connect a connection to the iotcon.
+ * @post iotcon_platform_info_cb() will be invoked.
*
* @see iotcon_platform_info_cb()
* @see iotcon_platform_info_get_property()
+ * @see iotcon_set_timeout()
*/
-int iotcon_request_platform_info(const char *host_address,
+int iotcon_get_platform_info(const char *host_address,
iotcon_connectivity_type_e connectivity_type,
iotcon_platform_info_cb cb,
void *user_data);
/**
- * @brief Get platform properties from the platform information handle
+ * @brief Gets platform properties from the platform information handle
*
* @since_tizen 3.0
*
+ * @remarks @a value must not be released using free().
+ *
* @param[in] platform_info The handle of the platform information
* @param[in] property The properties of the platform information
* @param[out] value The value of the property
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see iotcon_platform_info_cb()
- * @see iotcon_request_platform_info()
+ * @see iotcon_get_platform_info()
*/
int iotcon_platform_info_get_property(iotcon_platform_info_h platform_info,
iotcon_platform_info_e property, char **value);
/**
- * @brief Specifies the type of function passed to iotcon_request_tizen_info().
+ * @brief Specifies the type of function passed to iotcon_get_tizen_info().
+ * @details The @a result could be one of #iotcon_error_e.
*
* @since_tizen 3.0
*
* @param[in] tizen_info The information of tizen device from remote server.
- * @param[in] response_result The response result code (Lesser than 0 on fail, otherwise a response result value)
+ * @param[in] result The result code (0 on success, other wise a negative error value)
* @param[in] user_data The user data to pass to the function
*
- * @pre iotcon_request_tizen_info() will invoke this callback function.
+ * @pre iotcon_get_tizen_info() will invoke this callback function.
*
- * @see iotcon_request_tizen_info()
+ * @see iotcon_get_tizen_info()
* @see iotcon_tizen_info_get_property()
*/
typedef void (*iotcon_tizen_info_cb)(iotcon_tizen_info_h tizen_info,
- int response_result, void *user_data);
+ iotcon_error_e result, void *user_data);
/**
- * @brief Calls a function for tizen device information of remote server.
+ * @brief Gets the tizen device information of remote server.
* @details Request tizen device information to server and pass the information by calling
* iotcon_tizen_info_cb().\n
- * iotcon_tizen_info_cb() will be called when success on getting tizen device information.
+ * If succeed to getting tizen information, iotcon_tizen_info_cb() will be invoked with
+ * information.
*
* @since_tizen 3.0
* @privlevel public
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_PERMISSION_DENIED Permission denied
*
- * @post iotcon_tizen_info_cb() will be called when success on getting tizen device information.
+ * @pre iotcon_connect() should be called to connect a connection to the iotcon.
+ * @post iotcon_tizen_info_cb() will be invoked.
*
* @see iotcon_tizen_info_cb()
* @see iotcon_tizen_info_get_property()
+ * @see iotcon_set_timeout()
*/
-int iotcon_request_tizen_info(const char *host_address,
+int iotcon_get_tizen_info(const char *host_address,
iotcon_connectivity_type_e connectivity_type,
iotcon_tizen_info_cb cb,
void *user_data);
/**
- * @brief Get tizen device properties from the tizen device information handle
+ * @brief Gets tizen device properties from the tizen device information handle
*
* @since_tizen 3.0
*
+ * @remarks @a value must not be released using free().
+ *
* @param[in] tizen_info The handle of the tizen device information
* @param[in] property The properties of the tizen device information
* @param[out] value The value of the property
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*
* @see iotcon_tizen_info_cb()
- * @see iotcon_request_tizen_info()
+ * @see iotcon_get_tizen_info()
*/
int iotcon_tizen_info_get_property(iotcon_tizen_info_h tizen_info,
- iotcon_tizen_info_e property, char **value);
+ iotcon_tizen_info_e property, char **value);
/**
* @}
* \#include <iotcon.h>
*
* @section CAPI_IOT_CONNECTIVITY_COMMON_MODULE_OVERVIEW Overview
- * This API set consists of data structures for @ref CAPI_IOT_CONNECTIVITY_COMMON_RESOURCE_TYPES_MODULE,
- * @ref CAPI_IOT_CONNECTIVITY_COMMON_QUERY_MODULE, @ref CAPI_IOT_CONNECTIVITY_COMMON_OPTIONS_MODULE,
- * @ref CAPI_IOT_CONNECTIVITY_COMMON_REPRESENTATION_MODULE, @ref CAPI_IOT_CONNECTIVITY_COMMON_LIST_MODULE,
- * @ref CAPI_IOT_CONNECTIVITY_COMMON_STATE_MODULE.
+ * This API set consists of data structures for
+ * @ref CAPI_IOT_CONNECTIVITY_COMMON_RESOURCE_TYPES_MODULE,
+ * @ref CAPI_IOT_CONNECTIVITY_COMMON_QUERY_MODULE,
+ * @ref CAPI_IOT_CONNECTIVITY_COMMON_OPTIONS_MODULE,
+ * @ref CAPI_IOT_CONNECTIVITY_COMMON_REPRESENTATION_MODULE,
+ * @ref CAPI_IOT_CONNECTIVITY_COMMON_LIST_MODULE,
+ * @ref CAPI_IOT_CONNECTIVITY_COMMON_STATE_MODULE,
+ * @ref CAPI_IOT_CONNECTIVITY_COMMON_RESPONSE_MODULE.
*
* @{
*/
/**
* @brief The handle of resource.
- * @details iotcon_resource_h is an opaque data structure to represent registered\n
- * resource by server. A resource has host_address, uri_path, resource types, interfaces\n
- * and internal handle. If observable attribute of resource is true, client can observe\n
- * this resource. When client request by CRUD functions, handler will be invoked\n
- * if registered. It could contain other resource as children.\n
+ * @details @a iotcon_resource_h is an opaque data structure to represent registered
+ * resource by server. A resource has host_address, uri_path, resource types, interfaces
+ * and internal handle. If observable attribute of resource is true, client can observe
+ * this resource. When client request by CRUD functions, handler will be invoked
+ * if registered. It could contain other resource as children.
*
* @since_tizen 3.0
*/
/**
* @brief The handle of lite resource.
- * @details iotcon_lite_resource_h is an opaque data structure to represent registered\n
- * resource by server. A resource has host_address, uri_path, resource types, and internal\n
- * handle. If observable attribute of resource is true, client can observe\n
- * this resource. When client request by GET / PUT / OBSERVE functions, handler will be\n
- * invoked, internally. Then, it sends the response to client, automatically.
+ * @details @a iotcon_lite_resource_h is an opaque data structure to represent registered
+ * resource by server. A resource has host_address, uri_path, resource types, and internal
+ * handle. If observable attribute of resource is true, client can observe
+ * this resource.
*
* @since_tizen 3.0
*/
/**
* @brief The handle of response
-* @details iotcon_response_h is an opaque data structure to respond to client.\n
-* iotcon_response_h is a data type of server's response which consists of result,
+* @details @a iotcon_response_h is an opaque data structure to respond to client.
+* @a iotcon_response_h is a data type of server's response which consists of result,
* header options, query, representation.
*
*
/**
* @brief The handle of request
-* @details iotcon_request_h is an opaque data structure to request to a particular resource.\n
-* iotcon_request_h is a data type of client's request which consists of header options,
+* @details @a iotcon_request_h is an opaque data structure to request to a particular resource.
+* @a iotcon_request_h is a data type of client's request which consists of header options,
* query, representation.
*
* @since_tizen 3.0
/**
* @brief The handle of remote resource
* @details When Client success to find out resource from remote server,
- * server's resource information is reorganized as iotcon_remote_resource_h by Iotcon.
- * Client can request CRUD to server by using this.\n
- * iotcon_remote_resource_h is an opaque data structure to have host_address, uri_path,\n
- * resource types, interfaces, options and device id.\n
- * If observable attribute is true, remote resource is observable.\n
+ * server's resource information is reorganized as @a iotcon_remote_resource_h by Iotcon.
+ * Client can request CRUD to server by using this.
+ * @a iotcon_remote_resource_h is an opaque data structure to have host_address, uri_path,
+ * resource types, interfaces, options and device id.
+ * If observable attribute is true, remote resource is observable.
* When you observe remote resource, observe_handle will be set.
*
* @since_tizen 3.0
/**
* @brief The handle of presence.
- * @details iotcon_presence_h is a handle of presence subscription.\n
+ * @details @a iotcon_presence_h is a handle of presence subscription.
* It is used to cancel presence.
*
* @since_tizen 3.0
/**
* @brief The handle of device information.
- * @details iotcon_device_info_h is a handle of device information.\n
+ * @details @a iotcon_device_info_h is a handle of device information.
*
* @since_tizen 3.0
*/
/**
* @brief The handle of platform information.
- * @details iotcon_platform_info_h is a handle of platform information.\n
+ * @details @a iotcon_platform_info_h is a handle of platform information.
*
* @since_tizen 3.0
*/
/**
* @brief The handle of tizen device information.
- * @details iotcon_tizen_info_h is a handle of tizen device information.\n
+ * @details @a iotcon_tizen_info_h is a handle of tizen device information.
*
* @since_tizen 3.0
*/
/**
* @brief The handle of resource types
- * @details iotcon_resource_types_h is an opaque data structure to have list\n
+ * @details @a iotcon_resource_types_h is an opaque data structure to have list
* of resource types. A resource type is datatype of string.
*
* @since_tizen 3.0
/**
* @brief The handle of options
- * @details iotcon_options_h is an opaque data structure to have attribute value map
- * which consists of a key and a value.\n
- * Datatype of key is integer and value is string.\n
+ * @details @a iotcon_options_h is an opaque data structure to have attribute value map
+ * which consists of a key and a value.
+ * Datatype of key is integer and value is string.
*
* @since_tizen 3.0
*/
/**
* @brief The handle of query
- * @details iotcon_query_h is an opaque data structure to have attribute value map
- * which consists of key and value.\n
- * Data ype of both key and value are string.\n
- * iotcon_query_h also have length.\n
- * The length is total length of all keys and values of map.\n
+ * @details @a iotcon_query_h is an opaque data structure to have attribute value map
+ * which consists of key and value.
+ * Data ype of both key and value are string.
+ * @a iotcon_query_h also have length.
+ * The length is total length of all keys and values of map.
* The length should be less than or equal to 64.
*
* @since_tizen 3.0
/**
* @brief The handle of representation.
- * @details iotcon_representation_h is an opaque data structure to have uri_path,\n
- * list of resource types and interfaces.\n
- * It could contain other representation as children.\n
+ * @details @a iotcon_representation_h is an opaque data structure to have uri_path,
+ * list of resource types and interfaces.
+ * It could contain other representation as children.
*
* @since_tizen 3.0
*/
/**
* @brief The handle of list which is consist of iotcon_value_h type values.
- * @details iotcon_list_h is an opaque data structure to have iotcon_value_h type values.
+ * @details @a iotcon_list_h is an opaque data structure.
*
* @since_tizen 3.0
*/
/**
* @brief The handle of state.
- * @details iotcon_state_h is an opaque data structure to have attribute value map.\n
- * Attribute value map consists of a key and a value.\n
- * Datatype of the key is string and the value should be one of them\n
- * #IOTCON_TYPE_INT\n
- * #IOTCON_TYPE_BOOL\n
- * #IOTCON_TYPE_DOUBLE\n
- * #IOTCON_TYPE_STR\n
- * #IOTCON_TYPE_NULL\n
- * #IOTCON_TYPE_LIST\n
- * #IOTCON_TYPE_STATE
+ * @details @a iotcon_state_h is an opaque data structure to have attribute value map.
+ * Attribute value map consists of a key and a value.
+ * Datatype of the key is string and the value should be one of them #IOTCON_TYPE_INT,
+ * #IOTCON_TYPE_BOOL, #IOTCON_TYPE_DOUBLE, #IOTCON_TYPE_STR, #IOTCON_TYPE_NULL,
+ * #IOTCON_TYPE_LIST and #IOTCON_TYPE_STATE
*
* @since_tizen 3.0
*/
typedef enum {
IOTCON_CONNECTIVITY_IPV4 = 0, /**< Indicates Internet Protocol version 4 connectivity */
IOTCON_CONNECTIVITY_IPV6, /**< Indicates Internet Protocol version 6 connectivity */
- IOTCON_CONNECTIVITY_EDR, /**< Indicates Bluetooth Enhanced Data Rate connectivity */
- IOTCON_CONNECTIVITY_LE, /**< Indicates Bluetooth Low Energy connectivity */
- IOTCON_CONNECTIVITY_ALL, /**< Indicates all (IPV4 + IPV6 + EDR + LE) connectivities */
+ IOTCON_CONNECTIVITY_BT_EDR, /**< Indicates Bluetooth Enhanced Data Rate connectivity */
+ IOTCON_CONNECTIVITY_BT_LE, /**< Indicates Bluetooth Low Energy connectivity */
+ IOTCON_CONNECTIVITY_ALL, /**< Indicates all connectivities */
} iotcon_connectivity_type_e;
/**
*/
typedef enum {
IOTCON_TIZEN_INFO_DEVICE_NAME = 0, /**< Indicates human friendly name for device */
- IOTCON_TIZEN_INFO_TIZEN_DEVICE_ID, /**< Indicates unique identifier for tizen device */
+ IOTCON_TIZEN_INFO_TIZEN_DEVICE_ID, /**< Indicates randomly generated id value for tizen device */
} iotcon_tizen_info_e;
/**
int iotcon_start_presence(unsigned int time_to_live);
/**
- * @brief Stop presence of a server.
+ * @brief Stops presence of a server.
* @details Use this function to stop sending server's announcements to clients.
* Server can call this function when terminating, entering to offline or out of network.
*
*
* @since_tizen 3.0
*
+ * @remarks You must destroy @a list by calling iotcon_list_destroy()
+ * if @a list is no longer needed.
+ *
* @param[in] type The type of list
* @param[out] list A newly allocated list handle
*
int iotcon_list_create(iotcon_types_e type, iotcon_list_h *list);
/**
- * @brief Frees a list handle.
+ * @brief Destroys a list handle.
* @details Releases a @a list and its internal data.
*
* @since_tizen 3.0
void iotcon_list_destroy(iotcon_list_h list);
/**
- * @brief Inserts a new element integer value into the list at the given position.
+ * @brief Adds a new element integer value into the list at the given position.
* @details If @a pos is negative, or is larger than the number of elements in the list,
* the new value is added on to the end of the list.
*
int iotcon_list_add_int(iotcon_list_h list, int val, int pos);
/**
- * @brief Inserts a new element boolean value into the list at the given position.
+ * @brief Adds a new element boolean value into the list at the given position.
* @details If @a pos is negative, or is larger than the number of elements in the list,
* the new value is added on to the end of the list.
*
int iotcon_list_add_bool(iotcon_list_h list, bool val, int pos);
/**
- * @brief Inserts a new element double value into the list at the given position.
+ * @brief Adds a new element double value into the list at the given position.
* @details If @a pos is negative, or is larger than the number of elements in the list,
* the new value is added on to the end of the list.
*
int iotcon_list_add_double(iotcon_list_h list, double val, int pos);
/**
- * @brief Inserts a new element string value into the list at the given position.
+ * @brief Adds a new element string value into the list at the given position.
* @details If @a pos is negative, or is larger than the number of elements in the list,
* the new value is added on to the end of the list.
*
int iotcon_list_add_str(iotcon_list_h list, char *val, int pos);
/**
- * @brief Inserts a new element list into the list at the given position.
+ * @brief Adds a new element list into the list at the given position.
* @details If @a pos is negative, or is larger than the number of elements in the list,
* the new value is added on to the end of the list.
*
int iotcon_list_add_list(iotcon_list_h list, iotcon_list_h val, int pos);
/**
- * @brief Inserts a new element state value into the list at the given position.
+ * @brief Adds a new element state value into the list at the given position.
* @details If @a pos is negative, or is larger than the number of elements in the list,
* the new value is added on to the end of the list.
*
*
* @since_tizen 3.0
*
+ * @remarks @a val must not be released using free().
+ *
* @param[in] list The list handle
* @param[in] pos The position
* @param[out] val The string value to get
*
* @since_tizen 3.0
*
+ * @remarks @a dest must not be released using iotcon_list_destroy().
+ *
* @param[in] src The list handle
* @param[in] pos The position
* @param[out] dest The list value to get
*
* @since_tizen 3.0
*
+ * @remarks @a state must not be released using iotcon_state_destroy().
+ *
* @param[in] list The list handle
* @param[in] pos The position
* @param[out] state The state value to get
int iotcon_list_get_nth_state(iotcon_list_h list, int pos, iotcon_state_h *state);
/**
- * @brief Deletes the value at the given position.
+ * @brief Removes the value at the given position.
* @details Iterates over the list until it reaches the @a pos-1 position.
*
* @since_tizen 3.0
* @ingroup CAPI_IOT_CONNECTIVITY_SERVER_MODULE
* @defgroup CAPI_IOT_CONNECTIVITY_SERVER_LITE_RESOURCE_MODULE Lite Resource
*
- * @brief Iotcon Lite Resource provides API to encapsulate resources.\n
- * This API provides that the users manages resources, simply.
+ * @brief Iotcon Lite Resource provides API to encapsulate resources.
+ *
+ * @section CAPI_IOT_CONNECTIVITY_SERVER_LITE_RESOURCE_MODULE_OVERVIEW Overview
+ * This API provides that the users manages resources without request handler.
+ * When client request by CRUD functions, internal default request handler will be invoked.
+ * The default request handler will create response and send to client automatically.
+ * When updated state by iotcon_lite_update_state(), changes will notify to observers.
*
* @section CAPI_IOT_CONNECTIVITY_SERVER_LITE_RESOURCE_MODULE_HEADER Header
* \#include <iotcon.h>
*/
/**
- * @brief Create a lite resource handle and registers the resource in server
+ * @brief Creates a lite resource handle and registers the resource in server
* @details Registers a resource specified by @a uri_path, @a res_types, @a state which have
* @a properties in Iotcon server.\n
* When client requests some operations, it send a response to client, automatically.\n
* @privilege %http://tizen.org/privilege/internet
*
* @remarks @a uri_path length must be less than or equal 36.\n
- * You must unregister resource by calling iotcon_resource_destroy()
- * if resource is no longer needed.
+ * You must destroy @a resource_handle by calling iotcon_lite_resource_destroy()
+ * if @a remote_handle is no longer needed.
*
* @param[in] uri_path The URI path of the resource.
* @param[in] res_types The list of type of the resource.
iotcon_lite_resource_h *resource_handle);
/**
- * @brief Destroy the resource and releases its data.
+ * @brief Destroys the resource and releases its data.
*
* @since_tizen 3.0
* @privlevel public
int iotcon_lite_resource_destroy(iotcon_lite_resource_h resource);
/**
- * @brief Update state into the lite resource handle
+ * @brief Updates state into the lite resource handle
*
* @since_tizen 3.0
*
iotcon_state_h state);
/**
- * @brief Get state from the lite resource handle
+ * @brief Gets state from the lite resource handle
*
* @since_tizen 3.0
*
+ * @remarks @a state must not be released using iotcon_state_destroy().
+ *
* @param[in] resource The handle of the lite resource
* @param[out] state The state handle of the lite resource
*
*
* @since_tizen 3.0
*
- * @param[out] ret_observers A newly allocated list of observers handle
+ * @remarks You must destroy @a observers by calling iotcon_observers_destroy()
+ * if @a observers is no longer needed.
+ *
+ * @param[out] observers A newly allocated list of observers handle
*
* @return 0 on success, otherwise a negative error value.
* @retval #IOTCON_ERROR_NONE Successful
* @see iotcon_observers_add()
* @see iotcon_observers_remove()
*/
-int iotcon_observers_create(iotcon_observers_h *ret_observers);
+int iotcon_observers_create(iotcon_observers_h *observers);
/**
- * @brief Free a observers handle.
+ * @brief Destroys a observers handle.
*
* @since_tizen 3.0
*
int iotcon_observers_add(iotcon_observers_h observers, int obs_id);
/**
- * @brief Remove id from the observers.
+ * @brief Removes id from the observers.
*
* @since_tizen 3.0
*
*
* @since_tizen 3.0
*
+ * @remarks You must destroy @a options by calling iotcon_options_destroy()
+ * if @a options is no longer needed.
+ *
* @param[out] options A newly allocated option handle
*
* @return 0 on success, otherwise a negative error value.
int iotcon_options_create(iotcon_options_h *options);
/**
- * @brief Free an option handle.
+ * @brief Destroys an option handle.
*
* @since_tizen 3.0
*
void iotcon_options_destroy(iotcon_options_h options);
/**
- * @brief Inserts a new id and a correspoding data into the options.
+ * @brief Adds a new id and a correspoding data into the options.
*
* @since_tizen 3.0
* @remarks iotcon_options_h can have up to 2 options. \n
const char *data);
/**
- * @brief Deletes the id and its associated data from the options.
+ * @brief Removes the id and its associated data from the options.
*
* @since_tizen 3.0
*
*
* @since_tizen 3.0
*
+ * @remarks @a data must not be released using free().
+ *
* @param[in] options The handle of the options
* @param[in] id The id of the option to lookup
* @param[out] data Found data from options
*
* @since_tizen 3.0
*
+ * @remarks You must destroy @a query by calling iotcon_query_destroy()
+ * if @a query is no longer needed.
+ *
* @param[out] query A newly allocated query handle
*
* @return 0 on success, otherwise a negative error value.
int iotcon_query_create(iotcon_query_h *query);
/**
- * @brief Free a query handle.
+ * @brief Destroys a query handle.
*
* @since_tizen 3.0
*
void iotcon_query_destroy(iotcon_query_h query);
/**
- * @brief Get resource types from the query.
+ * @brief Gets resource types from the query.
*
* @since_tizen 3.0
+ *
* @remarks @a types must not be released using iotcon_resource_types_destroy().
*
* @param[in] query The handle of the query
int iotcon_query_get_resource_tyeps(iotcon_query_h query, iotcon_resource_types_h *types);
/**
- * @brief Get resource types from the query.
+ * @brief Gets resource types from the query.
* @details @a iface could be one of #iotcon_interface_e.
*
* @since_tizen 3.0
int iotcon_query_set_interface(iotcon_query_h query, iotcon_interface_e iface);
/**
- * @brief Inserts a new key and correspoding value into the query.
+ * @brief Adds a new key and correspoding value into the query.
*
* @since_tizen 3.0
* @remarks The full length of query should be less than or equal to 64.
int iotcon_query_add(iotcon_query_h query, const char *key, const char *value);
/**
- * @brief Deletes the key and its associated value from the query.
+ * @brief Removes the key and its associated value from the query.
*
* @since_tizen 3.0
*
int iotcon_query_remove(iotcon_query_h query, const char *key);
/**
- * @brief Lookup data at the given key from the query.
+ * @brief Looks up data at the given key from the query.
*
* @since_tizen 3.0
*
+ * @remarks @a data must not be released using free().
+ *
* @param[in] query The handle of the query
* @param[in] key The key of the query to lookup
* @param[out] data Found data from query
/**
* @brief Creates a new resource handle.
- * @details Creates a resource proxy object so that get/put/observe functionality can be used
- * without discovering the object in advance.\n
+ * @details Creates a resource proxy object so that iotcon_remote_resource_get(),
+ * iotcon_remote_resource_put(), iotcon_remote_resource_post(),
+ * iotcon_remote_resource_delete(), iotcon_remote_resource_start_observing(),
+ * iotcon_remote_resource_start_caching() and iotcon_remote_resource_start_monitoring()
+ * API can be used without discovering the object in advance.\n
* To use this API, you should provide all of the details required to correctly contact and
* observe the object.\n
* If not, you should discover the resource object manually.
*
* @since_tizen 3.0
*
+ * @remarks You must destroy @a remote_resource by calling iotcon_remote_resource_destroy()
+ * if @a remote_resource is no longer needed.
+ *
* @param[in] host_address The host address of the resource
* @param[in] connectivity_type The connectivity type
* @param[in] uri_path The URI path of the resource.
* @param[in] is_observable Allow observation
* @param[in] resource_types The resource type of the resource. For example, "core.light"
* @param[in] resource_ifaces The resource interfaces (whether it is collection etc)
- * @param[out] client_handle Generated resource handle
+ * @param[out] remote_resource Generated resource handle
*
* @return 0 on success, otherwise a negative error value.
* @retval #IOTCON_ERROR_NONE Successful
bool is_observable,
iotcon_resource_types_h resource_types,
int resource_ifaces,
- iotcon_remote_resource_h *client_handle);
+ iotcon_remote_resource_h *remote_resource);
/**
- * @brief Releases a resource handle.
+ * @brief Destroys a resource handle.
* @details Decrements reference count of the source resource.\n
* If the reference count drops to 0, releases a resource handle.
*
void iotcon_remote_resource_destroy(iotcon_remote_resource_h resource);
/**
- * @brief Makes a clone of a remote resource.
+ * @brief Clones a clone of a remote resource.
*
* @since_tizen 3.0
*
+ * @remarks You must destroy @a dest by calling iotcon_remote_resource_destroy()
+ * if @a dest is no longer needed.
+ *
* @param[in] src The Source of resource
* @param[out] dest The cloned resource handle
*
void *user_data);
/**
- * @brief Sets observation on the resource
+ * @brief Starts observing on the resource
* @details When server sends notification message, iotcon_remote_resource_response_cb() will be called.
* The @a observe_type could be one of #iotcon_observe_type_e.
*
* @post When the @a resource receive notification message, iotcon_remote_resource_response_cb() will be called.
*
* @see iotcon_remote_resource_response_cb()
- * @see iotcon_remote_resource_observer_stop()
+ * @see iotcon_remote_resource_stop_observing()
* @see iotcon_resource_notify()
*/
int iotcon_remote_resource_start_observing(iotcon_remote_resource_h resource,
void *user_data);
/**
- * @brief Cancels the observation on the resource
+ * @brief Stops observing on the resource
*
* @since_tizen 3.0
* @privlevel public
* @see iotcon_remote_resource_start_observing()
* @see iotcon_resource_notify()
*/
-int iotcon_remote_resource_observer_stop(iotcon_remote_resource_h resource);
+int iotcon_remote_resource_stop_observing(iotcon_remote_resource_h resource);
/**
* @brief Gets the attributes of a resource.
* @see iotcon_remote_resource_response_cb()
* @see iotcon_remote_resource_put()
* @see iotcon_remote_resource_post()
+ * @see iotcon_set_timeout()
*/
int iotcon_remote_resource_get(iotcon_remote_resource_h resource, iotcon_query_h query,
iotcon_remote_resource_response_cb cb, void *user_data);
/**
- * @brief Sets the representation of a resource (via PUT)
+ * @brief Puts the representation of a resource
* @details When server sends response on put request, iotcon_remote_resource_response_cb() will be called.
*
* @since_tizen 3.0
* @see iotcon_remote_resource_response_cb()
* @see iotcon_remote_resource_get()
* @see iotcon_remote_resource_post()
+ * @see iotcon_set_timeout()
*/
int iotcon_remote_resource_put(iotcon_remote_resource_h resource,
iotcon_representation_h repr,
* @see iotcon_remote_resource_response_cb()
* @see iotcon_remote_resource_get()
* @see iotcon_remote_resource_put()
+ * @see iotcon_set_timeout()
*/
int iotcon_remote_resource_post(iotcon_remote_resource_h resource,
iotcon_representation_h repr,
* @post When the client receive delete response, iotcon_remote_resource_response_cb() will be called.
*
* @see iotcon_remote_resource_response_cb()
+ * @see iotcon_set_timeout()
*/
int iotcon_remote_resource_delete(iotcon_remote_resource_h resource,
iotcon_remote_resource_response_cb cb, void *user_data);
void *user_data);
/**
- * @brief Start caching of a remote resource.
- * @details Use this function to start caching the resource's attribute data (state).\n
+ * @brief Starts caching of a remote resource.
+ * @details Use this function to start caching the resource's attribute.\n
* Default caching time interval is 10 seconds.
* Internally, it operates GET method, periodically, and it observes the remote resource.
*
void *user_data);
/**
- * @brief Stop caching of a remote resource.
- * @details Use this function to stop caching the resource's attribute data (state).\n
+ * @brief Stops caching of a remote resource.
+ * @details Use this function to stop caching the resource's attribute.\n
*
* @since_tizen 3.0
* @privlevel public
iotcon_remote_resource_state_e state, void *user_data);
/**
- * @brief Start monitoring of a remote resource.
+ * @brief Starts monitoring of a remote resource.
* @details When remote resource's state are changed, registered callbacks will be called\n
* in turn. Default monitoring time interval is 10 seconds.
* Internally, it operates GET method, periodically, and it subscribes the devices's presence.
void *user_data);
/**
- * @brief Stop monitoring.
+ * @brief Stops monitoring of a remote resource.
* @details Use this function to stop monitoring the remote resource.
*
* @since_tizen 3.0
* @brief Gets an URI path of the remote resource
*
* @since_tizen 3.0
+ *
* @remarks @a uri_path must not be released using free().
*
* @param[in] resource The handle of the remote resource
* @brief Gets an host address of the remote resource
*
* @since_tizen 3.0
+ *
* @remarks @a host_address must not be released using free().
*
* @param[in] resource The handle of the remote resource
* @brief Gets an device id of the remote resource
*
* @since_tizen 3.0
+ *
* @remarks @a device_id must not be released using free().
*
* @param[in] resource The handle of the remote resource
*
* @since_tizen 3.0
*
+ * @remarks @a types must not be released using iotcon_resource_types_destroy().
+ *
* @param[in] resource The handle of the remote resource
* @param[out] types The resource types of the remote resource
*
iotcon_options_h options);
/**
- * @brief Get cached representation from the remote resource
+ * @brief Gets cached representation from the remote resource
*
* @since_tizen 3.0
*
+ * @remarks @a representation must not be released using iotcon_representation_destroy().
+ *
* @param[in] resource The handle of the remote resource
* @param[out] representation The handle of the representation
*
*
* @since_tizen 3.0
*
+ * @remarks You must destroy @a repr by calling iotcon_representation_destroy()
+ * if @a repr is no longer needed.
+ *
* @param[out] repr A newly allocated representation handle
*
* @return 0 on success, otherwise a negative error value.
int iotcon_representation_create(iotcon_representation_h *repr);
/**
- * @brief Frees a representation.
+ * @brief Destroys a representation.
* @details Releases a @a representation and its internal data.
*
* @since_tizen 3.0
*
* @since_tizen 3.0
*
+ * @remarks You must destroy @a dest by calling iotcon_representation_destroy()
+ * if @a dest is no longer needed.
+ *
* @param[in] src Source of representation to be copied
* @param[out] dest Clone of a source representation
*
*
* @since_tizen 3.0
*
+ * @remarks @a uri_path must not be released using free().
+ *
* @param[in] repr The representation handle
* @param[out] uri_path The URI path to get
*
*
* @since_tizen 3.0
*
+ * @remarks @a types must not be released using iotcon_resource_types_destroy().
+ *
* @param[in] repr The representation handle
* @param[out] types The list of resource types to get
*
typedef bool (*iotcon_children_cb)(iotcon_representation_h child, void *user_data);
/**
- * @brief Call a function for each children representation of parent.
+ * @brief Calls a function for each children representation of parent.
* @details iotcon_children_cb() will be called for each child.
*
* @since_tizen 3.0
*
* @since_tizen 3.0
*
+ * @remarks @a child must not be released using iotcon_representation_destroy().
+ *
* @param[in] parent The parent representation handle
* @param[in] pos The position of the child representation
* @param[out] child The handle to the child representation
*
* @since_tizen 3.0
*
+ * @remarks @a host_address must not be released using free().
+ *
* @param[in] request The handle of the request
* @param[out] host_address The host address of the request
*
*/
int iotcon_request_get_connectivity_type(iotcon_request_h request,
int *connectivity_type);
-
+
/**
* @brief Gets an representation of the request
*
* @since_tizen 3.0
- * @remarks @a repr must not be released using free().
+ *
+ * @remarks @a repr must not be released using iotcon_representation_destroy().
*
* @param[in] request The handle of the request
* @param[out] repr The representation of the request
iotcon_representation_h *repr);
/**
- * @brief Get types of the request
+ * @brief Gets types of the request
*
* @since_tizen 3.0
*
int iotcon_request_get_types(iotcon_request_h request, int *types);
/**
- * @brief Get options of the request
+ * @brief Gets options of the request
*
* @since_tizen 3.0
- * @remarks @a options must not be released using free().
+ *
+ * @remarks @a options must not be released using iotcon_options_destroy().
*
* @param[in] request The handle of the request
* @param[out] options The options of the request
int iotcon_request_get_options(iotcon_request_h request, iotcon_options_h *options);
/**
- * @brief Get query of the request
+ * @brief Gets query of the request
*
* @since_tizen 3.0
- * @remarks @a query must not be released using free().
+ *
+ * @remarks @a query must not be released using iotcon_query_destroy().
*
* @param[in] request The handle of the request
* @param[out] query The query of the request
int iotcon_request_get_query(iotcon_request_h request, iotcon_query_h *query);
/**
- * @brief Get observation action of the request
+ * @brief Gets observation action of the request
*
* @since_tizen 3.0
* @details The @a action could be one of #iotcon_observe_action_e.
int iotcon_request_get_observer_action(iotcon_request_h request, int *action);
/**
- * @brief Get observation id of the request
+ * @brief Gets observation id of the request
*
* @since_tizen 3.0
*
*
* @since_tizen 3.0
*
- * @param[out] ret_types A newly allocated list of resource types handle
+ * @remarks You must destroy @a types by calling iotcon_resource_types_destroy()
+ * if @a types is no longer needed.
+ *
+ * @param[out] types A newly allocated list of resource types handle
*
* @return 0 on success, otherwise a negative error value.
* @retval #IOTCON_ERROR_NONE Successful
* @see iotcon_resource_types_remove()
* @see iotcon_resource_types_clone()
*/
-int iotcon_resource_types_create(iotcon_resource_types_h *ret_types);
+int iotcon_resource_types_create(iotcon_resource_types_h *types);
/**
- * @brief Free a resource types handle.
+ * @brief Destroys a resource types handle.
*
* @since_tizen 3.0
*
*
* @since_tizen 3.0
*
+ * @remarks You must @a destroy dest by calling iotcon_resource_types_destroy()
+ * if @a dest is no longer needed.
+ *
* @param[in] src The origin handle of the resource types
* @param[out] dest Clone of a source list of resource types
*
iotcon_request_h request, void *user_data);
/**
- * @brief Create a resource handle and registers the resource in server
+ * @brief Creates a resource handle and registers the resource in server
* @details Registers a resource specified by @a uri_path, @a res_types, @a ifaces which have
* @a properties in Iotcon server.\n
* When client find the registered resource, iotcon_request_handler_cb() will be called automatically.\n
* @privilege %http://tizen.org/privilege/internet
*
* @remarks @a uri_path length must be less than or equal 36.\n
- * You must unregister resource by calling iotcon_resource_destroy()
- * if resource is no longer needed.
+ * You must destroy @a resource by calling iotcon_resource_destroy()
+ * if @a resource is no longer needed.
*
* @param[in] uri_path The URI path of the resource.
* @param[in] res_types The list of type of the resource.
iotcon_resource_h *resource_handle);
/**
- * @brief Destroy the resource and releases its data.
+ * @brief Destroys the resource and releases its data.
*
* @since_tizen 3.0
* @privlevel public
/**
* @brief Binds an interface to the resource
*
- * @details The @a action could be one of #iotcon_interface_e.
+ * @details The @a iface could be one of #iotcon_interface_e.
* @since_tizen 3.0
* @privlevel public
* @privilege %http://tizen.org/privilege/internet
*
- * @remarks Set only one interface to @a iface. If not, @a iface will be ignored.
+ * @remarks Sets only one interface to @a iface. If not, @a iface will be ignored.
*
* @param[in] resource The handle of the resource
* @param[in] iface The interface to be bound to the resource
*
* @see iotcon_remote_resource_response_cb()
* @see iotcon_remote_resource_start_observing()
- * @see iotcon_remote_resource_observer_stop()
+ * @see iotcon_remote_resource_stop_observing()
* @see iotcon_observers_create()
* @see iotcon_observers_destroy()
* @see iotcon_observers_add()
*
* @since_tizen 3.0
*
+ * @remarks @a child must not be released using iotcon_resource_destroy().
+ *
* @param[in] parent The handle of the parent resource
* @param[in] index The index of the child resource
* @param[out] child The child resource at the index
*
* @since_tizen 3.0
*
+ * @remarks @a uri_path must not be released using free().
+ *
* @param[in] resource The handle of the resource
* @param[out] uri_path The URI path of the resource
*
int iotcon_resource_get_uri_path(iotcon_resource_h resource, char **uri_path);
/**
- * @brief Get the list of types in the resource
+ * @brief Gets the list of types in the resource
*
* @since_tizen 3.0
*
+ * @remarks @a types must not be released using iotcon_resource_types_destroy().
+ *
* @param[in] resource The handle of the resource
* @param[out] types The types of the resource
*
int iotcon_resource_get_types(iotcon_resource_h resource, iotcon_resource_types_h *types);
/**
- * @brief Get the interfaces of the resource
+ * @brief Gets the interfaces of the resource
*
* @since_tizen 3.0
*
*
* @brief Iotcon Response provides API to manage response.
*
- * @section CAPI_IOT_CONNECTIVITY_SERVER_RESPONSE_MODULE_HEADER Header
+ * @section CAPI_IOT_CONNECTIVITY_COMMON_RESPONSE_MODULE_HEADER Header
* \#include <iotcon.h>
*
* @{
*
* @since_tizen 3.0
*
+ * @remarks You must destroy @a response by calling iotcon_response_destroy()
+ * if @a response is no longer needed.
+ *
* @param[in] request The handle of received request handle
* @param[out] response Generated response handle
*
int iotcon_response_create(iotcon_request_h request, iotcon_response_h *response);
/**
- * @brief Free a response handle.
+ * @brief Destroys a response handle.
*
* @since_tizen 3.0
*
*
* @since_tizen 3.0
*
+ * @remarks @a options must not be released using iotcon_options_destroy().
+ *
* @param[in] resp The handle of the response
* @param[out] options The handle of the header options
*
*
* @since_tizen 3.0
*
+ * @remarks @a repr must not be released using iotcon_representation_destroy().
+ *
* @param[in] resp The handle of the response
* @param[out] repr The handle of the representation
*
* @since_tizen 3.0
*
* @param[in] resp The handle of the response
+ * @param[in] iface The interface of the representation
* @param[in] repr The representation of the response
*
* @return 0 on success, otherwise a negative error value.
* \#include <iotcon.h>
*
* @section CAPI_IOT_CONNECTIVITY_SERVER_MODULE_OVERVIEW Overview
- * This API set consists of server side API for @ref CAPI_IOT_CONNECTIVITY_SERVER_RESOURCE_MODULE,
- * @ref CAPI_IOT_CONNECTIVITY_SERVER_LITE_RESOURCE_MODULE, @ref CAPI_IOT_CONNECTIVITY_SERVER_NOTIMSG_MODULE,
- * @ref CAPI_IOT_CONNECTIVITY_SERVER_OBSERVERS_MODULE, @ref CAPI_IOT_CONNECTIVITY_SERVER_REQUEST_MODULE,
- * @ref CAPI_IOT_CONNECTIVITY_SERVER_RESPONSE_MODULE.
+ * This API set consists of server side API for
+ * @ref CAPI_IOT_CONNECTIVITY_SERVER_RESOURCE_MODULE,
+ * @ref CAPI_IOT_CONNECTIVITY_SERVER_LITE_RESOURCE_MODULE,
+ * @ref CAPI_IOT_CONNECTIVITY_SERVER_OBSERVERS_MODULE,
+ * @ref CAPI_IOT_CONNECTIVITY_SERVER_REQUEST_MODULE.
*
* @{
*/
*
* @since_tizen 3.0
*
+ * @remarks You must destroy @a state by calling iotcon_state_destroy()
+ * if @a state is no longer needed.
+ *
* @param[out] state A newly allocated state handle
*
* @return 0 on success, otherwise a negative error value.
int iotcon_state_create(iotcon_state_h *state);
/**
- * @brief Frees a state.
+ * @brief Destroys a state.
* @details Releases a @a state and its internal data.
*
* @since_tizen 3.0
*
* @since_tizen 3.0
*
+ * @remarks @a val must not be released using free().
+ *
* @param[in] state The state handle
* @param[in] key The key
* @param[out] val The string value
*
* @since_tizen 3.0
*
+ * @remarks @a list must not be released using iotcon_list_destroy().
+ *
* @param[in] state The state handle
* @param[in] key The key
* @param[out] list The list value
*
* @since_tizen 3.0
*
+ * @remarks @a state must not be released using iotcon_state_destroy().
+ *
* @param[in] src The state handle
* @param[in] key The key
* @param[out] dest The state value at the key
int iotcon_state_is_null(iotcon_state_h state, const char *key, bool *is_null);
/**
- * @brief Deletes the key and its associated value from the state.
+ * @brief Unsets the key and its associated value from the state.
*
* @since_tizen 3.0
*
typedef int (*iotcon_state_cb)(iotcon_state_h state, const char *key, void *user_data);
/**
- * @brief Call a function for each element of state.
+ * @brief Calls a function for each element of state.
* @details iotcon_state_cb() will be called for each child.
*
* @since_tizen 3.0
* @retval #IOTCON_ERROR_DBUS Dbus error
*
* @see iotcon_disconnect()
+ * @see iotcon_add_connection_changed_cb()
+ * @see iotcon_remove_connection_changed_cb()
*/
int iotcon_connect(void);
* @return void
*
* @see iotcon_connect()
+ * @see iotcon_add_connection_changed_cb()
+ * @see iotcon_remove_connection_changed_cb()
*/
void iotcon_disconnect(void);
/**
- * @brief Gets timeout of asynchronous APIs.
+ * @brief Gets the timeout seconds of iotcon_get_device_info(),
+ * iotcon_get_platform_info(), iotcon_get_tizen_info(), iotcon_find_resource(),
+ * iotcon_remote_resource_get(), iotcon_remote_resource_put(),
+ * iotcon_remote_resource_post() and iotcon_remote_resource_delete().
*
* @since_tizen 3.0
*
*
* @return 0 on success, otherwise a negative error value.
* @retval #IOTCON_ERROR_NONE Successful
- * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*
* @pre iotcon_connect() should be called to connect a connection to the iotcon.
*
- * @see iotcon_get_device_info()
- * @see iotcon_get_platform_info()
- * @see iotcon_get_tizen_info()
- * @see iotcon_find_resource()
- * @see iotcon_remote_resource_get()
- * @see iotcon_remote_resource_put()
- * @see iotcon_remote_resource_post()
- * @see iotcon_remote_resource_delete()
+ * @see iotcon_set_timeout()
*/
int iotcon_get_timeout(int *timeout_seconds);
-
/**
- * @brief Set timeout of asynchronous APIs.
- * @details Default timeout is 10 seconds.
- * Maximum timeout is 60 seconds.
+ * @brief Sets the timeout seconds of iotcon_get_device_info(),
+ * iotcon_get_platform_info(), iotcon_get_tizen_info(), iotcon_find_resource(),
+ * iotcon_remote_resource_get(), iotcon_remote_resource_put(),
+ * iotcon_remote_resource_post() and iotcon_remote_resource_delete().
+ * @details Default timeout interval is 10 seconds.
+ * Maximum timeout interval is 60 seconds.
*
* @since_tizen 3.0
*
* @param[in] timeout_seconds Seconds for timeout
*
- * @return 0 on success, otherwise a negative error value.
- * @retval #IOTCON_ERROR_NONE Successful
- * @retval #IOTCON_ERROR_DBUS Dbus error
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE Successful
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #IOTCON_ERROR_DBUS Dbus error
*
* @pre iotcon_connect() should be called to connect a connection to the iotcon.
*
- * @see iotcon_request_device_info()
- * @see iotcon_request_platform_info()
- * @see iotcon_request_tizen_info()
- * @see iotcon_find_resource()
- * @see iotcon_remote_resource_get()
- * @see iotcon_remote_resource_put()
- * @see iotcon_remote_resource_post()
- * @see iotcon_remote_resource_delete()
+ * @see iotcon_get_timeout()
*/
int iotcon_set_timeout(int timeout_seconds);
* @pre The callback must be registered using iotcon_add_connection_changed_cb()\n
* The callback must be unregistered using iotcon_remove_connection_changed_cb()\n
*
+ * @see iotcon_connect()
+ * @see iotcon_disconnect()
* @see iotcon_add_connection_changed_cb()
* @see iotcon_remove_connection_changed_cb()
*/
/**
* @brief Adds a callback to Iotcon
- * @details When Iotcon connection status is changed, registered callbacks will be called in turn.
+ * @details When Iotcon connection status is changed with unexpected reason, registered
+ * callbacks will be called in turn. The handles are validate no more after broken connection.
+ * The handles must creates again when connection recovered.
*
* @since_tizen 3.0
*
* @retval #IOTCON_ERROR_OUT_OF_MEMORY Out of memory
* @retval #IOTCON_ERROR_DBUS Dbus error
*
+ * @pre iotcon_connect() should be called to connect a connection to the iotcon.
+ *
+ * @see iotcon_connect()
+ * @see iotcon_disconnect()
* @see iotcon_remove_connection_changed_cb()
* @see iotcon_connection_changed_cb()
*/
* @retval #IOTCON_ERROR_NONE Successful
* @retval #IOTCON_ERROR_INVALID_PARAMETER Invalid parameter
*
+ * @pre iotcon_connect() should be called to connect a connection to the iotcon.
+ *
+ * @see iotcon_connect()
+ * @see iotcon_disconnect()
* @see iotcon_add_connection_changed_cb()
* @see iotcon_connection_changed_cb()
*/
i++;
if (2 == i) {
- iotcon_remote_resource_observer_stop(resource);
+ iotcon_remote_resource_stop_observing(resource);
iotcon_remote_resource_destroy(resource);
}
}
return strcmp(a, b);
}
-static void _request_tizen_info(iotcon_tizen_info_h info, int response_result,
+static void _request_tizen_info(iotcon_tizen_info_h info, iotcon_error_e result,
void *user_data)
{
int ret;
char *device_name = NULL;
char *tizen_device_id = NULL;
- RETM_IF(IOTCON_RESPONSE_RESULT_OK != response_result,
- "_request_tizen_info Response error(%d)", response_result);
+ RETM_IF(IOTCON_ERROR_NONE != result,
+ "_request_tizen_info Response error(%d)", result);
ret = iotcon_tizen_info_get_property(info, IOTCON_TIZEN_INFO_DEVICE_NAME,
&device_name);
INFO("- Tizen Device ID : %s", tizen_device_id);
}
-static void _found_resource(iotcon_remote_resource_h resource, int result,
+static void _found_resource(iotcon_remote_resource_h resource, iotcon_error_e result,
void *user_data)
{
GList *node;
}
/* request tizen info */
- ret = iotcon_request_tizen_info(resource_host, connectivity_type, _request_tizen_info, NULL);
+ ret = iotcon_get_tizen_info(resource_host, connectivity_type, _request_tizen_info, NULL);
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_request_tizen_info() Fail(%d)", ret);
+ ERR("iotcon_get_tizen_info() Fail(%d)", ret);
device_id_list = g_list_remove(device_id_list, door_resource_device_id);
free(door_resource_device_id);
return;
#include <iotcon.h>
#include "test.h"
-static void _request_device_info(iotcon_device_info_h info, int result, void *user_data)
+static void _request_device_info(iotcon_device_info_h info, iotcon_error_e result, void *user_data)
{
int ret;
char *device_name = NULL;
INFO("data_model_version : %s", data_model_ver);
}
-static void _request_platform_info(iotcon_platform_info_h info, int result, void *user_data)
+static void _request_platform_info(iotcon_platform_info_h info, iotcon_error_e result, void *user_data)
{
int ret;
char *platform_id = NULL;
return -1;
}
- ret = iotcon_request_device_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4,
+ ret = iotcon_get_device_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4,
_request_device_info, NULL);
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_request_device_info() Fail(%d)", ret);
+ ERR("iotcon_get_device_info() Fail(%d)", ret);
iotcon_disconnect();
return -1;
}
- ret = iotcon_request_platform_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4,
+ ret = iotcon_get_platform_info(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4,
_request_platform_info, NULL);
if (IOTCON_ERROR_NONE != ret) {
- ERR("iotcon_request_platform_info() Fail(%d)", ret);
+ ERR("iotcon_get_platform_info() Fail(%d)", ret);
iotcon_disconnect();
return -1;
}
}
}
-static void _found_resource(iotcon_remote_resource_h resource, int result,
+static void _found_resource(iotcon_remote_resource_h resource, iotcon_error_e result,
void *user_data)
{
GList *node;
return strcmp(a, b);
}
-static void _found_resource(iotcon_remote_resource_h resource, int result,
+static void _found_resource(iotcon_remote_resource_h resource, iotcon_error_e result,
void *user_data)
{
GList *node;