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