// Forward declaring the entityHandler
/// This class represents a single resource named 'lightResource'. This resource has
-/// two simple properties named 'state' and 'power'
+/// one simple attribute, power
class LightResource
{
std::string requestType = request->getRequestType();
int requestFlag = request->getRequestHandlerFlag();
- if(requestFlag & RequestHandlerFlag::InitFlag)
- {
- cout << "\t\trequestFlag : Init\n";
-
- // entity handler to perform resource initialization operations
- }
if(requestFlag & RequestHandlerFlag::RequestFlag)
{
cout << "\t\trequestFlag : Request\n";
}
-int main(int argc, char* argv[])
+int main(int /*argc*/, char** /*argv[]*/)
{
// Create PlatformConfig object
PlatformConfig cfg {
myLight.createResource();
myLight.addType(std::string("core.brightlight"));
- myLight.addInterface(std::string("oc.mi.ll"));
+ myLight.addInterface(std::string(LINK_INTERFACE));
// A condition variable will free the mutex it is given, then do a non-
// intensive block until 'notify' is called on it. In this case, since we
std::unique_lock<std::mutex> lock(blocker);
cv.wait(lock);
}
- catch(OCException e)
+ catch(OCException& e)
{
- //log(e.what());
+ oclog() << "Exception in main: "<< e.what();
}
// No explicit call to stop the platform.
return 0;
}
+