ES_ROLE=enrollee ES_TARGET_ENROLLEE=android ES_SOFTAP_MODE=ENROLLEE_SOFTAP
4) If built for security mode:
- After installing sample RPM on device, copy required json files and other applications to the same path where enrollee_wifi(executable) is available
+ After installing sample RPM on device, copy required .dat files and other applications to the same path where enrollee_wifi(executable) is available
(If needed, modify the parameters accordingly)
Note :- Upon successful execution of above command(s) RI library and sample console application(for tizen enrollee)
Execute the sample app by below commands
i) cd /usr/apps/com.oic.es.sample/bin
If executing with secure mode enabled then do the below step (no. ii)
- ii) cp /usr/lib/oic_svr_db_server.json .
+ ii) cp /usr/lib/oic_svr_db_server.dat .
Execute the application
./enrollee_wifi
#define ES_SAMPLE_APP_TAG "ES_SAMPLE_APP_TAG"
#define DECLARE_MENU(FUNC, ...) { #FUNC, FUNC }
-#define JSON_DB_PATH "./oic_svr_db_client.json"
+#define JSON_DB_PATH "./oic_svr_db_client.dat"
using namespace OC;
using namespace OIC::Service;
static RemoteEnrollee::shared_ptr remoteEnrollee = nullptr;
static std::string ipaddress, ssid, pwd;
+char security;
struct CloseApp
{
easySetupIntance = EasySetup::getInstance();
- ipaddress = "192.168.1.104";
- ssid = "hub2.4G";
- pwd = "22221111";
+ cout<<"\n Enter the IP address : ";
+ cin>>ipaddress;
+ cout<<"\n Enter the Target Network SSID : ";
+ cin>>ssid;
+ cout<<"\n Enter the Target Network Password : ";
+ cin>>pwd;
+ cout<<"\n Enable Security: [Y/N] ";
+ cin>>security;
- netInfo.connType = CT_ADAPTER_IP;
-
- OICStrcpy(netInfo.provData.WIFI.ssid, NET_WIFI_SSID_SIZE - 1, ssid.c_str());
- OICStrcpy(netInfo.provData.WIFI.pwd, NET_WIFI_PWD_SIZE - 1, pwd.c_str());
-
- onboardingConn.isSecured = false;
- OICStrcpy(onboardingConn.ipAddress, IPV4_ADDR_SIZE - 1, ipaddress.c_str());
-
- try
+ if ( ipaddress.size() == 0 || ssid.size() == 0 || pwd.size()==0 )
{
- remoteEnrollee = easySetupIntance->createEnrolleeDevice(netInfo,onboardingConn);
+ cout<<"\n Invalid information try again !!!";
}
- catch (OCException &e)
- {
- std::cout << "Exception during createEnrolleeDevice call" << e.reason();
- return;
+ else
+ {
+ cout <<"\n Entered details are : \n";
+ cout<<"\n IP address : "<<ipaddress;
+ cout<<"\n Target Network SSID : "<<ssid;
+ cout<<"\n Target Network Password : "<<pwd;
+
+ if (security == 'Y' || security == 'y' )
+ {
+ onboardingConn.isSecured = true;
+ cout<<"\n Security is Enabled\n\n\n";
+ }
+ else
+ {
+ onboardingConn.isSecured = false;
+ cout<<"\n Security is not Enabled\n\n\n";
+ }
+
+ netInfo.connType = CT_ADAPTER_IP;
+
+ OICStrcpy(netInfo.provData.WIFI.ssid, NET_WIFI_SSID_SIZE - 1, ssid.c_str());
+ OICStrcpy(netInfo.provData.WIFI.pwd, NET_WIFI_PWD_SIZE - 1, pwd.c_str());
+
+ OICStrcpy(onboardingConn.ipAddress, IPV4_ADDR_SIZE - 1, ipaddress.c_str());
+
+ try
+ {
+ remoteEnrollee = easySetupIntance->createEnrolleeDevice(netInfo,onboardingConn);
+ }
+ catch (OCException &e)
+ {
+ std::cout << "Exception during createEnrolleeDevice call" << e.reason();
+ return;
+ }
+
+ remoteEnrollee->registerEasySetupStatusHandler(&easySetupStatusCallback);
}
- remoteEnrollee->registerEasySetupStatusHandler(&easySetupStatusCallback);
}
void runEasySetupMenu()
{
cp ./resource/csdk/security/provisioning/include/oxm/*.h %{buildroot}%{_includedir}
cp ./resource/csdk/security/provisioning/include/internal/*.h %{buildroot}%{_includedir}
cp ./resource/csdk/security/provisioning/include/*.h %{buildroot}%{_includedir}
-cp ./resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.json %{buildroot}%{_libdir}/oic_svr_db_server.json
+cp ./resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat %{buildroot}%{_libdir}/oic_svr_db_server.dat
%endif
%if 0%{?SECURED} == 1
%{_libdir}/libocpmapi.so
%{_libdir}/libocprovision.so
-%{_libdir}/oic_svr_db_server.json
+%{_libdir}/oic_svr_db_server.dat
%endif
%if 0%{?tizen_version_major} < 3
%{_datadir}/license/%{name}-service