Commit 0327af59 authored by Jay Sharma's avatar Jay Sharma Committed by Uze Choi

[IOT-2034] Updating Enrollee sample app for Tizen

Change-Id: I06468c436db5a883f747772841413a1afef9d23a
Signed-off-by: default avatarHarish Kumar Marappa <h.marappa@samsung.com>
Signed-off-by: default avatarJay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18921Reviewed-by: default avatarJihun Ha <jihun.ha@samsung.com>
Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
parent 415e986b
...@@ -45,7 +45,11 @@ static pthread_t gThreadHandle = 0; ...@@ -45,7 +45,11 @@ static pthread_t gThreadHandle = 0;
* It contains Server's Identity and the PSK credentials * It contains Server's Identity and the PSK credentials
* of other devices which the server trusts * of other devices which the server trusts
*/ */
#ifdef MULTIPLE_OWNER
static char CRED_FILE[] = "oic_svr_db_server_MOT.dat";
#else
static char CRED_FILE[] = "oic_svr_db_server.dat"; static char CRED_FILE[] = "oic_svr_db_server.dat";
#endif
OCPersistentStorage ps; OCPersistentStorage ps;
...@@ -70,6 +74,25 @@ void PrintMenu() ...@@ -70,6 +74,25 @@ void PrintMenu()
cout << "========================" << endl; cout << "========================" << endl;
} }
void ConnectRequestCbInApp(ESConnectRequest *connectRequest)
{
cout << "ConnectRequestCbInApp IN" << endl;
if(connectRequest == NULL)
{
cout << "connectRequest is NULL" << endl;
return ;
}
for(int i = 0 ; i < connectRequest->numRequest ; ++i)
{
cout << "connect : " << connectRequest->connect[i] << endl;
}
cout << "ConnectRequestCbInApp OUT" << endl;
PrintMenu();
}
void WiFiConfProvCbInApp(ESWiFiConfData *eventData) void WiFiConfProvCbInApp(ESWiFiConfData *eventData)
{ {
cout << "WiFiConfProvCbInApp IN" << endl; cout << "WiFiConfProvCbInApp IN" << endl;
...@@ -116,6 +139,7 @@ void DevConfProvCbInApp(ESDevConfData *eventData) ...@@ -116,6 +139,7 @@ void DevConfProvCbInApp(ESDevConfData *eventData)
cout << "Language : " << eventData->language << endl; cout << "Language : " << eventData->language << endl;
cout << "Country : " << eventData->country << endl; cout << "Country : " << eventData->country << endl;
cout << "DevConfProvCbInApp OUT" << endl; cout << "DevConfProvCbInApp OUT" << endl;
PrintMenu(); PrintMenu();
} }
...@@ -131,13 +155,17 @@ void CoapCloudConfProvCbInApp(ESCoapCloudConfData *eventData) ...@@ -131,13 +155,17 @@ void CoapCloudConfProvCbInApp(ESCoapCloudConfData *eventData)
} }
cout << "AuthCode : " << eventData->authCode << endl; cout << "AuthCode : " << eventData->authCode << endl;
cout << "AcessToken : " << eventData->accessToken << endl;
cout << "AcessTokenType : "<< eventData->accessTokenType << endl;
cout << "AuthProvider : " << eventData->authProvider << endl; cout << "AuthProvider : " << eventData->authProvider << endl;
cout << "CI Server : " << eventData->ciServer << endl; cout << "CI Server : " << eventData->ciServer << endl;
cout << "CoapCloudConfProvCbInApp OUT" << endl; cout << "CoapCloudConfProvCbInApp OUT" << endl;
PrintMenu(); PrintMenu();
} }
ESProvisioningCallbacks gCallbacks = { ESProvisioningCallbacks gCallbacks = {
.ConnectRequestCb = &ConnectRequestCbInApp,
.WiFiConfProvCb = &WiFiConfProvCbInApp, .WiFiConfProvCb = &WiFiConfProvCbInApp,
.DevConfProvCb = &DevConfProvCbInApp, .DevConfProvCb = &DevConfProvCbInApp,
.CoapCloudConfProvCb = &CoapCloudConfProvCbInApp .CoapCloudConfProvCb = &CoapCloudConfProvCbInApp
...@@ -157,7 +185,7 @@ FILE* server_fopen(const char *path, const char *mode) ...@@ -157,7 +185,7 @@ FILE* server_fopen(const char *path, const char *mode)
void EnableSecurity() void EnableSecurity()
{ {
printf("Inside EnableSecurity API..\n"); cout << "Inside EnableSecurity API.." << endl;
gIsSecured = true; gIsSecured = true;
...@@ -225,13 +253,14 @@ void SetDeviceInfo() ...@@ -225,13 +253,14 @@ void SetDeviceInfo()
{{WIFI_11G, WIFI_11N, WIFI_11AC, WiFi_EOF}, WIFI_5G}, {"Tizen Device"} {{WIFI_11G, WIFI_11N, WIFI_11AC, WiFi_EOF}, WIFI_5G}, {"Tizen Device"}
}; };
// Set user properties if needed
// Set device properties
if(ESSetDeviceProperty(&deviceProperty) == ES_ERROR) if(ESSetDeviceProperty(&deviceProperty) == ES_ERROR)
{ {
cout << "ESSetDeviceProperty Error" << endl; cout << "ESSetDeviceProperty Error" << endl;
} }
// Set user properties if needed
cout << "SetDeviceInfo OUT" << endl; cout << "SetDeviceInfo OUT" << endl;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment