{
std::cout<<"Usage: groupclient <0|1>\n";
std::cout<<"ConnectivityType: Default \n";
- std::cout<<"ConnectivityType 0: IPv4\n";
- std::cout<<"ConnectivityType 1: IPv6\n";
+ std::cout<<"ConnectivityType 0: IP\n";
}
void foundResource(std::shared_ptr< OCResource > resource)
{
cout << "\tResource Type : " << resource->getResourceTypes().front() << endl;
if (resourceURI == "/a/light" || resourceURI == "/a/fan")
{
- OCResourceHandle foundResourceHandle;
+ OCResourceHandle foundResourceHandle = nullptr;
OCStackResult result = OCPlatform::registerResource(foundResourceHandle, resource);
cout << "\tresource registed!" << endl;
if (result == OC_STACK_OK)
{
if(optionSelected == 0)
{
- std::cout << "Using IPv4."<< std::endl;
- connectivityType = CT_IP_USE_V4;
- }
- else if(optionSelected == 1)
- {
- std::cout << "IPv6 is currently not supported."<< std::endl;
- printUsage();
- return -1;
- //TODO: printUsage to be removed when IPv6 is available.
- //connectivityType = CT_IP_USE_V6;
+ std::cout << "Using IP."<< std::endl;
+ connectivityType = CT_ADAPTER_IP;
}
else
{
std::cout << "Invalid connectivity type selected. Using default IP" << std::endl;
}
}
- catch(exception& e)
+ catch(exception&)
{
std::cout << "Invalid input argument. Using IP as connectivity type" << std::endl;
}
cout << "registerResource is called." << endl;
- requestURI << OC_MULTICAST_DISCOVERY_URI << "?rt=core.light";
+ requestURI << OC_RSRVD_WELL_KNOWN_URI << "?rt=core.light";
OCPlatform::findResource("", requestURI.str(),
connectivityType, &foundResource);