Apply sender concept for signal
[platform/core/iot/iotcon.git] / daemon / icd-ioty.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 #ifndef __IOT_CONNECTIVITY_MANAGER_DAEMON_IOTIVITY_H__
17 #define __IOT_CONNECTIVITY_MANAGER_DAEMON_IOTIVITY_H__
18
19 #include <stdint.h>
20
21 #include "iotcon.h"
22
23 void icd_ioty_config(const char *addr, unsigned short port);
24
25 void* icd_ioty_register_resource(const char *uri, const char* const* res_types,
26                 int ifaces, uint8_t properties);
27
28 int icd_ioty_unregister_resource(iotcon_resource_h resource_handle);
29
30 int icd_ioty_bind_interface(void *resource_handle, iotcon_interface_e iface);
31
32 int icd_ioty_bind_type(void *resource_handle, const char *resource_type);
33
34 int icd_ioty_bind_resource(void *parent, void *child);
35
36 int icd_ioty_unbind_resource(void *parent, void *child);
37
38 int icd_ioty_notify_list_of_observers(int resHandle, GVariant *msg, GVariant *observers);
39
40 int icd_ioty_notify_all(int resHandle);
41
42 int icd_ioty_send_response(GVariant *resp);
43
44 int icd_ioty_find_resource(const char *host_address, const char *resource_type,
45                 unsigned int signal_number, const char *sender);
46
47 int icd_ioty_get(GVariant *resource, GVariant *query, unsigned int signal_number,
48                 const char *sender);
49
50 int icd_ioty_put(GVariant *resource, const char *repr, GVariant *query,
51                 unsigned int signal_number, const char *sender);
52
53 int icd_ioty_post(GVariant *resource, const char *repr, GVariant *query,
54                 unsigned int signal_number, const char *sender);
55
56 int icd_ioty_delete(GVariant *resource, unsigned int signal_number, const char *sender);
57
58 int icd_ioty_observer_start(GVariant *resource, int observe_type, GVariant *query,
59                 unsigned int signal_number, const char *sender, int *observe_h);
60
61 int icd_ioty_observer_stop(void *observe_h);
62
63 int icd_ioty_register_device_info(GVariant *value);
64
65 int icd_ioty_get_device_info(const char *host_address, unsigned int signal_number,
66                 const char *sender);
67
68 iotcon_presence_h icd_ioty_subscribe_presence(const char *host_address,
69                 const char *resource_type, unsigned int signal_number, const char *sender);
70
71 int icd_ioty_unsubscribe_presence(iotcon_presence_h presence_handle);
72
73 int icd_ioty_start_presence(unsigned int time_to_live);
74
75 int icd_ioty_stop_presence();
76
77 #endif /*__IOT_CONNECTIVITY_MANAGER_DAEMON_IOTIVITY_H__*/