[easysetup] Sample application bug fix when security is enabled
authorlankamadan <lanka.madan@samsung.com>
Wed, 23 Dec 2015 07:25:58 +0000 (16:25 +0900)
committerMadan Lanka <lanka.madan@samsung.com>
Thu, 24 Dec 2015 05:03:51 +0000 (05:03 +0000)
- Bug when security is enabled is fixed

Change-Id: Icf22ee6a71c5665419cc358d8b4d0388d9f81e62
Signed-off-by: lankamadan <lanka.madan@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4715
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
service/easy-setup/sampleapp/mediator/linux/mediator_cpp.cpp

index d158084..91d0aed 100755 (executable)
@@ -97,17 +97,17 @@ void initEasySetup()
     //std::cout << "Enter the target enrollee ipv4 address ";
 
 
-    ssid = "hello";
+    ssid = "hub2.4G";
     //std::cout << "Enter the ssid of the target Enrolleer ";
     //std:: cin >> ssid;
 
-    pwd = "helalalal";
+    pwd = "22221111";
     //std::cout << "Enter the pwd of the target Enrolleer ";
     //std::cin >> pwd;
 
     netInfo.connType = CT_ADAPTER_IP;
     netInfo.isSecured = false;
-    netInfo.needSecuredEasysetup = false;
+    netInfo.needSecuredEasysetup = true;
     OICStrcpy(netInfo.netAddressInfo.WIFI.ipAddress, IPV4_ADDR_SIZE - 1, ipaddress.c_str());
     OICStrcpy(netInfo.netAddressInfo.WIFI.ssid, NET_WIFI_SSID_SIZE - 1, ssid.c_str());
     OICStrcpy(netInfo.netAddressInfo.WIFI.pwd, NET_WIFI_PWD_SIZE - 1, pwd.c_str());
@@ -166,20 +166,15 @@ static FILE* client_open(const char *UNUSED_PARAM, const char *mode)
     return fopen(JSON_DB_PATH, mode);
 }
 
-void configurePlatform()
+int main()
 {
     OCPersistentStorage ps {client_open, fread, fwrite, fclose, unlink };
 
     PlatformConfig config
     {
-        OC::ServiceType::InProc, ModeType::Both, "0.0.0.0", 0, OC::QualityOfService::LowQos, NULL
+        OC::ServiceType::InProc, ModeType::Both, "0.0.0.0", 0, OC::QualityOfService::LowQos, &ps
     };
     OCPlatform::Configure(config);
-}
-
-int main()
-{
-    configurePlatform();
 
     g_currentRun = runEasySetupMenu;