Update snapshot(2018-02-14)
[platform/upstream/iotivity.git] / resource / provisioning / examples / cloudWrapper.h
1 /* *****************************************************************
2  *
3  * Copyright 2016 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * *****************************************************************/
20 #ifndef OC_CLOUD_WRAPPER_H
21 #define OC_CLOUD_WRAPPER_H
22
23 #include "occloudprovisioning.h"
24 #include "OCCloudProvisioning.hpp"
25
26 using namespace OC;
27 /**
28  * Certificate-Issue request function
29  *
30  * @param[in] endPoint          cloud host and port
31  * @param[in] callback          result callback
32  * @return  OCStackResult application result
33  */
34 OCStackResult OCWrapperCertificateIssueRequest(OCCloudProvisioning& ptr, ResponseCallBack callback);
35
36 /**
37  * CRL GET request function
38  *
39  * @param[in] endPoint          cloud host and port
40  * @param[in] callback          result callback
41  * @return  OCStackResult application result
42 */
43 OCStackResult OCWrapperGetCRL(OCCloudProvisioning& ptr, ResponseCallBack callback);
44
45 /**
46  * CRL POST request function (with Serial Numbers list to revoke)
47  *
48  * @param[in] endPoint          cloud host and port
49  * @param[in] callback          result callback
50  * @return  OCStackResult application result
51  */
52 OCStackResult OCWrapperPostCRL(OCCloudProvisioning& ptr, ResponseCallBack callback);
53
54 /**
55  * ACL id retrieve by device id
56  *
57  * @param[in] endPoint          cloud host and port
58  * @param[in] callback          result callback
59  * @return  OCStackResult application result
60  */
61 OCStackResult OCWrapperAclIdGetByDevice(OCCloudProvisioning& ptr, AclIdResponseCallBack callback);
62
63 /**
64  * ACL id create
65  *
66  * @param[in] endPoint          cloud host and port
67  * @param[in] callback          result callback
68  * @return  OCStackResult application result
69  */
70 OCStackResult OCWrapperAclIdCreate(const OCDevAddr *endPoint, OCCloudResponseCB callback);
71
72 /**
73  * ACL id delete
74  *
75  * @param[in] endPoint          cloud host and port
76  * @param[in] callback          result callback
77  * @return  OCStackResult application result
78  */
79 OCStackResult OCWrapperAclIdDelete(const OCDevAddr *endPoint, OCCloudResponseCB callback);
80
81 /**
82  * ACL individual get info
83  *
84  * @param[in] endPoint          cloud host and port
85  * @param[in] callback          result callback
86  * @return  OCStackResult application result
87  */
88 OCStackResult OCWrapperAclIndividualGetInfo(OCCloudProvisioning& ptr, ResponseCallBack callback);
89
90 /**
91  * ACL individual update ACE
92  *
93  * @param[in] endPoint          cloud host and port
94  * @param[in] callback          result callback
95  * @return  OCStackResult application result
96  */
97 OCStackResult OCWrapperAclIndividualUpdateAce(const OCDevAddr *endPoint, OCCloudResponseCB callback);
98
99 /**
100  * ACL individual delete
101  *
102  * @param[in] endPoint          cloud host and port
103  * @param[in] callback          result callback
104  * @return  OCStackResult application result
105  */
106 OCStackResult OCWrapperAclIndividualDelete(const OCDevAddr *endPoint, OCCloudResponseCB callback);
107
108 /**
109  * ACL post group request function
110  *
111  * @param[in] endPoint          cloud host and port
112  * @param[in] callback          result callback
113  * @return  OCStackResult application result
114  */
115 OCStackResult OCWrapperAclCreateGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
116
117 /**
118  * ACL get group request function
119  *
120  * @param[in] endPoint          cloud host and port
121  * @param[in] callback          result callback
122  * @return  OCStackResult application result
123  */
124 OCStackResult OCWrapperAclFindMyGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
125
126 /**
127  * ACL delete group request function
128  *
129  * @param[in] endPoint          cloud host and port
130  * @param[in] callback          result callback
131  * @return  OCStackResult application result
132  */
133 OCStackResult OCWrapperAclDeleteGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
134
135 /**
136  * ACL join to invited group request function
137  *
138  * @param[in] endPoint          cloud host and port
139  * @param[in] callback          result callback
140  * @return  OCStackResult application result
141  */
142 OCStackResult OCWrapperAclJoinToInvitedGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
143
144 /**
145  * ACL observe group request function
146  *
147  * @param[in] endPoint          cloud host and port
148  * @param[in] callback          result callback
149  * @return  OCStackResult application result
150  */
151 OCStackResult OCWrapperAclObserveGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
152
153 /**
154  * ACL share device into group request function
155  *
156  * @param[in] endPoint          cloud host and port
157  * @param[in] callback          result callback
158  * @return  OCStackResult application result
159  */
160 OCStackResult OCWrapperAclShareDeviceIntoGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
161
162 /**
163  * ACL delete device from group request function
164  *
165  * @param[in] endPoint          cloud host and port
166  * @param[in] callback          result callback
167  * @return  OCStackResult application result
168  */
169 OCStackResult OCWrapperAclDeleteDeviceFromGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
170
171 /**
172  * ACL get group info request function
173  *
174  * @param[in] endPoint          cloud host and port
175  * @param[in] callback          result callback
176  * @return  OCStackResult application result
177  */
178 OCStackResult OCWrapperAclGroupGetInfo(const OCDevAddr *endPoint, OCCloudResponseCB callback);
179
180 /**
181  * ACL invite user to group request function
182  *
183  * @param[in] endPoint          cloud host and port
184  * @param[in] callback          result callback
185  * @return  OCStackResult application result
186  */
187 OCStackResult OCWrapperAclInviteUser(const OCDevAddr *endPoint, OCCloudResponseCB callback);
188
189 /**
190  * ACL get invitation request function
191  *
192  * @param[in] endPoint          cloud host and port
193  * @param[in] callback          result callback
194  * @return  OCStackResult application result
195  */
196 OCStackResult OCWrapperAclGetInvitation(const OCDevAddr *endPoint, OCCloudResponseCB callback);
197
198 /**
199  * ACL delete invitation request function (by receiver)
200  *
201  * @param[in] endPoint          cloud host and port
202  * @param[in] callback          result callback
203  * @return  OCStackResult application result
204  */
205 OCStackResult OCWrapperAclDeleteInvitation(const OCDevAddr *endPoint, OCCloudResponseCB callback);
206
207 /**
208  * ACL cancel invitation request function (by sender)
209  *
210  * @param[in] endPoint          cloud host and port
211  * @param[in] callback          result callback
212  * @return  OCStackResult application result
213  */
214 OCStackResult OCWrapperAclCancelInvitation(const OCDevAddr *endPoint, OCCloudResponseCB callback);
215
216 /**
217  * ACL check that given request can be applied to resource
218  *
219  * @param[in] endPoint          cloud host and port
220  * @param[in] callback          result callback
221  * @return  OCStackResult application result
222  */
223 OCStackResult OCWrapperAclPolicyCheck(const OCDevAddr *endPoint, OCCloudResponseCB callback);
224
225 /**
226  * Read user input (expect string value)
227  *
228  * @param[out] item           string item to fill
229  * @param[in] length          max allowed string length
230  * @param[in] description     item description
231  * @param[in] example         item example
232  */
233 void readString(char* item, int length, const char* description, const char* example);
234
235 /**
236  * Read user input (expect integer value)
237  *
238  * @param[out] item           integer item to fill
239  * @param[in] description     item description
240  * @param[in] example         item example
241  */
242 void readInteger(int* item, const char* description, const char* example);
243
244
245 #endif //OC_CLOUD_WRAPPER_H