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 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 // Do not remove the include below
29 #ifndef ES_RESOURCE_HANDLER_H_
30 #define ES_RESOURCE_HANDLER_H_
36 typedef void (*ESWiFiCB) (ESResult, ESWiFiProvData *);
37 typedef void (*ESCloudCB) (ESResult, ESCloudProvData *);
38 typedef void (*ESDevConfCB) (ESResult, ESDevConfProvData *);
40 /* Structure to represent a Light resource */
41 typedef struct PROVRESOURCE
43 OCResourceHandle handle;
44 ProvStatus status; // provisiong status
45 ESErrorCode lastErrCode;
46 char errorMessage[MAX_ERRMSGLEN];
47 char ocfWebLinks[MAX_WEBLINKLEN];
52 OCResourceHandle handle;
53 WIFI_MODE supportedMode[NUM_WIFIMODE];
54 uint8_t numMode; // the number of device's supported wifi modes
55 WIFI_FREQ supportedFreq;
56 char ssid[MAX_SSIDLEN]; // target network name, i.e. SSID for WLAN, MAC address for BT.
57 char cred[MAX_CREDLEN]; // credential information.
58 WIFI_AUTHTYPE authType;
64 OCResourceHandle handle;
65 char authCode[OIC_STRING_MAX_VALUE];
66 char authProvider[OIC_STRING_MAX_VALUE];
67 char ciServer[OIC_STRING_MAX_VALUE];
72 OCResourceHandle handle;
73 char devName[MAX_DEVICELEN];
74 char language[OIC_STRING_MAX_VALUE];
75 char country[OIC_STRING_MAX_VALUE];
79 OCStackResult CreateEasySetupResources(bool isSecured, ESResourceMask resourceMask);
80 OCStackResult DeleteEasySetupResources();
82 OCStackResult SetDeviceProperty(ESDeviceProperty *deviceProperty);
83 OCStackResult SetEnrolleeState(ESEnrolleeState esState);
84 OCStackResult SetEnrolleeErrCode(ESErrorCode esErrCode);
86 void GetTargetNetworkInfoFromProvResource(char *, char *);
87 void RegisterWifiRsrcEventCallBack(ESWiFiCB);
88 void RegisterCloudRsrcEventCallBack(ESCloudCB);
89 void RegisterDevConfRsrcEventCallBack(ESDevConfCB);
90 void UnRegisterResourceEventCallBack(void);
96 #endif //ES_RESOURCE_HANDLER_H_