From 0327af59d112b636d6e05c426562a8e5d073e08e Mon Sep 17 00:00:00 2001 From: Jay Sharma Date: Thu, 13 Apr 2017 19:39:57 +0530 Subject: [PATCH] [IOT-2034] Updating Enrollee sample app for Tizen Change-Id: I06468c436db5a883f747772841413a1afef9d23a Signed-off-by: Harish Kumar Marappa Signed-off-by: Jay Sharma Reviewed-on: https://gerrit.iotivity.org/gerrit/18921 Reviewed-by: Jihun Ha Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- .../tizen-sdb/EnrolleeSample/enrolleewifi.cpp | 35 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/enrolleewifi.cpp b/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/enrolleewifi.cpp index 17a035e..b55a252 100755 --- a/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/enrolleewifi.cpp +++ b/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/enrolleewifi.cpp @@ -45,7 +45,11 @@ static pthread_t gThreadHandle = 0; * It contains Server's Identity and the PSK credentials * 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"; +#endif OCPersistentStorage ps; @@ -70,6 +74,25 @@ void PrintMenu() 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) { cout << "WiFiConfProvCbInApp IN" << endl; @@ -116,6 +139,7 @@ void DevConfProvCbInApp(ESDevConfData *eventData) cout << "Language : " << eventData->language << endl; cout << "Country : " << eventData->country << endl; + cout << "DevConfProvCbInApp OUT" << endl; PrintMenu(); } @@ -131,13 +155,17 @@ void CoapCloudConfProvCbInApp(ESCoapCloudConfData *eventData) } cout << "AuthCode : " << eventData->authCode << endl; + cout << "AcessToken : " << eventData->accessToken << endl; + cout << "AcessTokenType : "<< eventData->accessTokenType << endl; cout << "AuthProvider : " << eventData->authProvider << endl; cout << "CI Server : " << eventData->ciServer << endl; + cout << "CoapCloudConfProvCbInApp OUT" << endl; PrintMenu(); } ESProvisioningCallbacks gCallbacks = { + .ConnectRequestCb = &ConnectRequestCbInApp, .WiFiConfProvCb = &WiFiConfProvCbInApp, .DevConfProvCb = &DevConfProvCbInApp, .CoapCloudConfProvCb = &CoapCloudConfProvCbInApp @@ -157,7 +185,7 @@ FILE* server_fopen(const char *path, const char *mode) void EnableSecurity() { - printf("Inside EnableSecurity API..\n"); + cout << "Inside EnableSecurity API.." << endl; gIsSecured = true; @@ -225,13 +253,14 @@ void SetDeviceInfo() {{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) { cout << "ESSetDeviceProperty Error" << endl; } - // Set user properties if needed - cout << "SetDeviceInfo OUT" << endl; } -- 2.7.4