diff options
author | Eunyoung Lee <ey928.lee@samsung.com> | 2017-11-08 06:21:38 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.ap-northeast-2.compute.internal> | 2017-11-08 06:21:38 +0000 |
commit | 921a981daffad4f549f4e09a188dc9f1c40675de (patch) | |
tree | 4588112a042be7e6098415f2f1eee80bec84a4a1 | |
parent | 5f2d1d29c459e7a9d4a8e86aab0d056c33ff8c1f (diff) | |
parent | b3674ffe1022062a86c0a40989a5d7f7b9953b84 (diff) | |
download | position-finder-server-921a981daffad4f549f4e09a188dc9f1c40675de.tar.gz position-finder-server-921a981daffad4f549f4e09a188dc9f1c40675de.tar.bz2 position-finder-server-921a981daffad4f549f4e09a188dc9f1c40675de.zip |
Merge "add comments for new functions in connectivity module" into template
-rw-r--r-- | inc/connectivity.h | 83 |
1 files changed, 73 insertions, 10 deletions
diff --git a/inc/connectivity.h b/inc/connectivity.h index 9adfcb6..f35ed6c 100644 --- a/inc/connectivity.h +++ b/inc/connectivity.h @@ -25,14 +25,23 @@ typedef struct _connectivity_resource connectivity_resource_s; typedef enum { - CONNECTIVITY_PROTOCOL_DEFAULT = 0, - CONNECTIVITY_PROTOCOL_IOTIVITY, - CONNECTIVITY_PROTOCOL_HTTP, + CONNECTIVITY_PROTOCOL_DEFAULT = 0, /* default protocol */ + CONNECTIVITY_PROTOCOL_IOTIVITY, /* IoTvity protocol */ + CONNECTIVITY_PROTOCOL_HTTP, /* HTTP protocol */ CONNECTIVITY_PROTOCOL_MAX - } connectivity_protocol_e; +} connectivity_protocol_e; /** - * @brief Create connectivity resource and registers the resource in server. + * @brief Set connectivity protocol to communicate with other devices. + * @param[in] protocol_type protocol type to use + * @return 0 on success, otherwise a negative error value + * @see You should set protocol before call connectivity_set_resource(), + * otherwise IoTvitiy protocol will be set as default. + */ +extern int connectivity_set_protocol(connectivity_protocol_e protocol_type); + +/** + * @brief Create connectivity resource. * @param[in] path The path of the resource * @param[in] type The string data to insert into the resource types (e.g. "org.tizen.light") * @param[out] out_resource_info A structure containing information about connectivity resource @@ -49,7 +58,7 @@ extern int connectivity_set_resource(const char *path, const char *type, connect extern void connectivity_unset_resource(connectivity_resource_s *resource); /** - * @brief Notifies a resource's value to observed clients. + * @brief Notifies a resource's value to observed devices or clouds. * @param[in] resource_info A structure containing information about connectivity resource * @param[in] key A key to be sended. * @param[in] value A value to be sended. @@ -59,7 +68,7 @@ extern void connectivity_unset_resource(connectivity_resource_s *resource); extern int connectivity_notify_bool(connectivity_resource_s *resource_info, const char *key, bool value); /** - * @brief Notifies a resource's value to observed clients. + * @brief Notifies a resource's value to observed devices or clouds. * @param[in] resource_info A structure containing information about connectivity resource * @param[in] key A key to be sended. * @param[in] value A value to be sended. @@ -69,7 +78,7 @@ extern int connectivity_notify_bool(connectivity_resource_s *resource_info, cons extern int connectivity_notify_int(connectivity_resource_s *resource_info, const char *key, int value); /** - * @brief Notifies a resource's value to observed clients. + * @brief Notifies a resource's value to observed devices or clouds. * @param[in] resource_info A structure containing information about connectivity resource * @param[in] key A key to be sended. * @param[in] value A value to be sended. @@ -79,7 +88,7 @@ extern int connectivity_notify_int(connectivity_resource_s *resource_info, const extern int connectivity_notify_double(connectivity_resource_s *resource_info, const char *key, double value); /** - * @brief Notifies a resource's value to observed clients. + * @brief Notifies a resource's value to observed devices or clouds. * @param[in] resource_info A structure containing information about connectivity resource * @param[in] key A key to be sended. * @param[in] value A value to be sended. @@ -89,13 +98,67 @@ extern int connectivity_notify_double(connectivity_resource_s *resource_info, co extern int connectivity_notify_string(connectivity_resource_s *resource_info, const char *key, const char *value); /* TODO : add comments for these functions */ -extern int connectivity_set_protocol(connectivity_protocol_e protocol_type); +/** + * @brief Add a boolean type value to attributes for notifying to observed devices or clouds. + * @param[in] resource_info A structure containing information about connectivity resource + * @param[in] key A key to be sended. + * @param[in] value A value to be added. + * @return 0 on success, otherwise a negative error value + * @see If key is already exists, current value will be replaced with new value. + */ extern int connectivity_attributes_add_bool(connectivity_resource_s *resource_info, const char *key, bool value); + +/** + * @brief Add a integer type value to attributes for notifying to observed devices or clouds. + * @param[in] resource_info A structure containing information about connectivity resource + * @param[in] key A key to be sended. + * @param[in] value A value to be added. + * @return 0 on success, otherwise a negative error value + * @see If key is already exists, current value will be replaced with new value. + */ extern int connectivity_attributes_add_int(connectivity_resource_s *resource_info, const char *key, int value); + +/** + * @brief Add a double type value to attributes for notifying to observed devices or clouds. + * @param[in] resource_info A structure containing information about connectivity resource + * @param[in] key A key to be sended. + * @param[in] value A value to be added. + * @return 0 on success, otherwise a negative error value + * @see If key is already exists, current value will be replaced with new value. + */ extern int connectivity_attributes_add_double(connectivity_resource_s *resource_info, const char *key, double value); + +/** + * @brief Add a string value to attributes for notifying to observed devices or clouds. + * @param[in] resource_info A structure containing information about connectivity resource + * @param[in] key A key to be sended. + * @param[in] value A value to be added. + * @return 0 on success, otherwise a negative error value + * @see If key is already exists, current value will be replaced with new value. + */ extern int connectivity_attributes_add_string(connectivity_resource_s *resource_info, const char *key, const char *value); + +/** + * @brief Notifies values in the attributs to observed devices or clouds. + * @param[in] resource_info A structure containing information about connectivity resource + * @return 0 on success, otherwise a negative error value + */ extern int connectivity_attributes_notify_all(connectivity_resource_s *resource_info); + +/** + * @brief Remove a value from attributes for notifying to observed devices or clouds. + * @param[in] resource_info A structure containing information about connectivity resource + * @param[in] key A key to be sended. + * @return 0 on success, otherwise a negative error value + * @see If key is already exists, current value will be replaced with new value. + */ extern int connectivity_attributes_remove_value_by_key(connectivity_resource_s *resource_info, const char *key); + +/** + * @brief Remove all values from attributes for notifying to observed devices or clouds. + * @param[in] resource_info A structure containing information about connectivity resource + * @return 0 on success, otherwise a negative error value + */ extern int connectivity_attributes_remove_all(connectivity_resource_s *resource_info); #endif /* __POSITION_FINDER_CONNECTIVITY_H__ */ |