//******************************************************************
//
-// Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
+// Copyright 2015 Samsung Electronics All Rights Reserved.
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-// OCClient.cpp : Defines the entry point for the console application.
-//
+
#include <string>
#include <map>
#include <cstdlib>
}
if (OBSERVE_TYPE_TO_USE == ObserveType::Observe)
+ {
std::cout << std::endl << "Observe is used." << std::endl << std::endl;
+ }
else if (OBSERVE_TYPE_TO_USE == ObserveType::ObserveAll)
+ {
std::cout << std::endl << "ObserveAll is used." << std::endl << std::endl;
+ }
curResource->observe(OBSERVE_TYPE_TO_USE, QueryParamsMap(), &onObserve);
std::cout << "Posting light representation..." << std::endl;
- mylight.m_on_off = "false";
+ mylight.m_on_off = false;
rep.setValue("on-off", mylight.m_on_off);
// Invoke resource's put API with rep, query map and the callback parameter
- resource->put(rep, QueryParamsMap(), &onPut);
+ resource->post(rep, QueryParamsMap(), &onPut);
}
}
std::cout << "\ton-off: " << mylight.m_on_off << std::endl;
- putLightRepresentation(curResource);
+ postLightRepresentation(curResource);
}
else
{
cv.wait(lock);
}
- catch (OCException &e)
+ catch (const OCException &e)
{
- oclog() << "Exception in main: " << e.what();
+ std::cout << "Exception in main: " << e.what();
}
return 0;