- std::unique_lock<std::mutex> lck(mtx);
- cond.wait_for(lck,std::chrono::seconds(2));
+ switch (processUserInput())
+ {
+ case REQUEST_TEMP:
+ resourceType = "core.TemperatureSensor";
+ break;
+ case REQUEST_LIGHT:
+ resourceType = "core.light";
+ defaultKey = "Light";
+ break;
+ default :
+ std::cout << "Invalid input, please try again" << std::endl;
+ return;
+ }
+
+ std::string addressInput;
+ std::cout << "========================================================" << std::endl;
+ std::cout << "Please input address" << std::endl;
+ std::cout << "(want to use multicast -> please input 'multi')" << std::endl;
+ std::cout << "========================================================" << std::endl;
+
+ std::cin >> addressInput;
+
+ if(addressInput == multicastAdd)
+ {
+ discoveryTask = RCSDiscoveryManager::getInstance()->discoverResourceByType(RCSAddress::multicast(),
+ relativeUri, resourceType, &onResourceDiscovered);
+ }
+ else
+ {
+ discoveryTask = RCSDiscoveryManager::getInstance()->discoverResourceByType(RCSAddress::unicast
+ (addressInput), relativeUri, resourceType, &onResourceDiscovered);
+ }
+}