fix process onPut message of roomclient app
authorjihwan.seo <jihwan.seo@samsung.com>
Thu, 27 Oct 2016 04:12:25 +0000 (13:12 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Thu, 27 Oct 2016 07:16:27 +0000 (07:16 +0000)
Change-Id: I465fe65db563f9784ff0c3a2c41d861f5521a403
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13741
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/examples/roomclient.cpp

index a7587ec..850c746 100644 (file)
@@ -31,7 +31,6 @@
 
 using namespace OC;
 
-const int SUCCESS_RESPONSE = 0;
 std::shared_ptr<OCResource> curResource;
 std::mutex resourceLock;
 
@@ -88,7 +87,7 @@ void printRoomRepresentation(const OCRepresentation& rep)
 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;
 
@@ -106,7 +105,7 @@ void onGet(const HeaderOptions& /*headerOptions*/,
 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;
 
@@ -152,7 +151,7 @@ void putRoomRepresentation(std::shared_ptr<OCResource> resource)
 // 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;