From 3700da3d930fb5bc196a353b989ce1ffc8fb63f4 Mon Sep 17 00:00:00 2001 From: "hyuna0213.jo" Date: Fri, 14 Oct 2016 14:22:26 +0900 Subject: [PATCH] Modified connectivityType on calling getDeviceInfo API at CPP Sample Modified connectivityType on calling getDeviceInfo API at CPP Sample Invalid connectivityType is used after merging below patch. https://gerrit.iotivity.org/gerrit/#/c/13143 Change-Id: Ia881159af02f1eae984d4cda770e23cf6205741a Signed-off-by: hyuna0213.jo Reviewed-on: https://gerrit.iotivity.org/gerrit/13261 Tested-by: jenkins-iotivity Reviewed-by: Ashok Babu Channa (cherry picked from commit 0ba523056a0174479befe2a147d420be63f62d35) Reviewed-on: https://gerrit.iotivity.org/gerrit/13541 Reviewed-by: jihwan seo Reviewed-by: Jaehong Jo Reviewed-by: Ziran Sun --- resource/examples/fridgeclient.cpp | 3 ++- resource/examples/garageclient.cpp | 6 +++--- resource/examples/presenceclient.cpp | 4 ++-- resource/examples/roomclient.cpp | 5 ++--- resource/examples/simpleclient.cpp | 6 +++--- resource/examples/simpleclientHQ.cpp | 6 +++--- resource/examples/winuiclient.cpp | 9 +++++---- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/resource/examples/fridgeclient.cpp b/resource/examples/fridgeclient.cpp index 5f2dc4b..b5af26f 100644 --- a/resource/examples/fridgeclient.cpp +++ b/resource/examples/fridgeclient.cpp @@ -102,7 +102,8 @@ class ClientFridge std::cout << "Querying for device information... " << std::endl; - ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, CT_ADAPTER_IP, NULL); + ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, + resource->connectivityType(), NULL); if (ret == OC_STACK_OK) { diff --git a/resource/examples/garageclient.cpp b/resource/examples/garageclient.cpp index d7efa96..b1962f9 100644 --- a/resource/examples/garageclient.cpp +++ b/resource/examples/garageclient.cpp @@ -288,8 +288,8 @@ void foundResource(std::shared_ptr resource) std::cout << "Querying for device information... " << std::endl; - ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, CT_ADAPTER_IP, - NULL); + ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, + resource->connectivityType(), NULL); if (ret == OC_STACK_OK) { @@ -299,7 +299,7 @@ void foundResource(std::shared_ptr resource) { std::cout << "Getting device information failed." << std::endl; } - + if(resourceURI == "/a/garage") { curResource = resource; diff --git a/resource/examples/presenceclient.cpp b/resource/examples/presenceclient.cpp index 859fe11..2b3624f 100644 --- a/resource/examples/presenceclient.cpp +++ b/resource/examples/presenceclient.cpp @@ -150,8 +150,8 @@ void foundResource(std::shared_ptr resource) std::cout << "Querying for device information... " << std::endl; - ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, CT_ADAPTER_IP, - NULL); + ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, + resource->connectivityType(), NULL); if (ret == OC_STACK_OK) { diff --git a/resource/examples/roomclient.cpp b/resource/examples/roomclient.cpp index 6ce3591..a7587ec 100644 --- a/resource/examples/roomclient.cpp +++ b/resource/examples/roomclient.cpp @@ -225,9 +225,8 @@ void foundResource(std::shared_ptr resource) std::cout << "Querying for device information... " << std::endl; - ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, CT_ADAPTER_IP, - NULL); - + ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, + resource->connectivityType(), NULL); if (ret == OC_STACK_OK) { std::cout << "Getting device information is done." << std::endl; diff --git a/resource/examples/simpleclient.cpp b/resource/examples/simpleclient.cpp index aec34e3..a4c4416 100644 --- a/resource/examples/simpleclient.cpp +++ b/resource/examples/simpleclient.cpp @@ -449,8 +449,8 @@ void foundResource(std::shared_ptr resource) std::cout << "Querying for device information... " << std::endl; - ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, CT_ADAPTER_IP, - &receivedDeviceInfo); + ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, + resource->connectivityType(), &receivedDeviceInfo); if (ret == OC_STACK_OK) { @@ -460,7 +460,7 @@ void foundResource(std::shared_ptr resource) { std::cout << "Getting device information failed." << std::endl; } - + // Get the resource types std::cout << "\tList of resource types: " << std::endl; for(auto &resourceTypes : resource->getResourceTypes()) diff --git a/resource/examples/simpleclientHQ.cpp b/resource/examples/simpleclientHQ.cpp index 954d0c8..3977cee 100644 --- a/resource/examples/simpleclientHQ.cpp +++ b/resource/examples/simpleclientHQ.cpp @@ -411,8 +411,8 @@ void foundResource(std::shared_ptr resource) std::cout << "Querying for device information... " << std::endl; - ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, CT_ADAPTER_IP, - &receivedDeviceInfo); + ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, + resource->connectivityType(), &receivedDeviceInfo); if (ret == OC_STACK_OK) { @@ -422,7 +422,7 @@ void foundResource(std::shared_ptr resource) { std::cout << "Getting device information failed." << std::endl; } - + // Get the resource types std::cout << "\tList of resource types: " << std::endl; for(auto &resourceTypes : resource->getResourceTypes()) diff --git a/resource/examples/winuiclient.cpp b/resource/examples/winuiclient.cpp index a187fab..57fdaa0 100644 --- a/resource/examples/winuiclient.cpp +++ b/resource/examples/winuiclient.cpp @@ -195,7 +195,7 @@ void WinUIClientApp::foundResource(std::shared_ptr resource) { std::cout << "\t\t" << resourceInterfaces << std::endl; } - + OCStackResult ret; std::cout << "Querying for platform information... " << std::endl; @@ -213,8 +213,9 @@ void WinUIClientApp::foundResource(std::shared_ptr resource) std::cout << "Querying for device information... " << std::endl; - ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, CT_ADAPTER_IP, - &receivedDeviceInfo); + ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, + resource->connectivityType(), &receivedDeviceInfo); + if (ret == OC_STACK_OK) { @@ -224,7 +225,7 @@ void WinUIClientApp::foundResource(std::shared_ptr resource) { std::cout << "Getting device information failed." << std::endl; } - + if (resourceURI == "/a/media") { curResource = resource; -- 2.7.4