Changing the length of access token
[platform/upstream/iotivity.git] / service / easy-setup / enrollee / inc / ESEnrolleeCommon.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
21 #ifndef ES_ENROLLEE_COMMON_H_
22 #define ES_ENROLLEE_COMMON_H_
23
24 #include "ocstack.h"
25 #include "octypes.h"
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32 /**
33  * @brief Data structure for connect request from Mediator
34  */
35 typedef struct
36 {
37     ES_CONNECT_TYPE connect[NUM_CONNECT_TYPE];
38     int numRequest;
39 } ESConnectRequest;
40
41 /**
42  * @brief Data structure delivered from mediator, which provides WiFi information
43  */
44 typedef struct
45 {
46     char ssid[OIC_STRING_MAX_VALUE];        /**< Ssid of the Enroller**/
47     char pwd[OIC_STRING_MAX_VALUE];         /**< Pwd of the Enroller**/
48     WIFI_AUTHTYPE authtype;                 /**< Auth type of the Enroller**/
49     WIFI_ENCTYPE enctype;                   /**< Encryption type of the Enroller**/
50     void *userdata;                         /**< Vender-specific data**/
51 } ESWiFiConfData;
52
53 /**
54  * @brief Data structure delivered from mediator, which provides device configuration information
55  */
56 typedef struct
57 {
58     // TODO: variables can be added when some properties in oic.r.devconf resource are specified.
59     void *userdata;                         /**< Vender-specific data**/
60 } ESDevConfData;
61
62 /**
63  * @brief Data structure delivered from mediator, which provides Cloud server information
64  */
65 typedef struct
66 {
67     char authCode[OIC_STRING_MAX_VALUE];        /**< Auth code issued by OAuth2.0-compatible account server **/
68     char accessToken[OIC_STRING_ACCESS_TOKEN_MAX_VALUE];     /**< Access token resolved with an auth code **/
69     OAUTH_TOKENTYPE accessTokenType;            /**< Access token type **/
70     char authProvider[OIC_STRING_MAX_VALUE];    /**< Auth provider ID **/
71     char ciServer[OIC_STRING_MAX_VALUE];        /**< Cloud interface server URL which an Enrollee is going to registered **/
72     void *userdata;                             /**< Vender-specific data**/
73 } ESCoapCloudConfData;
74
75 /**
76  * @brief Data structure stored for Device property which includes a WiFi and device configuration.
77  */
78 typedef struct
79 {
80     /**
81      * @brief Data structure indicating WiFi configuration of Enrollee
82      */
83     struct
84     {
85         WIFI_MODE mode[NUM_WIFIMODE];
86         WIFI_FREQ freq;
87     } WiFi;
88
89     /**
90      * @brief Data structure indicating device configuration of Enrollee
91      */
92     struct
93     {
94         char deviceName[OIC_STRING_MAX_VALUE];
95     } DevConf;
96 } ESDeviceProperty;
97
98 /**
99  * A set of functions pointers for callback functions which are called after provisioning data is
100  * received from Mediator.
101  */
102 typedef struct
103 {
104     void (*ConnectRequestCb) (ESConnectRequest *);
105     void (*WiFiConfProvCb) (ESWiFiConfData *);
106     void (*DevConfProvCb) (ESDevConfData *);
107     void (*CoapCloudConfProvCb) (ESCoapCloudConfData *);
108 } ESProvisioningCallbacks;
109
110
111 #ifdef __cplusplus
112 }
113 #endif
114
115 #endif //ES_ENROLLEE_COMMON_H_
116