OCStackResult ret;
- std::cout << "Querying for platform information... " << std::endl;
+ if (0 == strcmp(resource->uri().c_str(), platformDiscoveryURI.c_str()))
+ {
+ std::cout << "Querying for platform information... " << std::endl;
- ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,
- resource->connectivityType(),
- std::bind(&ClientFridge::receivedPlatformInfo,
- this, PH::_1));
+ ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,
+ resource->connectivityType(),
+ std::bind(&ClientFridge::receivedPlatformInfo,
+ this, PH::_1));
- if (ret == OC_STACK_OK)
- {
- std::cout << "Get platform information is done." << std::endl;
- }
- else
- {
- std::cout << "Get platform information failed." << std::endl;
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Get platform information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Get platform information failed." << std::endl;
+ }
}
- std::cout << "Querying for device information... " << std::endl;
+ if (0 == strcmp(resource->uri().c_str(), deviceDiscoveryURI.c_str()))
+ {
+ std::cout << "Querying for device information... " << std::endl;
- ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,
- resource->connectivityType(),
- std::bind(&ClientFridge::receivedDeviceInfo,
- this, PH::_1));
+ ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,
+ resource->connectivityType(),
+ std::bind(&ClientFridge::receivedDeviceInfo,
+ this, PH::_1));
- if (ret == OC_STACK_OK)
- {
- std::cout << "Getting device information is done." << std::endl;
- }
- else
- {
- std::cout << "Getting device information failed." << std::endl;
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Getting device information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Getting device information failed." << std::endl;
+ }
}
-
// we have now found a resource, so lets create a few resource objects
// for the other resources that we KNOW are associated with the intel.fridge
// server, and query them.
}
OCStackResult ret;
- std::cout << "Querying for platform information... " << std::endl;
- ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,
- resource->connectivityType(),
- &receivedPlatformInfo);
-
- if (ret == OC_STACK_OK)
- {
- std::cout << "Get platform information is done." << std::endl;
- }
- else
+ if (0 == strcmp(resourceURI.c_str(), platformDiscoveryURI.c_str()))
{
- std::cout << "Get platform information failed." << std::endl;
- }
-
- std::cout << "Querying for device information... " << std::endl;
+ std::cout << "Querying for platform information... " << std::endl;
- ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,
- resource->connectivityType(),
- &receivedDeviceInfo);
+ ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,
+ resource->connectivityType(),
+ &receivedPlatformInfo);
- if (ret == OC_STACK_OK)
- {
- std::cout << "Getting device information is done." << std::endl;
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Get platform information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Get platform information failed." << std::endl;
+ }
}
- else
+
+ if (0 == strcmp(resourceURI.c_str(), deviceDiscoveryURI.c_str()))
{
- std::cout << "Getting device information failed." << std::endl;
+ std::cout << "Querying for device information... " << std::endl;
+
+ ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,
+ resource->connectivityType(),
+ &receivedDeviceInfo);
+
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Getting device information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Getting device information failed." << std::endl;
+ }
}
if(resourceURI == "/a/garage")
std::cout << "\t\t" << resourceInterfaces << std::endl;
}
- std::cout << "Querying for platform information... " << std::endl;
+ if (0 == strcmp(resourceURI.c_str(), platformDiscoveryURI.c_str()))
+ {
+ std::cout << "Querying for platform information... " << std::endl;
- OCStackResult ret = OCPlatform::getPlatformInfo("", platformDiscoveryURI,
- resource->connectivityType(),
- &receivedPlatformInfo);
+ OCStackResult ret = OCPlatform::getPlatformInfo("", platformDiscoveryURI,
+ resource->connectivityType(),
+ &receivedPlatformInfo);
- if (ret == OC_STACK_OK)
- {
- std::cout << "Get platform information is done." << std::endl;
- }
- else
- {
- std::cout << "Get platform information failed." << std::endl;
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Get platform information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Get platform information failed." << std::endl;
+ }
}
- std::cout << "Querying for device information... " << std::endl;
+ if (0 == strcmp(resourceURI.c_str(), deviceDiscoveryURI.c_str()))
+ {
+ std::cout << "Querying for device information... " << std::endl;
- ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,
- resource->connectivityType(),
- &receivedDeviceInfo);
+ OCStackResult ret = OCPlatform::getDeviceInfo(resource->host(),
+ deviceDiscoveryURI,
+ resource->connectivityType(),
+ &receivedDeviceInfo);
- if (ret == OC_STACK_OK)
- {
- std::cout << "Getting device information is done." << std::endl;
- }
- else
- {
- std::cout << "Getting device information failed." << std::endl;
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Getting device information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Getting device information failed." << std::endl;
+ }
}
if(resourceURI == "/a/light")
}
OCStackResult ret;
- std::cout << "Querying for platform information... " << std::endl;
- ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,
- resource->connectivityType(),
- &receivedPlatformInfo);
-
- if (ret == OC_STACK_OK)
+ if (0 == strcmp(resourceURI.c_str(), platformDiscoveryURI.c_str()))
{
- std::cout << "Get platform information is done." << std::endl;
- }
- else
- {
- std::cout << "Get platform information failed." << std::endl;
- }
+ std::cout << "Querying for platform information... " << std::endl;
- std::cout << "Querying for device information... " << std::endl;
+ ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,
+ resource->connectivityType(),
+ &receivedPlatformInfo);
- ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,
- resource->connectivityType(),
- &receivedDeviceInfo);
- if (ret == OC_STACK_OK)
- {
- std::cout << "Getting device information is done." << std::endl;
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Get platform information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Get platform information failed." << std::endl;
+ }
}
- else
+
+ if (0 == strcmp(resourceURI.c_str(), deviceDiscoveryURI.c_str()))
{
- std::cout << "Getting device information failed." << std::endl;
+ std::cout << "Querying for device information... " << std::endl;
+
+ ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,
+ resource->connectivityType(),
+ &receivedDeviceInfo);
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Getting device information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Getting device information failed." << std::endl;
+ }
}
if(resourceURI == "/a/room")
hostAddress = resource->host();
std::cout << "\tHost address of the resource: " << hostAddress << std::endl;
- OCStackResult ret;
-
- std::cout << "Querying for platform information... " << std::endl;
-
- ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,
- resource->connectivityType(),
- &receivedPlatformInfo);
-
- if (ret == OC_STACK_OK)
- {
- std::cout << "Get platform information is done." << std::endl;
- }
- else
+ if (0 == strcmp(resourceURI.c_str(), platformDiscoveryURI.c_str()))
{
- std::cout << "Get platform information failed." << std::endl;
+ std::cout << "Querying for platform information... " << std::endl;
+ OCStackResult ret = OCPlatform::getPlatformInfo(resource->host(),
+ platformDiscoveryURI,
+ resource->connectivityType(),
+ &receivedPlatformInfo);
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Get platform information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Get platform information failed." << std::endl;
+ }
}
- std::cout << "Querying for device information... " << std::endl;
+ if (0 == strcmp(resourceURI.c_str(), deviceDiscoveryURI.c_str()))
+ {
+ std::cout << "Querying for device information... " << std::endl;
- ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,
- resource->connectivityType(), &receivedDeviceInfo);
+ OCStackResult ret = OCPlatform::getDeviceInfo(resource->host(),
+ deviceDiscoveryURI,
+ resource->connectivityType(),
+ &receivedDeviceInfo);
- if (ret == OC_STACK_OK)
- {
- std::cout << "Getting device information is done." << std::endl;
- }
- else
- {
- std::cout << "Getting device information failed." << std::endl;
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Getting device information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Getting device information failed." << std::endl;
+ }
}
// Get the resource types
std::cout << "\tHost address of the resource: " << hostAddress << std::endl;
OCStackResult ret;
+ if (0 == strcmp(resourceURI.c_str(), platformDiscoveryURI.c_str()))
+ {
+ std::cout << "Querying for platform information... " << std::endl;
- std::cout << "Querying for platform information... " << std::endl;
-
- ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,
- resource->connectivityType(),
- &receivedPlatformInfo);
+ ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,
+ resource->connectivityType(),
+ &receivedPlatformInfo);
- if (ret == OC_STACK_OK)
- {
- std::cout << "Get platform information is done." << std::endl;
- }
- else
- {
- std::cout << "Get platform information failed." << std::endl;
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Get platform information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Get platform information failed." << std::endl;
+ }
}
- std::cout << "Querying for device information... " << std::endl;
+ if (0 == strcmp(resourceURI.c_str(), deviceDiscoveryURI.c_str()))
+ {
+ std::cout << "Querying for device information... " << std::endl;
- ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,
- resource->connectivityType(), &receivedDeviceInfo);
+ ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,
+ resource->connectivityType(), &receivedDeviceInfo);
- if (ret == OC_STACK_OK)
- {
- std::cout << "Getting device information is done." << std::endl;
- }
- else
- {
- std::cout << "Getting device information failed." << std::endl;
+ if (ret == OC_STACK_OK)
+ {
+ std::cout << "Getting device information is done." << std::endl;
+ }
+ else
+ {
+ std::cout << "Getting device information failed." << std::endl;
+ }
}
// Get the resource types
}\r
\r
OCStackResult ret;\r
- std::cout << "Querying for platform information... " << std::endl;\r
-\r
- ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,\r
- resource->connectivityType(),\r
- &receivedPlatformInfo);\r
-\r
- if (ret == OC_STACK_OK)\r
- {\r
- std::cout << "Get platform information is done." << std::endl;\r
- }\r
- else\r
+ if (0 == strcmp(resourceURI.c_str(), platformDiscoveryURI.c_str()))\r
{\r
- std::cout << "Get platform information failed." << std::endl;\r
+ std::cout << "Querying for platform information... " << std::endl;\r
+\r
+ ret = OCPlatform::getPlatformInfo(resource->host(), platformDiscoveryURI,\r
+ resource->connectivityType(),\r
+ &receivedPlatformInfo);\r
+\r
+ if (ret == OC_STACK_OK)\r
+ {\r
+ std::cout << "Get platform information is done." << std::endl;\r
+ }\r
+ else\r
+ {\r
+ std::cout << "Get platform information failed." << std::endl;\r
+ }\r
}\r
\r
- std::cout << "Querying for device information... " << std::endl;\r
+ if (0 == strcmp(resourceURI.c_str(), deviceDiscoveryURI.c_str()))\r
+ {\r
+ std::cout << "Querying for device information... " << std::endl;\r
\r
- ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,\r
- resource->connectivityType(),\r
- &receivedDeviceInfo);\r
+ ret = OCPlatform::getDeviceInfo(resource->host(), deviceDiscoveryURI,\r
+ resource->connectivityType(),\r
+ &receivedDeviceInfo);\r
\r
\r
- if (ret == OC_STACK_OK)\r
- {\r
- std::cout << "Getting device information is done." << std::endl;\r
- }\r
- else\r
- {\r
- std::cout << "Getting device information failed." << std::endl;\r
+ if (ret == OC_STACK_OK)\r
+ {\r
+ std::cout << "Getting device information is done." << std::endl;\r
+ }\r
+ else\r
+ {\r
+ std::cout << "Getting device information failed." << std::endl;\r
+ }\r
}\r
\r
if (resourceURI == "/a/media")\r