Add codes for OC_STACK_RESOURCE_CHANGED 82/84182/4
authoryoungman <yman.jung@samsung.com>
Wed, 17 Aug 2016 06:57:26 +0000 (15:57 +0900)
committeryoungman <yman.jung@samsung.com>
Fri, 19 Aug 2016 02:20:44 +0000 (11:20 +0900)
Change-Id: Idf12cd1102dd4fe3c0418b74ab584c0a5ef6397f
Signed-off-by: youngman <yman.jung@samsung.com>
include/iotcon-constant.h
src/ic-ioty-convert.c
src/ic-ioty-parse.c
test/iotcon-test-basic-client.c

index f0657cf..5963635 100644 (file)
@@ -156,6 +156,7 @@ typedef enum {
        IOTCON_RESPONSE_ERROR, /**< Indicates result of response for something error */
        IOTCON_RESPONSE_RESOURCE_CREATED, /**< Indicates result of response for resource has created */
        IOTCON_RESPONSE_RESOURCE_DELETED, /**< Indicates result of response for resource has deleted */
+       IOTCON_RESPONSE_RESOURCE_CHANGED, /**< Indicates result of response for resource has changed */
        IOTCON_RESPONSE_SLOW, /**< Indicates result of response for slow resource */
        IOTCON_RESPONSE_FORBIDDEN, /**< Indicates result of response for accessing unauthorized resource */
 } iotcon_response_result_e;
index 6b68605..f725d82 100644 (file)
@@ -125,6 +125,8 @@ OCEntityHandlerResult ic_ioty_convert_response_result(
                return OC_EH_RESOURCE_CREATED;
        case IOTCON_RESPONSE_RESOURCE_DELETED:
                return OC_EH_RESOURCE_DELETED;
+       case IOTCON_RESPONSE_RESOURCE_CHANGED:
+               return OC_EH_CHANGED;
        case IOTCON_RESPONSE_FORBIDDEN:
                return OC_EH_FORBIDDEN;
        case IOTCON_RESPONSE_ERROR:
index 13a1a7c..180a367 100644 (file)
@@ -124,12 +124,13 @@ iotcon_response_result_e  ic_ioty_parse_oic_response_result(OCStackResult result
 {
        switch (result) {
        case OC_STACK_OK:
-       case OC_STACK_RESOURCE_CHANGED:
                return IOTCON_RESPONSE_OK;
        case OC_STACK_RESOURCE_CREATED:
                return IOTCON_RESPONSE_RESOURCE_CREATED;
        case OC_STACK_RESOURCE_DELETED:
                return IOTCON_RESPONSE_RESOURCE_DELETED;
+       case OC_STACK_RESOURCE_CHANGED:
+               return IOTCON_RESPONSE_RESOURCE_CHANGED;
        case OC_STACK_UNAUTHORIZED_REQ:
                return IOTCON_RESPONSE_FORBIDDEN;
        case OC_STACK_ERROR:
index e29389e..e5fd976 100644 (file)
@@ -131,8 +131,7 @@ static void _on_response_post(iotcon_remote_resource_h resource,
                return;
        }
 
-       if (IOTCON_RESPONSE_OK != response_result
-                       && IOTCON_RESPONSE_RESOURCE_CREATED != response_result) {
+       if (IOTCON_RESPONSE_RESOURCE_CREATED != response_result) {
                ERR("_on_response_post Response error(%d)", response_result);
                return;
        }
@@ -209,7 +208,7 @@ static void _on_response_put(iotcon_remote_resource_h resource,
                return;
        }
 
-       if (IOTCON_RESPONSE_OK != response_result) {
+       if (IOTCON_RESPONSE_RESOURCE_CHANGED != response_result) {
                ERR("_on_response_put Response error(%d)", response_result);
                return;
        }