1 /// Copyright 2016 by Samsung Electronics, Inc.,
3 /// This software is the confidential and proprietary information
4 /// of Samsung Electronics, Inc. ("Confidential Information"). You
5 /// shall not disclose such Confidential Information and shall use
6 /// it only in accordance with the terms of the license agreement
7 /// you entered into with Samsung.
10 using System.Runtime.InteropServices;
12 internal static partial class Interop
14 internal static partial class IoTConnectivity
16 internal static partial class Server
18 internal enum RequestType
27 internal static partial class IoTCon
29 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_start_presence")]
30 internal static extern int StartPresence(uint time);
32 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_stop_presence")]
33 internal static extern int StopPresence();
36 internal static partial class Resource
38 internal delegate void RequestHandlerCallback(IntPtr resource, IntPtr request, IntPtr userData);
40 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_create")]
41 internal static extern int Create(string uriPath, IntPtr resTypes, IntPtr ifaces, int properties, RequestHandlerCallback cb, IntPtr userData, out IntPtr resourceHandle);
43 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_destroy")]
44 internal static extern int Destroy(IntPtr resourceHandle);
46 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_bind_interface")]
47 internal static extern int BindInterface(IntPtr resource, string iface);
49 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_bind_type")]
50 internal static extern int BindType(IntPtr resourceHandle, string resourceType);
52 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_set_request_handler")]
53 internal static extern int SetRequestHandler(IntPtr resource, RequestHandlerCallback cb, IntPtr userData);
55 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_bind_child_resource")]
56 internal static extern int BindChildResource(IntPtr parent, IntPtr child);
58 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_unbind_child_resource")]
59 internal static extern int UnbindChildResource(IntPtr parent, IntPtr child);
61 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_notify")]
62 internal static extern int Notify(IntPtr resource, IntPtr repr, IntPtr observers, int qos);
64 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_number_of_children")]
65 internal static extern int GetNumberOfChildren(IntPtr resource, out int number);
67 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_nth_child")]
68 internal static extern int GetNthChild(IntPtr parent, int index, out IntPtr child);
70 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_uri_path")]
71 internal static extern int GetUriPath(IntPtr resource, out string uriPpath);
73 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_types")]
74 internal static extern int GetTypes(IntPtr resource, out IntPtr types);
76 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_interfaces")]
77 internal static extern int GetInterfaces(IntPtr resource, out IntPtr ifaces);
79 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_properties")]
80 internal static extern int GetProperties(IntPtr resource, out int properties);
83 internal static partial class Request
85 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_host_address")]
86 internal static extern int GetHostAddress(IntPtr request, out string hostAddress);
88 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_connectivity_type")]
89 internal static extern int GetConnectivityType(IntPtr request, out int connectivityType);
91 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_representation")]
92 internal static extern int GetRepresentation(IntPtr request, out IntPtr repr);
94 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_request_type")]
95 internal static extern int GetRequestType(IntPtr request, out int type);
97 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_options")]
98 internal static extern int GetOptions(IntPtr request, out IntPtr options);
100 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_query")]
101 internal static extern int GetQuery(IntPtr request, out IntPtr query);
103 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_observe_type")]
104 internal static extern int GetObserveType(IntPtr request, out int observeType);
106 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_observe_id")]
107 internal static extern int GetObserveId(IntPtr request, out int observeId);
110 internal static partial class Response
112 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_create")]
113 internal static extern int Create(IntPtr request, out IntPtr response);
115 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_destroy")]
116 internal static extern void Destroy(IntPtr resp);
118 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_get_options")]
119 internal static extern int GetOptions(IntPtr resp, out IntPtr options);
121 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_get_representation")]
122 internal static extern int GetRepresentation(IntPtr resp, out IntPtr repr);
124 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_get_result")]
125 internal static extern int GetResult(IntPtr resp, out int result);
127 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_set_result")]
128 internal static extern int SetResult(IntPtr resp, int result);
130 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_set_representation")]
131 internal static extern int SetRepresentation(IntPtr resp, string iface, IntPtr repr);
133 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_set_options")]
134 internal static extern int SetOptions(IntPtr resp, IntPtr options);
136 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_send")]
137 internal static extern int Send(IntPtr resp);
140 internal static partial class Observers
142 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_create")]
143 internal static extern int Create(out IntPtr observers);
145 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_destroy")]
146 internal static extern void Destroy(IntPtr observers);
148 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_add")]
149 internal static extern int Add(IntPtr observers, int observeId);
151 [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_remove")]
152 internal static extern int Remove(IntPtr observers, int observeId);