Changed OCStackResult to be consistent across compile flags.
authorErich Keane <erich.keane@intel.com>
Tue, 13 Jan 2015 21:39:57 +0000 (13:39 -0800)
committerSudarshan Prasad <sudarshan.prasad@intel.com>
Thu, 22 Jan 2015 16:19:24 +0000 (16:19 +0000)
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 <erich.keane@intel.com>
(cherry picked from commit b7786c89ef40ec15c904633b979be6c73dfee53d)
Reviewed-on: https://gerrit.iotivity.org/gerrit/220
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sudarshan Prasad <sudarshan.prasad@intel.com>
resource/csdk/stack/include/ocstack.h

index c2c45e8..ce6ab04 100644 (file)
@@ -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;