1 //******************************************************************
3 // Copyright 2014 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
39 //The following variable determines the interface (wifi, ethernet etc.)
40 //to be used for sending unicast messages. Default set to Ethernet.
41 static OCConnectivityType OC_CONNTYPE = CT_IP_USE_V4;
43 static const char * UNICAST_PROVISIONING_QUERY = "coap://%s:%d/oic/res?rt=oic.prov";
44 static const char * UNICAST_PROV_STATUS_QUERY = "coap://%s:%d%s";
48 * Attributes used to form a proper easysetup conforming JSON message.
50 #define OC_RSRVD_ES_PS "ps"
51 #define OC_RSRVD_ES_TNN "tnn"
52 #define OC_RSRVD_ES_CD "cd"
53 #define OC_RSRVD_ES_TR "tr"
54 #define OC_RSRVD_ES_TNT "tnt"
55 #define OC_RSRVD_ES_ANT "ant"
56 #define OC_RSRVD_ES_URI_PROV "/oic/prov"
57 #define OC_RSRVD_ES_URI_NET "/oic/net"
67 ES_NETWORKNOTCONNECTED,
68 ES_RESOURCECREATED = 11,
69 ES_RECVREQOFPROVRES = 21,
71 ES_RECVUPDATEOFPROVRES,
72 ES_RECVTRIGGEROFPROVRES,
77 * Provisioning Device Status
80 /// Address of remote server
82 /// Indicates adaptor type on which the response was received
83 OCConnectivityType connType;
90 DEVICE_PROVISIONED = 0, DEVICE_NOT_PROVISIONED
94 * Response from queries to remote servers. Queries are made by calling the @ref OCDoResource API.
97 // Provisioning Status
98 ProvStatus provStatus;
99 // Provisioning Device Info
100 ProvDeviceInfo provDeviceInfo;
104 * @brief Network information of the Enroller
109 * @brief BT Mac Information
113 char btMacAddress[NET_MACADDR_SIZE]; /**< BT mac address **/
117 * @brief LE MAC Information
121 char leMacAddress[NET_MACADDR_SIZE]; /**< BLE mac address **/
125 * @brief IP Information
129 char ipAddress[IPV4_ADDR_SIZE]; /**< IP Address of the Enroller**/
130 char ssid[NET_WIFI_SSID_SIZE]; /**< ssid of the Enroller**/
131 char pwd[NET_WIFI_PWD_SIZE]; /**< pwd of the Enroller**/
137 * @brief Network Information
141 EnrolleeInfo_t netAddressInfo; /**< Enroller Network Info**/
142 OCConnectivityType connType; /**< Connectivity Type**/
143 bool isSecured; /**< Secure connection**/
144 } EnrolleeNWProvInfo_t;
147 * Client applications implement this callback to consume responses received from Servers.
149 typedef void (*OCProvisioningStatusCB)(ProvisioningInfo *provInfo);