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)
committerErich Keane <erich.keane@intel.com>
Wed, 14 Jan 2015 18:16:07 +0000 (10:16 -0800)
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>
resource/csdk/stack/include/ocstack.h

index 72de3c2..a430f8b 100644 (file)
@@ -144,7 +144,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,
@@ -161,18 +161,19 @@ typedef enum {
     OC_STACK_REPEATED_REQUEST,
     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;