Modified connectivityType on calling getDeviceInfo API at CPP Sample
authorhyuna0213.jo <hyuna0213.jo@samsung.com>
Fri, 14 Oct 2016 05:22:26 +0000 (14:22 +0900)
committerZiran Sun <ziran.sun@samsung.com>
Fri, 21 Oct 2016 09:01:31 +0000 (09:01 +0000)
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 <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13261
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit 0ba523056a0174479befe2a147d420be63f62d35)
Reviewed-on: https://gerrit.iotivity.org/gerrit/13541
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
resource/examples/fridgeclient.cpp
resource/examples/garageclient.cpp
resource/examples/presenceclient.cpp
resource/examples/roomclient.cpp
resource/examples/simpleclient.cpp
resource/examples/simpleclientHQ.cpp
resource/examples/winuiclient.cpp

index 5f2dc4b..b5af26f 100644 (file)
@@ -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)
         {
index d7efa96..b1962f9 100644 (file)
@@ -288,8 +288,8 @@ void foundResource(std::shared_ptr<OCResource> 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<OCResource> resource)
             {
                 std::cout << "Getting device information failed." << std::endl;
             }
-  
+
             if(resourceURI == "/a/garage")
             {
                 curResource = resource;
index 859fe11..2b3624f 100644 (file)
@@ -150,8 +150,8 @@ void foundResource(std::shared_ptr<OCResource> 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)
              {
index 6ce3591..a7587ec 100644 (file)
@@ -225,9 +225,8 @@ void foundResource(std::shared_ptr<OCResource> 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;
index aec34e3..a4c4416 100644 (file)
@@ -449,8 +449,8 @@ void foundResource(std::shared_ptr<OCResource> 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<OCResource> 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())
index 954d0c8..3977cee 100644 (file)
@@ -411,8 +411,8 @@ void foundResource(std::shared_ptr<OCResource> 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<OCResource> 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())
index a187fab..57fdaa0 100644 (file)
@@ -195,7 +195,7 @@ void WinUIClientApp::foundResource(std::shared_ptr<OCResource> resource)
             {\r
                 std::cout << "\t\t" << resourceInterfaces << std::endl;\r
             }\r
-            \r
+\r
             OCStackResult ret;\r
             std::cout << "Querying for platform information... " << std::endl;\r
 \r
@@ -213,8 +213,9 @@ void WinUIClientApp::foundResource(std::shared_ptr<OCResource> resource)
 \r
             std::cout << "Querying for device information... " << std::endl;\r
 \r
-            ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI, CT_ADAPTER_IP,\r
-                    &receivedDeviceInfo);\r
+            ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,\r
+                                       resource->connectivityType(), &receivedDeviceInfo);\r
+\r
 \r
             if (ret == OC_STACK_OK)\r
             {\r
@@ -224,7 +225,7 @@ void WinUIClientApp::foundResource(std::shared_ptr<OCResource> resource)
             {\r
                 std::cout << "Getting device information failed." << std::endl;\r
             }\r
-   \r
+\r
             if (resourceURI == "/a/media")\r
             {\r
                 curResource = resource;\r