From 5c3d7b0de84fd8a244e0af5389bc90a9d0cdffc0 Mon Sep 17 00:00:00 2001 From: David Antler Date: Wed, 27 Jul 2016 09:22:16 -0700 Subject: [PATCH] Update garageclient status checking OC_STACK_OK is the eCode that should really be matched. STATUS_SUCCESS was only coincidentially set to the same value. Also added whitespace after 'if' keyword. Change-Id: I2f9ccb19d2da0911acbef0a420fecd8ed6199177 Signed-off-by: David Antler Reviewed-on: https://gerrit.iotivity.org/gerrit/9799 Tested-by: jenkins-iotivity Reviewed-by: Jon A. Cruz --- resource/examples/garageclient.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resource/examples/garageclient.cpp b/resource/examples/garageclient.cpp index 9fbc446..9a91da9 100644 --- a/resource/examples/garageclient.cpp +++ b/resource/examples/garageclient.cpp @@ -30,7 +30,6 @@ using namespace OC; -const int SUCCESS_RESPONSE = 0; std::shared_ptr curResource; std::mutex curResourceLock; @@ -164,7 +163,7 @@ void printRepresentation(const OCRepresentation& rep) // callback handler on PUT request void onPut(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode) { - if(eCode == SUCCESS_RESPONSE || eCode == OC_STACK_RESOURCE_CHANGED) + if (eCode == OC_STACK_OK || eCode == OC_STACK_RESOURCE_CHANGED) { std::cout << "PUT request was successful" << std::endl; @@ -201,7 +200,7 @@ void putLightRepresentation(std::shared_ptr resource) // Callback handler on GET request 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; std::cout << "Resource URI: " << rep.getUri() << std::endl; -- 2.7.4