2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #ifndef __IOT_CONNECTIVITY_MANAGER_DAEMON_IOTIVITY_H__
17 #define __IOT_CONNECTIVITY_MANAGER_DAEMON_IOTIVITY_H__
27 #define ICD_IOTY_COAP "coap://"
28 #define ICD_IOTY_COAPS "coaps://"
42 void icd_ioty_csdk_lock();
44 void icd_ioty_csdk_unlock();
46 GThread* icd_ioty_init(const char *addr, unsigned short port);
48 void icd_ioty_deinit();
50 OCResourceHandle icd_ioty_register_resource(const char *uri_path,
51 const char* const* res_types, int ifaces, uint8_t properties);
53 int icd_ioty_unregister_resource(OCResourceHandle handle);
55 int icd_ioty_bind_interface(OCResourceHandle handle, iotcon_interface_e iface);
57 int icd_ioty_bind_type(OCResourceHandle handle, const char *resource_type);
59 int icd_ioty_bind_resource(OCResourceHandle parent, OCResourceHandle child);
61 int icd_ioty_unbind_resource(OCResourceHandle parent, OCResourceHandle child);
63 int icd_ioty_notify_list_of_observers(OCResourceHandle handle, GVariant *msg,
66 int icd_ioty_notify_all(OCResourceHandle handle);
68 int icd_ioty_send_response(GVariant *resp);
70 int icd_ioty_find_resource(const char *host_address, const char *resource_type,
71 unsigned int signal_number, const char *bus_name);
73 void icd_ioty_complete(int type, GDBusMethodInvocation *invocation, GVariant *value);
74 void icd_ioty_complete_error(int type, GDBusMethodInvocation *invocation, int ret_val);
76 gboolean icd_ioty_get(icDbus *object, GDBusMethodInvocation *invocation,
77 GVariant *resource, GVariant *query);
79 gboolean icd_ioty_put(icDbus *object, GDBusMethodInvocation *invocation,
80 GVariant *resource, const char *repr, GVariant *query);
82 gboolean icd_ioty_post(icDbus *object, GDBusMethodInvocation *invocation,
83 GVariant *resource, const char *repr, GVariant *query);
85 gboolean icd_ioty_delete(icDbus *object, GDBusMethodInvocation *invocation,
88 OCDoHandle icd_ioty_observer_start(GVariant *resource, int observe_type, GVariant *query,
89 unsigned int signal_number, const char *bus_name);
91 int icd_ioty_observer_stop(OCDoHandle handle, GVariant *options);
93 #ifdef DEVICE_INFO_IMPL /* not implemented in iotivity 0.9.1 */
94 int icd_ioty_register_device_info(GVariant *value);
96 int icd_ioty_get_device_info(const char *host_address, unsigned int signal_number,
97 const char *bus_name);
100 int icd_ioty_register_platform_info(GVariant *value);
102 int icd_ioty_get_platform_info(const char *host_address, unsigned int signal_number,
103 const char *bus_name);
105 OCDoHandle icd_ioty_subscribe_presence(const char *host_address,
106 const char *resource_type, unsigned int signal_number, const char *bus_name);
108 int icd_ioty_unsubscribe_presence(OCDoHandle handle);
110 int icd_ioty_start_presence(unsigned int time_to_live);
112 int icd_ioty_stop_presence();
114 #endif /*__IOT_CONNECTIVITY_MANAGER_DAEMON_IOTIVITY_H__*/