1 //******************************************************************
3 // Copyright 2016 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 #ifndef _ES_MEDIATOR_SIMULATOR_H_
22 #define _ES_MEDIATOR_SIMULATOR_H_
26 #include "OCPlatform.h"
28 #include "oic_malloc.h"
31 #include "ESEnrolleeCommon.h"
32 #include "easysetup.h"
34 class ESEnrolleeSimulator
40 ~ESEnrolleeSimulator() = default;
42 ESEnrolleeSimulator(const ESEnrolleeSimulator &) = delete;
43 ESEnrolleeSimulator & operator = (const ESEnrolleeSimulator &) = delete;
45 ESEnrolleeSimulator(ESEnrolleeSimulator &&) = delete;
46 ESEnrolleeSimulator & operator = (ESEnrolleeSimulator &&) = delete;
48 ESResult initEnrollee()
50 ESResourceMask resourcemMask = (ESResourceMask)(ES_WIFI_RESOURCE |
53 ESProvisioningCallbacks callbacks;
55 callbacks.WiFiProvCb = &onWiFiProvisioning;
56 callbacks.DevConfProvCb = &onDevConfProvisioning;
57 callbacks.CloudDataProvCb = &onCloudProvisioning;
59 return ESInitEnrollee(false, resourcemMask, callbacks);
62 ESResult setDeviceProperty()
64 ESDeviceProperty deviceProperty = {
65 {{WIFI_11G, WiFi_EOF}, WIFI_5G}, {"Test Device", "Test Model Number"}
68 return ESSetDeviceProperty(&deviceProperty);
73 return ESSetState(ES_STATE_CONNECTED_TO_ENROLLER);
76 ESResult setESErrorCode()
78 return ESSetErrorCode(ES_ERRCODE_NO_INTERNETCONNECTION);
82 static void onWiFiProvisioning(ESWiFiProvData* /*data*/)
86 static void onDevConfProvisioning(ESDevConfProvData* /*data*/)
90 static void onCloudProvisioning(ESCloudProvData* /*data*/)
95 #endif //_NS_CONSUMER_SIMULATOR_H_