From ee90b14a81ddd7d63a0c75ddd22da4c364ca2ba9 Mon Sep 17 00:00:00 2001 From: harish_kumar Date: Fri, 8 Jun 2018 18:06:05 +0530 Subject: [PATCH] Add missing stack errors to android code Add missing OCStackResult enum values to errorcode.java file and JniUtils.h. https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/291 (cherry picked from commit e2545fc58de379f686ac60c43cffb1d032620c77) Change-Id: I0ddd8aadbf15366128c4b3ed30b3eb3eb4d85fc5 Signed-off-by: harish_kumar Signed-off-by: Amit KS --- android/android_api/base/jni/JniUtils.h | 29 ++++++++++++++++++++++ .../src/main/java/org/iotivity/base/ErrorCode.java | 19 ++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/android/android_api/base/jni/JniUtils.h b/android/android_api/base/jni/JniUtils.h index 0fe8578..6175f41 100644 --- a/android/android_api/base/jni/JniUtils.h +++ b/android/android_api/base/jni/JniUtils.h @@ -243,6 +243,9 @@ public: return "UNAUTHORIZED_REQ"; case OC_STACK_TOO_MANY_REQUESTS: return "TOO_MANY_REQUESTS"; + + case OC_STACK_TOO_LARGE_REQ: + return "TOO_LARGE_REQ"; /** Error code from PDM */ case OC_STACK_PDM_IS_NOT_INITIALIZED: return "PDM_IS_NOT_INITIALIZED"; @@ -255,6 +258,9 @@ public: /** Error code from OTM */ case OC_STACK_AUTHENTICATION_FAILURE: return "AUTHENTICATION_FAILURE"; + + case OC_STACK_NOT_ALLOWED_OXM: + return "NOT_ALLOWED_OXM"; /** Insert all new error codes here!.*/ #ifdef WITH_PRESENCE case OC_STACK_PRESENCE_STOPPED: @@ -264,6 +270,29 @@ public: case OC_STACK_PRESENCE_DO_NOT_HANDLE: return "PRESENCE_DO_NOT_HANDLE"; #endif + + /** Request is denied by the user*/ + case OC_STACK_USER_DENIED_REQ: + return "USER_DENIED_REQUEST"; + case OC_STACK_METHOD_NOT_ALLOWED: + return "METHOD_NOT_ALLOWED"; + + /** ERROR code from server */ + case OC_STACK_FORBIDDEN_REQ: + return "FORBIDDEN_REQUEST"; + case OC_STACK_INTERNAL_SERVER_ERROR: + return "INTERNAL_SERVER_ERROR"; + case OC_STACK_NOT_IMPLEMENTED: + return "NOT_IMPLEMENTED"; + case OC_STACK_BAD_GATEWAY: + return "BAD_GATEWAY"; + case OC_STACK_SERVICE_UNAVAILABLE: + return "SERVICE_UNAVAILABLE"; + case OC_STACK_GATEWAY_TIMEOUT: + return "GATEWAY_TIMEOUT"; + case OC_STACK_PROXY_NOT_SUPPORTED: + return "PROXY_NOT_SUPPORTED"; + case OC_STACK_ERROR: return "ERROR"; diff --git a/android/android_api/base/src/main/java/org/iotivity/base/ErrorCode.java b/android/android_api/base/src/main/java/org/iotivity/base/ErrorCode.java index 964674e..6bbed5a 100644 --- a/android/android_api/base/src/main/java/org/iotivity/base/ErrorCode.java +++ b/android/android_api/base/src/main/java/org/iotivity/base/ErrorCode.java @@ -58,18 +58,37 @@ public enum ErrorCode { INVALID_DEVICE_INFO("INVALID_DEVICE_INFO", ""), INVALID_JSON("INVALID_JSON", ""), UNAUTHORIZED_REQ("UNAUTHORIZED_REQ", "Request is not authorized by Resource Server"), + NOT_ACCEPTABLE("NOT_ACCEPTABLE",""), + TOO_LARGE_REQ("TOO_LARGE_REQ",""), TOO_MANY_REQUESTS("TOO_MANY_REQUESTS", "Request is not served by Server; Request again after retry timer (in seconds)"), /** Error code from PDM */ PDM_IS_NOT_INITIALIZED("PDM_IS_NOT_INITIALIZED", ""), DUPLICATE_UUID("DUPLICATE_UUID", ""), INCONSISTENT_DB("INCONSISTENT_DB", ""), + + SVR_DB_NOT_EXIST("SVR_DB_NOT_EXIST",""), /** Error code from OTM */ AUTHENTICATION_FAILURE("AUTHENTICATION_FAILURE", "This error is pushed from DTLS interface when handshake failure happens"), + + NOT_ALLOWED_OXM("NOT_ALLOWED_OXM",""), /** Insert all new error codes here!.*/ PRESENCE_STOPPED("PRESENCE_STOPPED", ""), PRESENCE_TIMEOUT("PRESENCE_TIMEOUT", ""), PRESENCE_DO_NOT_HANDLE("PRESENCE_DO_NOT_HANDLE", ""), + + /** Request is denied by the user*/ + USER_DENIED_REQUEST("USER_DENIED_REQUEST",""), + METHOD_NOT_ALLOWED("METHOD_NOT_ALLOWED",""), + /** ERROR code from server */ + FORBIDDEN_REQUEST("FORBIDDEN_REQUEST",""), + INTERNAL_SERVER_ERROR("INTERNAL_SERVER_ERROR",""), + NOT_IMPLEMENTED("NOT_IMPLEMENTED",""), + BAD_GATEWAY("BAD_GATEWAY",""), + SERVICE_UNAVAILABLE("SERVICE_UNAVAILABLE",""), + GATEWAY_TIMEOUT("GATEWAY_TIMEOUT",""), + PROXY_NOT_SUPPORTED("PROXY_NOT_SUPPORTED",""), + /** ERROR in stack.*/ ERROR("ERROR", "Generic error"), -- 2.7.4