From: sung.goo.kim Date: Tue, 3 Nov 2015 07:39:36 +0000 (+0900) Subject: (ACR) Apply doxygen comments X-Git-Tag: submit/tizen/20151130.235229~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d733beea4b486e774c330881ee1be23bf640697d;p=platform%2Fcore%2Fiot%2Fiotcon.git (ACR) Apply doxygen comments Change-Id: I607fef23765669d393cec877aabccfdfc28d235c --- diff --git a/daemon/icd-ioty-type.c b/daemon/icd-ioty-type.c index d37ae0b..da78787 100644 --- a/daemon/icd-ioty-type.c +++ b/daemon/icd-ioty-type.c @@ -30,10 +30,10 @@ OCConnectivityType icd_ioty_conn_type_to_oic_conn_type(int conn_type) 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: @@ -59,10 +59,10 @@ int icd_ioty_transport_flag_to_conn_type(OCTransportAdapter adapter, 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"); @@ -84,11 +84,11 @@ int icd_ioty_conn_type_to_oic_transport_type(int conn_type, OCTransportAdapter * *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; diff --git a/doc/iotcon_doc.h b/doc/iotcon_doc.h index c879392..9dcfb8a 100644 --- a/doc/iotcon_doc.h +++ b/doc/iotcon_doc.h @@ -30,8 +30,6 @@ * 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 @@ -142,10 +140,7 @@ static void _request_handler(iotcon_request_h request, void *user_data) 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 @@ -217,10 +212,7 @@ static void _found_resource(iotcon_remote_resource_h resource, void *user_data) } } * @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 @@ -348,7 +340,6 @@ static void _on_observe(iotcon_remote_resource_h resource, iotcon_error_e err, return; } * @endcode - * @} * */ diff --git a/lib/icl-device.c b/lib/icl-device.c index bc40813..770f99e 100644 --- a/lib/icl-device.c +++ b/lib/icl-device.c @@ -135,7 +135,7 @@ static gboolean _icl_timeout_get_device_info(gpointer p) 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) @@ -300,7 +300,7 @@ static gboolean _icl_timeout_get_platform_info(gpointer p) 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) @@ -398,7 +398,7 @@ static void _icl_tizen_info_cb(GObject *object, GAsyncResult *g_async_res, } -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) diff --git a/lib/icl-remote-resource-crud.c b/lib/icl-remote-resource-crud.c index c30b1e6..4f3d23d 100644 --- a/lib/icl-remote-resource-crud.c +++ b/lib/icl-remote-resource-crud.c @@ -531,7 +531,7 @@ int icl_remote_resource_stop_observing(iotcon_remote_resource_h resource, } -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; diff --git a/lib/icl-remote-resource.c b/lib/icl-remote-resource.c index 0c9dbf0..74dc44e 100644 --- a/lib/icl-remote-resource.c +++ b/lib/icl-remote-resource.c @@ -200,7 +200,7 @@ API void iotcon_remote_resource_destroy(iotcon_remote_resource_h resource) 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); diff --git a/lib/include/iotcon-client.h b/lib/include/iotcon-client.h index 4c75664..1dcea71 100644 --- a/lib/include/iotcon-client.h +++ b/lib/include/iotcon-client.h @@ -69,6 +69,8 @@ typedef void (*iotcon_presence_cb)(int result, unsigned int nonce, * @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 @@ -126,6 +128,7 @@ int iotcon_unsubscribe_presence(iotcon_presence_h presence_handle); /** * @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 * @@ -137,12 +140,13 @@ int iotcon_unsubscribe_presence(iotcon_presence_h presence_handle); * * @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. * @@ -167,9 +171,11 @@ typedef void (*iotcon_found_resource_cb)(iotcon_remote_resource_h resource, int * @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, @@ -178,7 +184,8 @@ int iotcon_find_resource(const char *host_address, 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 * @@ -186,19 +193,21 @@ int iotcon_find_resource(const char *host_address, * @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 @@ -216,21 +225,25 @@ typedef void (*iotcon_device_info_cb)(iotcon_device_info_h device_info, int resu * @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 @@ -240,13 +253,14 @@ int iotcon_request_device_info(const char *host_address, * @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 * @@ -254,19 +268,21 @@ int iotcon_device_info_get_property(iotcon_device_info_h device_info, * @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 @@ -286,21 +302,25 @@ typedef void (*iotcon_platform_info_cb)(iotcon_platform_info_h platform_info, in * @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 @@ -310,33 +330,35 @@ int iotcon_request_platform_info(const char *host_address, * @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 @@ -354,21 +376,25 @@ typedef void (*iotcon_tizen_info_cb)(iotcon_tizen_info_h tizen_info, * @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 @@ -378,10 +404,10 @@ int iotcon_request_tizen_info(const char *host_address, * @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); /** * @} diff --git a/lib/include/iotcon-constant.h b/lib/include/iotcon-constant.h index 2f1b9dc..fa73aa8 100644 --- a/lib/include/iotcon-constant.h +++ b/lib/include/iotcon-constant.h @@ -30,21 +30,25 @@ * \#include * * @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 */ @@ -52,11 +56,10 @@ typedef struct icl_resource* iotcon_resource_h; /** * @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 */ @@ -64,8 +67,8 @@ typedef struct icl_lite_resource* iotcon_lite_resource_h; /** * @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. * * @@ -83,8 +86,8 @@ typedef struct icl_observers* iotcon_observers_h; /** * @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 @@ -94,11 +97,11 @@ typedef struct icl_resource_request* iotcon_request_h; /** * @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 @@ -107,7 +110,7 @@ typedef struct icl_remote_resource* iotcon_remote_resource_h; /** * @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 @@ -116,7 +119,7 @@ typedef struct icl_presence* iotcon_presence_h; /** * @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 */ @@ -124,7 +127,7 @@ typedef struct icl_device_info* iotcon_device_info_h; /** * @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 */ @@ -132,7 +135,7 @@ typedef struct icl_platform_info* iotcon_platform_info_h; /** * @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 */ @@ -140,7 +143,7 @@ typedef struct icl_tizen_info* iotcon_tizen_info_h; /** * @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 @@ -149,9 +152,9 @@ typedef struct icl_resource_types* iotcon_resource_types_h; /** * @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 */ @@ -159,11 +162,11 @@ typedef struct icl_options* iotcon_options_h; /** * @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 @@ -172,9 +175,9 @@ typedef struct icl_query* iotcon_query_h; /** * @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 */ @@ -182,7 +185,7 @@ typedef struct icl_representation_s* iotcon_representation_h; /** * @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 */ @@ -190,16 +193,11 @@ typedef struct icl_list_s* iotcon_list_h; /** * @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 */ @@ -268,9 +266,9 @@ typedef enum { 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; /** @@ -393,7 +391,7 @@ typedef enum { */ 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; /** diff --git a/lib/include/iotcon-internal.h b/lib/include/iotcon-internal.h index 39543ec..d16789e 100644 --- a/lib/include/iotcon-internal.h +++ b/lib/include/iotcon-internal.h @@ -52,7 +52,7 @@ extern "C" { 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. * diff --git a/lib/include/iotcon-list.h b/lib/include/iotcon-list.h index 88f37dc..d49d811 100644 --- a/lib/include/iotcon-list.h +++ b/lib/include/iotcon-list.h @@ -40,6 +40,9 @@ * * @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 * @@ -52,7 +55,7 @@ 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 @@ -64,7 +67,7 @@ int iotcon_list_create(iotcon_types_e type, iotcon_list_h *list); 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. * @@ -83,7 +86,7 @@ void iotcon_list_destroy(iotcon_list_h 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. * @@ -102,7 +105,7 @@ int iotcon_list_add_int(iotcon_list_h list, int val, int pos); 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. * @@ -121,7 +124,7 @@ int iotcon_list_add_bool(iotcon_list_h list, bool val, int pos); 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. * @@ -140,7 +143,7 @@ int iotcon_list_add_double(iotcon_list_h list, double val, int pos); 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. * @@ -159,7 +162,7 @@ int iotcon_list_add_str(iotcon_list_h list, char *val, int pos); 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. * @@ -237,6 +240,8 @@ int iotcon_list_get_nth_double(iotcon_list_h list, int pos, double *val); * * @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 @@ -255,6 +260,8 @@ int iotcon_list_get_nth_str(iotcon_list_h list, int pos, char **val); * * @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 @@ -273,6 +280,8 @@ int iotcon_list_get_nth_list(iotcon_list_h src, int pos, iotcon_list_h *dest); * * @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 @@ -286,7 +295,7 @@ int iotcon_list_get_nth_list(iotcon_list_h src, int pos, iotcon_list_h *dest); 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 diff --git a/lib/include/iotcon-lite-resource.h b/lib/include/iotcon-lite-resource.h index cbe0ab4..a7b4cf0 100644 --- a/lib/include/iotcon-lite-resource.h +++ b/lib/include/iotcon-lite-resource.h @@ -26,8 +26,13 @@ * @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 @@ -36,7 +41,7 @@ */ /** - * @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 @@ -46,8 +51,8 @@ * @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. @@ -74,7 +79,7 @@ int iotcon_lite_resource_create(const char *uri_path, 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 @@ -97,7 +102,7 @@ int iotcon_lite_resource_create(const char *uri_path, 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 * @@ -115,10 +120,12 @@ int iotcon_lite_resource_update_state(iotcon_lite_resource_h resource, 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 * diff --git a/lib/include/iotcon-observers.h b/lib/include/iotcon-observers.h index e66ec98..1f2d0cb 100644 --- a/lib/include/iotcon-observers.h +++ b/lib/include/iotcon-observers.h @@ -39,7 +39,10 @@ * * @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 @@ -50,10 +53,10 @@ * @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 * @@ -87,7 +90,7 @@ void iotcon_observers_destroy(iotcon_observers_h observers); 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 * diff --git a/lib/include/iotcon-options.h b/lib/include/iotcon-options.h index 5c87cc0..786c0d5 100644 --- a/lib/include/iotcon-options.h +++ b/lib/include/iotcon-options.h @@ -39,6 +39,9 @@ * * @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. @@ -54,7 +57,7 @@ int iotcon_options_create(iotcon_options_h *options); /** - * @brief Free an option handle. + * @brief Destroys an option handle. * * @since_tizen 3.0 * @@ -70,7 +73,7 @@ int iotcon_options_create(iotcon_options_h *options); 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 @@ -95,7 +98,7 @@ int iotcon_options_add(iotcon_options_h options, unsigned short id, 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 * @@ -118,6 +121,8 @@ int iotcon_options_remove(iotcon_options_h options, unsigned short id); * * @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 diff --git a/lib/include/iotcon-query.h b/lib/include/iotcon-query.h index fa33225..57db776 100644 --- a/lib/include/iotcon-query.h +++ b/lib/include/iotcon-query.h @@ -39,6 +39,9 @@ * * @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. @@ -54,7 +57,7 @@ int iotcon_query_create(iotcon_query_h *query); /** - * @brief Free a query handle. + * @brief Destroys a query handle. * * @since_tizen 3.0 * @@ -70,9 +73,10 @@ int iotcon_query_create(iotcon_query_h *query); 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 @@ -93,7 +97,7 @@ void iotcon_query_destroy(iotcon_query_h 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 @@ -159,7 +163,7 @@ int iotcon_query_set_resource_types(iotcon_query_h query, iotcon_resource_types_ 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. @@ -181,7 +185,7 @@ int iotcon_query_set_interface(iotcon_query_h query, iotcon_interface_e iface); 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 * @@ -200,10 +204,12 @@ int iotcon_query_add(iotcon_query_h query, const char *key, const char *value); 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 diff --git a/lib/include/iotcon-remote-resource.h b/lib/include/iotcon-remote-resource.h index 45da3eb..bd0598a 100644 --- a/lib/include/iotcon-remote-resource.h +++ b/lib/include/iotcon-remote-resource.h @@ -37,21 +37,27 @@ /** * @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 @@ -69,10 +75,10 @@ int iotcon_remote_resource_create(const char *host_address, 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. * @@ -88,10 +94,13 @@ int iotcon_remote_resource_create(const char *host_address, 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 * @@ -133,7 +142,7 @@ typedef void (*iotcon_remote_resource_response_cb)(iotcon_remote_resource_h reso 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. * @@ -158,7 +167,7 @@ typedef void (*iotcon_remote_resource_response_cb)(iotcon_remote_resource_h reso * @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, @@ -168,7 +177,7 @@ 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 @@ -187,7 +196,7 @@ int iotcon_remote_resource_start_observing(iotcon_remote_resource_h resource, * @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. @@ -214,12 +223,13 @@ int iotcon_remote_resource_observer_stop(iotcon_remote_resource_h 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 @@ -244,6 +254,7 @@ int iotcon_remote_resource_get(iotcon_remote_resource_h resource, iotcon_query_h * @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, @@ -277,6 +288,7 @@ int iotcon_remote_resource_put(iotcon_remote_resource_h resource, * @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, @@ -306,6 +318,7 @@ int iotcon_remote_resource_post(iotcon_remote_resource_h resource, * @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); @@ -330,8 +343,8 @@ typedef void (*iotcon_remote_resource_cached_representation_changed_cb)( 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. * @@ -363,8 +376,8 @@ int iotcon_remote_resource_start_caching(iotcon_remote_resource_h 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 @@ -402,7 +415,7 @@ typedef void (*iotcon_remote_resource_state_changed_cb)(iotcon_remote_resource_h 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. @@ -432,7 +445,7 @@ int iotcon_remote_resource_start_monitoring(iotcon_remote_resource_h resource, 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 @@ -457,6 +470,7 @@ int iotcon_remote_resource_stop_monitoring(iotcon_remote_resource_h resource); * @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 @@ -505,6 +519,7 @@ int iotcon_remote_resource_get_connectivity_type(iotcon_remote_resource_h resour * @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 @@ -529,6 +544,7 @@ int iotcon_remote_resource_get_host_address(iotcon_remote_resource_h 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 @@ -554,6 +570,8 @@ int iotcon_remote_resource_get_device_id(iotcon_remote_resource_h 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 * @@ -641,10 +659,12 @@ int iotcon_remote_resource_set_options(iotcon_remote_resource_h 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 * diff --git a/lib/include/iotcon-representation.h b/lib/include/iotcon-representation.h index ade3c2e..087ba02 100644 --- a/lib/include/iotcon-representation.h +++ b/lib/include/iotcon-representation.h @@ -190,6 +190,9 @@ * * @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. @@ -202,7 +205,7 @@ 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 @@ -221,6 +224,9 @@ void iotcon_representation_destroy(iotcon_representation_h repr); * * @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 * @@ -254,6 +260,8 @@ int iotcon_representation_set_uri_path(iotcon_representation_h repr, * * @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 * @@ -284,6 +292,8 @@ int iotcon_representation_set_resource_types(iotcon_representation_h repr, * * @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 * @@ -420,7 +430,7 @@ int iotcon_representation_remove_child(iotcon_representation_h parent, 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 @@ -461,6 +471,8 @@ int iotcon_representation_get_children_count(iotcon_representation_h parent, * * @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 diff --git a/lib/include/iotcon-request.h b/lib/include/iotcon-request.h index 015e419..106ae15 100644 --- a/lib/include/iotcon-request.h +++ b/lib/include/iotcon-request.h @@ -39,6 +39,8 @@ * * @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 * @@ -79,12 +81,13 @@ int iotcon_request_get_host_address(iotcon_request_h 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 @@ -105,7 +108,7 @@ int iotcon_request_get_representation(iotcon_request_h request, iotcon_representation_h *repr); /** - * @brief Get types of the request + * @brief Gets types of the request * * @since_tizen 3.0 * @@ -127,10 +130,11 @@ int iotcon_request_get_representation(iotcon_request_h request, 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 @@ -150,10 +154,11 @@ int iotcon_request_get_types(iotcon_request_h request, int *types); 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 @@ -173,7 +178,7 @@ int iotcon_request_get_options(iotcon_request_h request, iotcon_options_h *optio 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. @@ -196,7 +201,7 @@ int iotcon_request_get_query(iotcon_request_h request, iotcon_query_h *query); 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 * diff --git a/lib/include/iotcon-resource-types.h b/lib/include/iotcon-resource-types.h index 02be010..21a20cc 100644 --- a/lib/include/iotcon-resource-types.h +++ b/lib/include/iotcon-resource-types.h @@ -39,7 +39,10 @@ * * @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 @@ -51,10 +54,10 @@ * @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 * @@ -159,6 +162,9 @@ int iotcon_resource_types_foreach(iotcon_resource_types_h types, * * @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 * diff --git a/lib/include/iotcon-resource.h b/lib/include/iotcon-resource.h index 0318d02..8746257 100644 --- a/lib/include/iotcon-resource.h +++ b/lib/include/iotcon-resource.h @@ -55,7 +55,7 @@ typedef void (*iotcon_request_handler_cb)(iotcon_resource_h resource, 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 @@ -74,8 +74,8 @@ typedef void (*iotcon_request_handler_cb)(iotcon_resource_h resource, * @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. @@ -112,7 +112,7 @@ int iotcon_resource_create(const char *uri_path, 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 @@ -143,12 +143,12 @@ int iotcon_resource_destroy(iotcon_resource_h resource_handle); /** * @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 @@ -308,7 +308,7 @@ int iotcon_resource_unbind_child_resource(iotcon_resource_h parent, * * @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() @@ -342,6 +342,8 @@ int iotcon_resource_get_number_of_children(iotcon_resource_h resource, int *numb * * @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 @@ -364,6 +366,8 @@ int iotcon_resource_get_nth_child(iotcon_resource_h parent, int 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 * @@ -380,10 +384,12 @@ int iotcon_resource_get_nth_child(iotcon_resource_h parent, int index, 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 * @@ -400,7 +406,7 @@ int iotcon_resource_get_uri_path(iotcon_resource_h resource, char **uri_path); 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 * diff --git a/lib/include/iotcon-response.h b/lib/include/iotcon-response.h index 6ca7d8a..712013a 100644 --- a/lib/include/iotcon-response.h +++ b/lib/include/iotcon-response.h @@ -28,7 +28,7 @@ * * @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 * * @{ @@ -39,6 +39,9 @@ * * @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 * @@ -53,7 +56,7 @@ 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 * @@ -70,6 +73,8 @@ void iotcon_response_destroy(iotcon_response_h resp); * * @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 * @@ -88,6 +93,8 @@ int iotcon_response_get_options(iotcon_response_h resp, iotcon_options_h *option * * @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 * @@ -144,6 +151,7 @@ int iotcon_response_set_result(iotcon_response_h resp, iotcon_response_result_e * @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. diff --git a/lib/include/iotcon-server.h b/lib/include/iotcon-server.h index 22beac0..795b92e 100644 --- a/lib/include/iotcon-server.h +++ b/lib/include/iotcon-server.h @@ -36,10 +36,11 @@ * \#include * * @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. * * @{ */ diff --git a/lib/include/iotcon-state.h b/lib/include/iotcon-state.h index 60739c7..e8ddcd9 100644 --- a/lib/include/iotcon-state.h +++ b/lib/include/iotcon-state.h @@ -40,6 +40,9 @@ * * @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. @@ -52,7 +55,7 @@ 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 @@ -239,6 +242,8 @@ int iotcon_state_get_double(iotcon_state_h state, const char *key, double *val); * * @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 @@ -256,6 +261,8 @@ int iotcon_state_get_str(iotcon_state_h state, const char *key, char **val); * * @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 @@ -273,6 +280,8 @@ int iotcon_state_get_list(iotcon_state_h state, const char *key, iotcon_list_h * * * @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 @@ -301,7 +310,7 @@ int iotcon_state_get_state(iotcon_state_h src, const char *key, iotcon_state_h * 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 * @@ -354,7 +363,7 @@ int iotcon_state_get_type(iotcon_state_h state, const char *key, int *type); 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 diff --git a/lib/include/iotcon.h b/lib/include/iotcon.h index 5cee279..4a93622 100644 --- a/lib/include/iotcon.h +++ b/lib/include/iotcon.h @@ -53,6 +53,8 @@ extern "C" { * @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); @@ -67,11 +69,16 @@ 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 * @@ -79,45 +86,34 @@ void iotcon_disconnect(void); * * @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); @@ -133,6 +129,8 @@ 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() */ @@ -140,7 +138,9 @@ typedef void (*iotcon_connection_changed_cb)(bool is_connected, void *user_data) /** * @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 * @@ -154,6 +154,10 @@ typedef void (*iotcon_connection_changed_cb)(bool is_connected, void *user_data) * @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() */ @@ -172,6 +176,10 @@ int iotcon_add_connection_changed_cb(iotcon_connection_changed_cb cb, void *user * @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() */ diff --git a/test/iotcon-test-basic-client.c b/test/iotcon-test-basic-client.c index 905ceca..c8964d0 100644 --- a/test/iotcon-test-basic-client.c +++ b/test/iotcon-test-basic-client.c @@ -34,7 +34,7 @@ static void _on_observe(iotcon_remote_resource_h resource, iotcon_error_e err, i++; if (2 == i) { - iotcon_remote_resource_observer_stop(resource); + iotcon_remote_resource_stop_observing(resource); iotcon_remote_resource_destroy(resource); } } @@ -311,15 +311,15 @@ static int _device_id_compare(const void *a, const void *b) 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); @@ -340,7 +340,7 @@ static void _request_tizen_info(iotcon_tizen_info_h info, int response_result, 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; @@ -444,9 +444,9 @@ static void _found_resource(iotcon_remote_resource_h resource, int result, } /* 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; diff --git a/test/iotcon-test-device-client.c b/test/iotcon-test-device-client.c index 8111b71..a97065f 100644 --- a/test/iotcon-test-device-client.c +++ b/test/iotcon-test-device-client.c @@ -18,7 +18,7 @@ #include #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; @@ -60,7 +60,7 @@ static void _request_device_info(iotcon_device_info_h info, int result, void *us 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; @@ -180,18 +180,18 @@ int main() 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; } diff --git a/test/iotcon-test-encap-client.c b/test/iotcon-test-encap-client.c index 06ed82b..bb9b4a1 100644 --- a/test/iotcon-test-encap-client.c +++ b/test/iotcon-test-encap-client.c @@ -87,7 +87,7 @@ static void _representation_changed_cb(iotcon_remote_resource_h resource, } } -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; diff --git a/test/iotcon-test-repr-client.c b/test/iotcon-test-repr-client.c index 8394523..a505e98 100644 --- a/test/iotcon-test-repr-client.c +++ b/test/iotcon-test-repr-client.c @@ -250,7 +250,7 @@ static int _device_id_compare(const void *a, const void *b) 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;