1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
28 #define OIC_STRING_MAX_VALUE 100
29 #define IPV4_ADDR_SIZE 16
31 #define NET_WIFI_SSID_SIZE 16
32 #define NET_WIFI_PWD_SIZE 16
35 * @brief Mac address length for BT port
37 #define NET_MACADDR_SIZE 18
40 * Attributes used to form a proper easysetup conforming JSON message.
42 #define OC_RSRVD_ES_PS "ps"
43 #define OC_RSRVD_ES_TNN "tnn"
44 #define OC_RSRVD_ES_CD "cd"
45 #define OC_RSRVD_ES_TR "tr"
46 #define OC_RSRVD_ES_TNT "tnt"
47 #define OC_RSRVD_ES_ANT "ant"
48 #define OC_RSRVD_ES_URI_PROV "/oic/prov"
49 #define OC_RSRVD_ES_URI_NET "/oic/net"
60 ES_NETWORKNOTCONNECTED,
61 ES_RESOURCECREATED = 11,
62 ES_RECVREQOFPROVRES = 21,
64 ES_RECVUPDATEOFPROVRES,
65 ES_RECVTRIGGEROFPROVRES,
71 * Default state of the device
76 * Device will move to this state once the on boarding begins
81 * Device will move to this state after successful on-boarding of the device
86 * Device will move to this state once the on boarding is done
88 ES_PROVISIONING_STATE,
91 * Easy setup process is successful.
96 * This state is arbitrary one, any time device can come into this state
97 * Device will move to this state if the ownership transfer initiated by the Application
99 ES_OWNERSHIP_TRANSFERRING_STATE,
102 * This state is arbitrary one, any time device can come into this state
103 * Device will move to this state if the ownership transfer is completed
105 ES_OWNERSHIP_TRANSFERRED_STATE,
108 * This state is arbitrary one, any time device can come into this state
109 * Device will move to this state once the Application factory reset the device
111 ES_FACTORY_RESET_STATE,
117 * Provisioning Device Status
120 /// Address of remote server
122 /// Indicates adaptor type on which the response was received
123 OCConnectivityType connType;
127 * Provosioning Status
130 DEVICE_PROVISIONED = 0, DEVICE_NOT_PROVISIONED
134 * Response from queries to remote servers.
137 // Provisioning Status
138 ProvStatus provStatus;
139 // Provisioning Device Info
140 ProvDeviceInfo provDeviceInfo;
144 * @brief Network information of the Enroller
149 * @brief BT Mac Information
153 char btMacAddress[NET_MACADDR_SIZE]; /**< BT mac address **/
157 * @brief LE MAC Information
161 char leMacAddress[NET_MACADDR_SIZE]; /**< BLE mac address **/
165 * @brief IP Information
169 char ipAddress[IPV4_ADDR_SIZE]; /**< IP Address of the Enroller**/
170 char ssid[NET_WIFI_SSID_SIZE]; /**< ssid of the Enroller**/
171 char pwd[NET_WIFI_PWD_SIZE]; /**< pwd of the Enroller**/
177 * @brief Network Information
181 EnrolleeInfo_t netAddressInfo; /**< Enroller Network Info**/
182 OCConnectivityType connType; /**< Connectivity Type**/
183 bool isSecured; /**< Secure connection**/
184 } EnrolleeNWProvInfo_t;
187 * Client applications implement this callback to consume responses received from Servers.
189 typedef void (*OCProvisioningStatusCB)(ProvisioningInfo *provInfo);