IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
escommon.h
Go to the documentation of this file.
1 //******************************************************************
2 //
3 // Copyright 2015 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 
21 #ifndef ES_COMMON_H_
22 #define ES_COMMON_H_
23 
24 #include "ocstack.h"
25 #include "octypes.h"
26 
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31 
32 // Defines
33 #define OC_RSRVD_ES_RES_TYPE_COL "oic.wk.col"
34 #define OC_RSRVD_ES_INTERFACE "if"
35 #define OC_RSRVD_ES_RES_TYPE "rt"
36 
37 #define OIC_STRING_MAX_VALUE 64
38 #define OIC_URI_STRING_MAX_VALUE 256
39 #define MAX_WEBLINKLEN 3
40 #define NUM_WIFIMODE 10
41 #define NUM_WIFIFREQ 5
42 #define NUM_CONNECT_TYPE 3
43 #define NUM_WIFIAUTHTYPE 4
44 #define NUM_WIFIENCTYPE 6
45 
49 #define OC_RSRVD_ES_PROVSTATUS "ps"
50 #define OC_RSRVD_ES_LAST_ERRORCODE "lec"
51 #define OC_RSRVD_ES_LINKS "links"
52 #define OC_RSRVD_ES_SUPPORTEDWIFIMODE "swmt"
53 #define OC_RSRVD_ES_SUPPORTEDWIFIFREQ "swf"
54 #define OC_RSRVD_ES_SUPPORTEDWIFIAUTHTYPE "swat"
55 #define OC_RSRVD_ES_SUPPORTEDWIFIENCTYPE "swet"
56 #define OC_RSRVD_ES_SSID "tnn"
57 #define OC_RSRVD_ES_CRED "cd"
58 #define OC_RSRVD_ES_AUTHTYPE "wat"
59 #define OC_RSRVD_ES_ENCTYPE "wet"
60 #define OC_RSRVD_ES_AUTHCODE "ac"
61 #define OC_RSRVD_ES_ACCESSTOKEN "at"
62 #define OC_RSRVD_ES_ACCESSTOKEN_TYPE "att"
63 #define OC_RSRVD_ES_AUTHPROVIDER "apn"
64 #define OC_RSRVD_ES_CISERVER "cis"
65 #define OC_RSRVD_ES_SERVERID "sid"
66 #define OC_RSRVD_ES_DEVNAME "dn"
67 #define OC_RSRVD_ES_HREF "href"
68 #define OC_RSRVD_ES_CONNECT "cn"
69 
73 #define OC_RSRVD_ES_RES_TYPE_EASYSETUP "oic.r.easysetup"
74 #define OC_RSRVD_ES_URI_EASYSETUP "/EasySetupResURI"
75 #define OC_RSRVD_ES_RES_TYPE_WIFICONF "oic.r.wificonf"
76 #define OC_RSRVD_ES_URI_WIFICONF "/WiFiConfResURI"
77 #define OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF "oic.r.coapcloudconf"
78 #define OC_RSRVD_ES_URI_COAPCLOUDCONF "/CoapCloudConfResURI"
79 #define OC_RSRVD_ES_RES_TYPE_DEVCONF "oic.r.devconf"
80 #define OC_RSRVD_ES_URI_DEVCONF "/DevConfResURI"
81 
82 
86 //TODO: Remove WIFI_BOTH & WIFI_FREQ_NONE, if they are not used anymore. Array should be used to specify multiple values.
87 typedef enum
88 {
89  WIFI_24G = 0,
93 } WIFI_FREQ;
94 
98 typedef enum
99 {
100  WIFI_11A = 0,
105 } WIFI_MODE;
106 
110 typedef enum
111 {
112  NONE_AUTH = 0,
113  WEP,
116 } WIFI_AUTHTYPE;
117 
121 typedef enum
122 {
123  NONE_ENC = 0,
127  AES,
129 } WIFI_ENCTYPE;
130 
134 typedef enum
135 {
140 
144 typedef enum
145 {
150 
154 typedef enum
155 {
159  ES_OK = 0,
160 
165 
170 
176 
181 
186 
194 
199 
204 
209 
220 
229 
238 
247 
256 
263 
270 
275  ES_ERROR = 255
276 } ESResult;
277 
281 typedef enum
282 {
287 
292 typedef enum
293 {
298 
303 
308 
313 
318 
323 
328 
333 
338 
343 
349 
353 typedef enum
354 {
359 
364 
369 
374 
379 
384 
389 
394 
399 
404 
409 
414 
419 
424 
429 
434 
439 
445 
450 } ESErrorCode;
451 
452 #ifdef __cplusplus
453 }
454 #endif
455 
456 #endif //ES_COMMON_H_
802.11ac
Definition: escommon.h:104
OAUTH_TOKENTYPE
OAuth Access Token Types.
Definition: escommon.h:134
WEP-128.
Definition: escommon.h:125
Cloud server is not reachable due to wrong URL of cloud server, for example.
Definition: escommon.h:408
Init value.
Definition: escommon.h:146
Unknown error occured.
Definition: escommon.h:449
Ownership transfer which is cert-based method fails due to user confirmation is denied.
Definition: escommon.h:198
Default state of the device.
Definition: escommon.h:297
Access token is not valid due to its expiration, for example.
Definition: escommon.h:423
Refresh of expired access token is failed due to some reasons.
Definition: escommon.h:428
Definition: escommon.h:136
Provisioning fails for some reason.
Definition: escommon.h:275
NO encryption.
Definition: escommon.h:123
Enrollee can not connect to a target WiFi AP because the AP resides in an unsupported WiFi frequency...
Definition: escommon.h:444
Valid GET or POST request fails for some reason.
Definition: escommon.h:175
WiFi's Password is wrong.
Definition: escommon.h:368
Init Error Code.
Definition: escommon.h:358
802.11a
Definition: escommon.h:100
Definition: escommon.h:284
End of Easy setup status.
Definition: escommon.h:347
Ownership transfer which is cert-based method fails due to wrong certificate.
Definition: escommon.h:203
Ownership information is not synchronized between Mediator and Enrollee.
Definition: escommon.h:219
MOT is not supported at the target Enrollee device.
Definition: escommon.h:228
ESResult
A result of Easy Setup.
Definition: escommon.h:154
Target user does not exist in cloud server.
Definition: escommon.h:438
2.4G and 5G
Definition: escommon.h:91
Status indicating registeration failure to cloud.
Definition: escommon.h:327
EOF.
Definition: escommon.h:92
802.11n
Definition: escommon.h:103
Secure resource is discovered.
Definition: escommon.h:164
Auth type is not supported by the Enroller.
Definition: escommon.h:398
ES_CONNECT_TYPE
A target configuration type to be connected (or executed)
Definition: escommon.h:144
WEP-64.
Definition: escommon.h:124
Enrollee discovery fails in cloud provisioning.
Definition: escommon.h:169
2.4G
Definition: escommon.h:89
Cert.
Definition: escommon.h:269
ESResourceMask
Indicate which resource is created in Enrollee.
Definition: escommon.h:281
Status indicating being connecting to target network.
Definition: escommon.h:302
Definition: escommon.h:137
WEP.
Definition: escommon.h:113
Timeout occured.
Definition: escommon.h:383
WIFI_FREQ
Supported WIFI frequency like 2.4G and 5G.
Definition: escommon.h:87
Status indicating successful resource publish to cloud.
Definition: escommon.h:337
802.11b
Definition: escommon.h:101
ESEnrolleeState
Indicate enrollee and provisioning status.
Definition: escommon.h:292
ESErrorCode
Indicate last error code to describe a reason of error during easy setup.
Definition: escommon.h:353
Security opertion is not supported because Mediator is built as unsecured mode.
Definition: escommon.h:180
This file contains the definition, types and APIs for resource(s) be implemented. ...
Status indicating successful conection to target network.
Definition: escommon.h:307
Definition: escommon.h:285
There is no Internet connection.
Definition: escommon.h:378
Ownership transfer fails due to one of unexpected reasons.
Definition: escommon.h:193
Status indicating successful registration to cloud.
Definition: escommon.h:322
Provisioning succeeds.
Definition: escommon.h:159
Status indicating connection failure to target network.
Definition: escommon.h:312
Auth type is not supported by the Enrollee.
Definition: escommon.h:388
MOT enabling is failed.
Definition: escommon.h:237
IP address is not allocated.
Definition: escommon.h:373
WiFi Conf resource.
Definition: escommon.h:147
WPA2-PSK.
Definition: escommon.h:115
MOT method selection is failed.
Definition: escommon.h:246
Security resource discovery fails due to loss of discovery packet or absence of the resource in a net...
Definition: escommon.h:185
Target device is not discovered in cloud server.
Definition: escommon.h:433
TKIP-AES.
Definition: escommon.h:128
TKIP.
Definition: escommon.h:126
5G
Definition: escommon.h:90
WIFI_ENCTYPE
WIFI encryption type of the Enroller.
Definition: escommon.h:121
WIFI_AUTHTYPE
WIFI Authentication tlype of the Enroller.
Definition: escommon.h:110
Coap Cloud Conf resource.
Definition: escommon.h:148
AES.
Definition: escommon.h:127
Status indicating resource publish failure to cloud.
Definition: escommon.h:342
Definition: escommon.h:138
Status indicating being publishing resources to cloud.
Definition: escommon.h:332
Enc type is not supported by the Enroller.
Definition: escommon.h:403
No response from cloud server.
Definition: escommon.h:413
WPA-PSK.
Definition: escommon.h:114
Enc type is not supported by the Enrollee.
Definition: escommon.h:393
enum ESEnrolleeState ProvStatus
Ownership transfer which is random-pin method fails due to wrong pin.
Definition: escommon.h:208
WiFi's SSID is not found.
Definition: escommon.h:363
802.11g
Definition: escommon.h:102
Definition: escommon.h:283
ACL provisioning fails in cloud provisioning.
Definition: escommon.h:262
Delivered authcode is not valid.
Definition: escommon.h:418
A provisioning of Pre-configured pin number for MOT is failed.
Definition: escommon.h:255
Status indicating being registering to cloud.
Definition: escommon.h:317
NO authentication.
Definition: escommon.h:112
WIFI_MODE
Supported WIFI mode like 802.11g and 802.11n.
Definition: escommon.h:98