2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Contact: Jin Yoon <jinny.yoon@samsung.com>
5 * Geunsun Lee <gs86.lee@samsung.com>
6 * Eunyoung Lee <ey928.lee@samsung.com>
7 * Junkyu Han <junkyu.han@samsung.com>
9 * Licensed under the Flora License, Version 1.1 (the License);
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://floralicense.org/license/
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an AS IS BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
22 #ifndef __POSITION_FINDER_CONNECTIVITY_H__
23 #define __POSITION_FINDER_CONNECTIVITY_H__
27 #include "connectivity_internal.h"
29 struct connectivity_resource {
30 iotcon_resource_h res;
31 iotcon_observers_h observers;
34 typedef struct connectivity_resource connectivity_resource_s;
37 * @brief Create connectivity resource and registers the resource in server.
38 * @param[in] uri_path The URI path of the resource
39 * @param[in] type The string data to insert into the resource types (e.g. "org.tizen.light")
40 * @param[out] out_resource_info A structure containing information about connectivity resource
41 * @return 0 on success, otherwise a negative error value
42 * @see uri_path length must be less than 128.
43 * @see You must destroy resource by calling connectivity_unset_resource() if resource is no longer needed.
45 extern int connectivity_set_resource(const char *uri_path, const char *type, connectivity_resource_s **out_resource_info);
48 * @brief Releases all resource about connectivity.
49 * @param[in] resource_info A structure containing information about connectivity resource
51 extern void connectivity_unset_resource(connectivity_resource_s *resource);
54 * @brief Notifies specific clients that resource's attributes have changed with boolean vaule.
55 * @param[in] resource_info A structure containing information about connectivity resource
56 * @param[in] key A new key to be added into attributes
57 * @param[in] value A boolean value to be added into attributes
58 * @return 0 on success, otherwise a negative error value
59 * @see If key is already exists, current value will be replaced with new value.
61 extern int connectivity_notify_bool(connectivity_resource_s *resource_info, const char *key, bool value);
64 * @brief Notifies specific clients that resource's attributes have changed with int vaule.
65 * @param[in] resource_info A structure containing information about connectivity resource
66 * @param[in] key A new key to be added into attributes
67 * @param[in] value A int value to be added into attributes
68 * @return 0 on success, otherwise a negative error value
69 * @see If key is already exists, current value will be replaced with new value.
71 extern int connectivity_notify_int(connectivity_resource_s *resource_info, const char *key, int value);
74 * @brief Notifies specific clients that resource's attributes have changed with double vaule.
75 * @param[in] resource_info A structure containing information about connectivity resource
76 * @param[in] key A new key to be added into attributes
77 * @param[in] value A double value to be added into attributes
78 * @return 0 on success, otherwise a negative error value
79 * @see If key is already exists, current value will be replaced with new value.
81 extern int connectivity_notify_double(connectivity_resource_s *resource_info, const char *key, double value);
83 #endif /* __POSITION_FINDER_CONNECTIVITY_H__ */