Merge branch 'notification-service'
[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 delivered from mediator, which provides WiFi information
34  */
35 typedef struct
36 {
37     char ssid[MAX_SSIDLEN];         /**< Ssid of the Enroller**/
38     char pwd[MAX_CREDLEN];          /**< Pwd of the Enroller**/
39     WIFI_AUTHTYPE authtype;         /**< Auth type of the Enroller**/
40     WIFI_ENCTYPE enctype;           /**< Encryption type of the Enroller**/
41     void *userdata;                 /**< Vender-specific data**/
42 } ESWiFiProvData;
43
44 /**
45  * @brief Data structure delivered from mediator, which provides device configuration information
46  */
47 typedef struct
48 {
49     char language[OIC_STRING_MAX_VALUE];    /**< IETF language tag using ISO 639X **/
50     char country[OIC_STRING_MAX_VALUE];     /**< ISO Country Code (ISO 3166-1 Alpha-2) **/
51     void *userdata;                         /**< Vender-specific data**/
52 } ESDevConfProvData;
53
54 /**
55  * @brief Data structure delivered from mediator, which provides Cloud server information
56  */
57 typedef struct
58 {
59     char authCode[OIC_STRING_MAX_VALUE];        /**< Auth code issued by OAuth2.0-compatible account server **/
60     char authProvider[OIC_STRING_MAX_VALUE];    /**< Auth provider ID **/
61     char ciServer[OIC_STRING_MAX_VALUE];        /**< Cloud interface server URL which an Enrollee is going to registered **/
62     void *userdata;                             /**< Vender-specific data**/
63 } ESCloudProvData;
64
65 /**
66  * @brief Data structure stored for Device property which includes a WiFi and device configuration.
67  */
68 typedef struct
69 {
70     /**
71      * @brief Data structure indicating WiFi configuration of Enrollee
72      */
73     struct
74     {
75         WIFI_MODE mode[NUM_WIFIMODE];
76         WIFI_FREQ freq;
77     } WiFi;
78
79     /**
80      * @brief Data structure indicating device configuration of Enrollee
81      */
82     struct
83     {
84         char deviceName[MAX_DEVICELEN];
85     } DevConf;
86 } ESDeviceProperty;
87
88 /**
89  * A set of functions pointers for callback functions which are called after provisioning data is
90  * received from Mediator.
91  */
92 typedef struct
93 {
94     void (*WiFiProvCb) (ESWiFiProvData *);
95     void (*DevConfProvCb) (ESDevConfProvData *);
96     void (*CloudDataProvCb) (ESCloudProvData *);
97 } ESProvisioningCallbacks;
98
99
100 #ifdef __cplusplus
101 }
102 #endif
103
104 #endif //ES_ENROLLEE_COMMON_H_
105