From: youngman Date: Wed, 17 Aug 2016 06:57:26 +0000 (+0900) Subject: Add codes for OC_STACK_RESOURCE_CHANGED X-Git-Tag: submit/tizen/20160824.100342~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0ca74d34c78837bf3f013e50c7b3f03e75db33c;p=platform%2Fcore%2Fiot%2Fiotcon.git Add codes for OC_STACK_RESOURCE_CHANGED Change-Id: Idf12cd1102dd4fe3c0418b74ab584c0a5ef6397f Signed-off-by: youngman --- diff --git a/include/iotcon-constant.h b/include/iotcon-constant.h index f0657cf..5963635 100644 --- a/include/iotcon-constant.h +++ b/include/iotcon-constant.h @@ -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; diff --git a/src/ic-ioty-convert.c b/src/ic-ioty-convert.c index 6b68605..f725d82 100644 --- a/src/ic-ioty-convert.c +++ b/src/ic-ioty-convert.c @@ -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: diff --git a/src/ic-ioty-parse.c b/src/ic-ioty-parse.c index 13a1a7c..180a367 100644 --- a/src/ic-ioty-parse.c +++ b/src/ic-ioty-parse.c @@ -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: diff --git a/test/iotcon-test-basic-client.c b/test/iotcon-test-basic-client.c index e29389e..e5fd976 100644 --- a/test/iotcon-test-basic-client.c +++ b/test/iotcon-test-basic-client.c @@ -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; }