using namespace OC;
-const int SUCCESS_RESPONSE = 0;
std::shared_ptr<OCResource> curResource;
std::mutex resourceLock;
void onGet(const HeaderOptions& /*headerOptions*/,
const OCRepresentation& rep, const int eCode)
{
- if(eCode == SUCCESS_RESPONSE)
+ if (eCode == OC_STACK_OK)
{
std::cout << "GET request was successful" << std::endl;
void onGet1(const HeaderOptions& /*headerOptions*/,
const OCRepresentation& rep, const int eCode)
{
- if(eCode == SUCCESS_RESPONSE)
+ if (eCode == OC_STACK_OK)
{
std::cout << "GET request was successful" << std::endl;
// callback handler on PUT request
void onPut(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode)
{
- if(eCode == SUCCESS_RESPONSE)
+ if (eCode == OC_STACK_OK || eCode == OC_STACK_RESOURCE_CHANGED)
{
std::cout << "PUT request was successful" << std::endl;