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>
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 << "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 failed." << std::endl;
}
-
+
if(resourceURI == "/a/garage")
{
curResource = 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 << "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;
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)
{
{
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())
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)
{
{
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())
{\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
\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
{\r
std::cout << "Getting device information failed." << std::endl;\r
}\r
- \r
+\r
if (resourceURI == "/a/media")\r
{\r
curResource = resource;\r