1 /* *****************************************************************
3 * Copyright 2016 Samsung Electronics All Rights Reserved.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * *****************************************************************/
20 #ifndef OC_CLOUD_WRAPPER_H
21 #define OC_CLOUD_WRAPPER_H
23 #include "occloudprovisioning.h"
26 * Certificate-Issue request function
28 * @param[in] endPoint cloud host and port
29 * @param[in] callback result callback
30 * @return OCStackResult application result
32 OCStackResult OCWrapperCertificateIssueRequest(const OCDevAddr *endPoint, OCCloudResponseCB callback);
35 * CRL GET request function
37 * @param[in] endPoint cloud host and port
38 * @param[in] callback result callback
39 * @return OCStackResult application result
41 OCStackResult OCWrapperGetCRL(const OCDevAddr *endPoint, OCCloudResponseCB callback);
44 * CRL POST request function (with Serial Numbers list to revoke)
46 * @param[in] endPoint cloud host and port
47 * @param[in] callback result callback
48 * @return OCStackResult application result
50 OCStackResult OCWrapperPostCRL(const OCDevAddr *endPoint, OCCloudResponseCB callback);
53 * ACL id retrieve by device id
55 * @param[in] endPoint cloud host and port
56 * @param[in] callback result callback
57 * @return OCStackResult application result
59 OCStackResult OCWrapperAclIdGetByDevice(const OCDevAddr *endPoint, OCCloudResponseCB callback);
64 * @param[in] endPoint cloud host and port
65 * @param[in] callback result callback
66 * @return OCStackResult application result
68 OCStackResult OCWrapperAclIdCreate(const OCDevAddr *endPoint, OCCloudResponseCB callback);
73 * @param[in] endPoint cloud host and port
74 * @param[in] callback result callback
75 * @return OCStackResult application result
77 OCStackResult OCWrapperAclIdDelete(const OCDevAddr *endPoint, OCCloudResponseCB callback);
80 * ACL individual get info
82 * @param[in] endPoint cloud host and port
83 * @param[in] callback result callback
84 * @return OCStackResult application result
86 OCStackResult OCWrapperAclIndividualGetInfo(const OCDevAddr *endPoint, OCCloudResponseCB callback);
89 * ACL individual update ACE
91 * @param[in] endPoint cloud host and port
92 * @param[in] callback result callback
93 * @return OCStackResult application result
95 OCStackResult OCWrapperAclIndividualUpdateAce(const OCDevAddr *endPoint, OCCloudResponseCB callback);
98 * ACL individual delete
100 * @param[in] endPoint cloud host and port
101 * @param[in] callback result callback
102 * @return OCStackResult application result
104 OCStackResult OCWrapperAclIndividualDelete(const OCDevAddr *endPoint, OCCloudResponseCB callback);
107 * ACL individual delete ACE
109 * @param[in] endPoint cloud host and port
110 * @param[in] callback result callback
111 * @return OCStackResult application result
113 OCStackResult OCWrapperAclIndividualDeleteAce(const OCDevAddr *endPoint, OCCloudResponseCB callback);
116 * ACL post group request function
118 * @param[in] endPoint cloud host and port
119 * @param[in] callback result callback
120 * @return OCStackResult application result
122 OCStackResult OCWrapperAclCreateGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
125 * ACL get group request function
127 * @param[in] endPoint cloud host and port
128 * @param[in] callback result callback
129 * @return OCStackResult application result
131 OCStackResult OCWrapperAclFindMyGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
134 * ACL delete group request function
136 * @param[in] endPoint cloud host and port
137 * @param[in] callback result callback
138 * @return OCStackResult application result
140 OCStackResult OCWrapperAclDeleteGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
143 * ACL join to invited group request function
145 * @param[in] endPoint cloud host and port
146 * @param[in] callback result callback
147 * @return OCStackResult application result
149 OCStackResult OCWrapperAclJoinToInvitedGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
152 * ACL observe group request function
154 * @param[in] endPoint cloud host and port
155 * @param[in] callback result callback
156 * @return OCStackResult application result
158 OCStackResult OCWrapperAclObserveGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
161 * ACL share device into group request function
163 * @param[in] endPoint cloud host and port
164 * @param[in] callback result callback
165 * @return OCStackResult application result
167 OCStackResult OCWrapperAclShareDeviceIntoGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
170 * ACL delete device from group request function
172 * @param[in] endPoint cloud host and port
173 * @param[in] callback result callback
174 * @return OCStackResult application result
176 OCStackResult OCWrapperAclDeleteDeviceFromGroup(const OCDevAddr *endPoint, OCCloudResponseCB callback);
179 * ACL get group info request function
181 * @param[in] endPoint cloud host and port
182 * @param[in] callback result callback
183 * @return OCStackResult application result
185 OCStackResult OCWrapperAclGroupGetInfo(const OCDevAddr *endPoint, OCCloudResponseCB callback);
188 * ACL invite user to group request function
190 * @param[in] endPoint cloud host and port
191 * @param[in] callback result callback
192 * @return OCStackResult application result
194 OCStackResult OCWrapperAclInviteUser(const OCDevAddr *endPoint, OCCloudResponseCB callback);
197 * ACL get invitation request function
199 * @param[in] endPoint cloud host and port
200 * @param[in] callback result callback
201 * @return OCStackResult application result
203 OCStackResult OCWrapperAclGetInvitation(const OCDevAddr *endPoint, OCCloudResponseCB callback);
206 * ACL delete invitation request function (by receiver)
208 * @param[in] endPoint cloud host and port
209 * @param[in] callback result callback
210 * @return OCStackResult application result
212 OCStackResult OCWrapperAclDeleteInvitation(const OCDevAddr *endPoint, OCCloudResponseCB callback);
215 * ACL cancel invitation request function (by sender)
217 * @param[in] endPoint cloud host and port
218 * @param[in] callback result callback
219 * @return OCStackResult application result
221 OCStackResult OCWrapperAclCancelInvitation(const OCDevAddr *endPoint, OCCloudResponseCB callback);
224 * ACL check that given request can be applied to resource
226 * @param[in] endPoint cloud host and port
227 * @param[in] callback result callback
228 * @return OCStackResult application result
230 OCStackResult OCWrapperAclPolicyCheck(const OCDevAddr *endPoint, OCCloudResponseCB callback);
233 * Read user input (expect string value)
235 * @param[out] item string item to fill
236 * @param[in] length max allowed string length
237 * @param[in] description item description
238 * @param[in] example item example
240 void readString(char* item, int length, const char* description, const char* example);
243 * Read user input (expect integer value)
245 * @param[out] item integer item to fill
246 * @param[in] description item description
247 * @param[in] example item example
249 void readInteger(int* item, const char* description, const char* example);
252 * Copies whole binary file to out variable
254 * @param[in] list array of strings structure
255 * @param[out] out byte array to fill
256 * @return negative error code
258 int readFile(const char *name, OCByteString *out);
261 * Print array of strings
263 * @param[in] list array of strings
265 void printStringArray(stringArray_t *list);
268 * Print invitation response
270 * @param[in] in invitation response
272 void printInviteResponse(inviteResponse_t *in);
275 * Clear invitation response
277 * @param[in] in invitation response
279 void clearInviteResponse(inviteResponse_t *in);
281 #endif //OC_CLOUD_WRAPPER_H