From c99ae28f216978dadfd7485796fe4a2c048a0af3 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Tue, 13 Jan 2015 13:39:57 -0800 Subject: [PATCH] Changed OCStackResult to be consistent across compile flags. Issue 245 was reported that pointed out that the presence flag in the compiler makes OCStackResult incompatible across differently compiled versions of the CStack. Additionally, this spaces out the error codes from success codes, permitting additional room for more success codes. Change-Id: Ia93f34e23756e7663ea80f6667699d59e358058e Signed-off-by: Erich Keane (cherry picked from commit b7786c89ef40ec15c904633b979be6c73dfee53d) Reviewed-on: https://gerrit.iotivity.org/gerrit/220 Tested-by: jenkins-iotivity Reviewed-by: Sudarshan Prasad --- resource/csdk/stack/include/ocstack.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/resource/csdk/stack/include/ocstack.h b/resource/csdk/stack/include/ocstack.h index c2c45e8..ce6ab04 100644 --- a/resource/csdk/stack/include/ocstack.h +++ b/resource/csdk/stack/include/ocstack.h @@ -166,7 +166,7 @@ typedef enum { OC_STACK_CONTINUE, /* Success status code - END HERE */ /* Error status code - START HERE */ - OC_STACK_INVALID_URI, + OC_STACK_INVALID_URI = 20, OC_STACK_INVALID_QUERY, OC_STACK_INVALID_IP, OC_STACK_INVALID_PORT, @@ -182,18 +182,19 @@ typedef enum { OC_STACK_SLOW_RESOURCE, OC_STACK_NO_OBSERVERS, /* resource has no registered observers */ OC_STACK_OBSERVER_NOT_FOUND, - #ifdef WITH_PRESENCE - OC_STACK_PRESENCE_STOPPED, - OC_STACK_PRESENCE_TIMEOUT, - OC_STACK_PRESENCE_DO_NOT_HANDLE, - #endif OC_STACK_VIRTUAL_DO_NOT_HANDLE, OC_STACK_INVALID_OPTION, OC_STACK_MALFORMED_RESPONSE, /* the remote reply contained malformed data */ OC_STACK_PERSISTENT_BUFFER_REQUIRED, OC_STACK_INVALID_REQUEST_HANDLE, OC_STACK_INVALID_DEVICE_INFO, - OC_STACK_ERROR + /* NOTE: Insert all new error codes here!*/ + #ifdef WITH_PRESENCE + OC_STACK_PRESENCE_STOPPED = 128, + OC_STACK_PRESENCE_TIMEOUT, + OC_STACK_PRESENCE_DO_NOT_HANDLE, + #endif + OC_STACK_ERROR = 255 /* Error status code - END HERE */ } OCStackResult; -- 2.7.4