Apply oic security feature 92/67292/24
authoryoungman <yman.jung@samsung.com>
Tue, 26 Apr 2016 07:19:40 +0000 (16:19 +0900)
committerYoungman JUNG <yman.jung@samsung.com>
Fri, 20 May 2016 02:19:59 +0000 (19:19 -0700)
Change-Id: Ib13eb574dae83534782aaebda6b8a72f78180fd1
Signed-off-by: youngman <yman.jung@samsung.com>
27 files changed:
common/ic-common.h
common/ic-ioty-types.c
common/ic-utils.c
common/ic-utils.h
lib/icl-device.c
lib/icl-ioty-ocprocess.c
lib/icl-ioty.c
lib/icl-ioty.h
lib/icl-list.c
lib/icl-lite-resource.c
lib/icl-observation.c
lib/icl-options.c
lib/icl-presence.c
lib/icl-query.c
lib/icl-remote-resource-caching.c
lib/icl-remote-resource-crud.c
lib/icl-remote-resource-monitoring.c
lib/icl-remote-resource.c
lib/icl-representation.c
lib/icl-request.c
lib/icl-resource-interfaces.c
lib/icl-resource-types.c
lib/icl-resource.c
lib/icl-response.c
lib/icl-state.c
lib/icl.c
lib/include/iotcon.h

index 9f514ab51f4a250092a3de2bf5f5c8d27b611403..fdb9882d5ad807955ede9a43d0fc889e226df509 100644 (file)
@@ -28,8 +28,6 @@
 
 #define IC_OBSERVE_ID_MAX_LEN 256
 
-#define IC_FEATURE_OIC "http://tizen.org/feature/iot.oic"
-
 #define IC_IOTY_COAP "coap://"
 #define IC_IOTY_COAPS "coaps://"
 #define IC_IOTY_MULTICAST_ADDRESS "224.0.1.187:5683"
index 8233202705c7c6db1d59180b485d6281ddddcf7a..c2f299c956e190a94040b82fd8bbfd76e5d0ea5c 100644 (file)
@@ -331,9 +331,6 @@ int ic_ioty_convert_properties(int properties)
        if (IOTCON_RESOURCE_EXPLICIT_DISCOVERABLE & properties)
                prop |= OC_EXPLICIT_DISCOVERABLE;
 
-       // TODO: Secure option is not supported yet.
-       properties = (properties & OC_SECURE) ? (properties ^ OC_SECURE) : properties;
-
        return prop;
 }
 
index 6d7b79a02b26d467ea2b8c7375dbc0e778c23f44..1d06e1e7f0cf512cbb5ab59eff0638440878d1cb 100644 (file)
 
 
 #ifdef TZ_VER_3
-static int _ic_oic_feature_supported = -1;
+static int _ic_oic_feature = -1;
+static const char *IC_FEATURE_OIC = "http://tizen.org/feature/iot.oic";
+
+static int _ic_oic_security_feature = -1;
+static const char *IC_FEATURE_OIC_SECURITY = "http://tizen.org/feature/iot.oic.security";
 #endif
 
 // TODO: Can't access in user side daemon
@@ -137,15 +141,29 @@ bool ic_utils_check_permission(int permssion)
        return true;
 }
 
-bool ic_utils_check_oic_feature_supported()
+bool ic_utils_check_oic_feature()
 {
 #ifdef TZ_VER_3
-       if (_ic_oic_feature_supported < 0) {
+       if (_ic_oic_feature < 0) {
                bool feature_supported = false;
                system_info_get_platform_bool(IC_FEATURE_OIC, &feature_supported);
-               _ic_oic_feature_supported = feature_supported ? 1 : 0;
+               _ic_oic_feature = feature_supported ? 1 : 0;
+       }
+       return _ic_oic_feature;
+#else
+       return true;
+#endif
+}
+
+bool ic_utils_check_oic_security_feature()
+{
+#ifdef TZ_VER_3
+       if (_ic_oic_security_feature < 0) {
+               bool feature_supported = false;
+               system_info_get_platform_bool(IC_FEATURE_OIC_SECURITY, &feature_supported);
+               _ic_oic_security_feature = feature_supported ? 1 : 0;
        }
-       return _ic_oic_feature_supported;
+       return _ic_oic_security_feature;
 #else
        return true;
 #endif
index a69344a19ce47bae541ad5c56bd823f12d051ff6..74eff17af73c2fc1e9677e3dc2fbfe80bbb0311e 100644 (file)
@@ -28,7 +28,8 @@ enum {
 
 char* ic_utils_strdup(const char *src);
 bool ic_utils_check_permission(int permssion);
-bool ic_utils_check_oic_feature_supported();
+bool ic_utils_check_oic_feature();
+bool ic_utils_check_oic_security_feature();
 int ic_utils_get_platform_info(OCPlatformInfo *platform_info);
 void ic_utils_free_platform_info(OCPlatformInfo *platform_info);
 
index 131bac806ee886067f3e62895815504f4b69afb3..b019966dcae752068f76e4124a0d2cf1b349415e 100644 (file)
@@ -27,7 +27,7 @@
 API int iotcon_device_info_get_property(iotcon_device_info_h device_info,
                iotcon_device_info_e property, char **value)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == device_info, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == value, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -59,7 +59,7 @@ API int iotcon_find_device_info(const char *host_address,
 {
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
@@ -85,7 +85,7 @@ API int iotcon_find_device_info(const char *host_address,
 API int iotcon_platform_info_get_property(iotcon_platform_info_h platform_info,
                iotcon_platform_info_e property, char **value)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == platform_info, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == value, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -138,7 +138,7 @@ API int iotcon_find_platform_info(const char *host_address,
 {
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
index d19a942610e0a6c9465c32f6dfc6c0ea7ba1ceca..201a91800f07ac7c4f7e5585e8d1cd3c1a10895e 100644 (file)
@@ -58,7 +58,7 @@ void icl_ioty_ocprocess_start()
 
 API int iotcon_polling_get_interval(int *interval)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == interval, IOTCON_ERROR_INVALID_PARAMETER);
 
        *interval = icl_ioty_polling_interval;
@@ -69,7 +69,7 @@ API int iotcon_polling_get_interval(int *interval)
 
 API int iotcon_polling_set_interval(int interval)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(interval <= ICL_IOTY_TIME_INTERVAL_MIN, IOTCON_ERROR_INVALID_PARAMETER);
 
        icl_ioty_polling_interval = interval;
@@ -84,7 +84,7 @@ API int iotcon_polling_set_interval(int interval)
 
 API int iotcon_polling_invoke(void)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
 
        ic_utils_mutex_lock(IC_UTILS_MUTEX_POLLING);
        ic_utils_cond_signal(IC_UTILS_COND_POLLING);
@@ -219,6 +219,8 @@ OCStackApplicationResult icl_ioty_ocprocess_device_info_cb(void *ctx,
 
        RETV_IF(NULL == ctx, OC_STACK_KEEP_TRANSACTION);
        RETV_IF(NULL == resp, OC_STACK_KEEP_TRANSACTION);
+       RETVM_IF(OC_STACK_UNAUTHORIZED_REQ == resp->result, OC_STACK_KEEP_TRANSACTION,
+                       "No Authorization");
        RETV_IF(NULL == resp->payload, OC_STACK_KEEP_TRANSACTION);
 
        if (PAYLOAD_TYPE_DEVICE != resp->payload->type) {
@@ -276,6 +278,8 @@ OCStackApplicationResult icl_ioty_ocprocess_platform_info_cb(void *ctx,
 
        RETV_IF(NULL == ctx, OC_STACK_KEEP_TRANSACTION);
        RETV_IF(NULL == resp, OC_STACK_KEEP_TRANSACTION);
+       RETVM_IF(OC_STACK_UNAUTHORIZED_REQ == resp->result, OC_STACK_KEEP_TRANSACTION,
+                       "No Authorization");
        RETV_IF(NULL == resp->payload, OC_STACK_KEEP_TRANSACTION);
 
        if (PAYLOAD_TYPE_PLATFORM != resp->payload->type) {
@@ -391,6 +395,11 @@ OCStackApplicationResult icl_ioty_ocprocess_observe_cb(void *ctx,
        RETV_IF(NULL == ctx, OC_STACK_KEEP_TRANSACTION);
        RETV_IF(NULL == resp, OC_STACK_KEEP_TRANSACTION);
 
+       if (OC_STACK_UNAUTHORIZED_REQ == resp->result) {
+               ERR("No Authorization");
+               return OC_STACK_KEEP_TRANSACTION;
+       }
+
        cb_result = (OC_OBSERVE_DEREGISTER == resp->sequenceNumber) ?
                OC_STACK_DELETE_TRANSACTION : OC_STACK_KEEP_TRANSACTION;
 
@@ -485,6 +494,15 @@ OCStackApplicationResult icl_ioty_ocprocess_crud_cb(void *ctx,
                cb_container->timeout = 0;
        }
 
+       if (OC_STACK_UNAUTHORIZED_REQ == resp->result) {
+               ERR("No Authorization");
+               if (cb_container->cb) {
+                       cb_container->cb(cb_container->resource, IOTCON_ERROR_IOTIVITY,
+                                       cb_container->req_type, NULL, cb_container->user_data);
+               }
+               return OC_STACK_DELETE_TRANSACTION;
+       }
+
        if (NULL == resp->payload) {
                ERR("payload is empty(%d)", resp->result);
                if (cb_container->cb) {
index 2ccca965ee4774acb6b038a23cb0cac41f760bde..2046e0ecb4d4eb366c0fdf170e97061d12cceb42 100644 (file)
@@ -18,6 +18,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <pthread.h>
+#include <errno.h>
 #include <glib.h>
 #include <octypes.h>
 #include <ocstack.h>
@@ -48,6 +49,8 @@
 static int icl_remote_resource_time_interval = IC_REMOTE_RESOURCE_DEFAULT_TIME_INTERVAL;
 static GHashTable *icl_monitoring_table;
 static GHashTable *icl_caching_table;
+static char icl_svr_db_file[PATH_MAX];
+static OCPersistentStorage icl_ioty_ps;
 
 
 void icl_ioty_deinit(pthread_t thread)
@@ -66,6 +69,39 @@ void icl_ioty_deinit(pthread_t thread)
                ERR("OCStop() Fail(%d)", result);
 }
 
+static FILE* _icl_ioty_ps_fopen(const char *path, const char *mode)
+{
+       return fopen(icl_svr_db_file, mode);
+}
+
+int icl_ioty_set_persistent_storage(const char *file_path)
+{
+       FN_CALL;
+       OCStackResult result;
+
+       if (-1 == access(file_path, R_OK | W_OK)) {
+               ERR("access() Fail(%d)", errno);
+               return IOTCON_ERROR_PERMISSION_DENIED;
+       }
+
+       snprintf(icl_svr_db_file, sizeof(icl_svr_db_file), "%s", file_path);
+       SECURE_DBG("icl_svr_db_file : %s", icl_svr_db_file);
+
+       icl_ioty_ps.open = _icl_ioty_ps_fopen;
+       icl_ioty_ps.read = fread;
+       icl_ioty_ps.write = fwrite;
+       icl_ioty_ps.close = fclose;
+       icl_ioty_ps.unlink = unlink;
+
+       result = OCRegisterPersistentStorageHandler(&icl_ioty_ps);
+       if (OC_STACK_OK != result) {
+               ERR("OCRegisterPersistentStorageHandler() Fail(%d)", result);
+               return IOTCON_ERROR_IOTIVITY;
+       }
+
+       return IOTCON_ERROR_NONE;
+}
+
 int icl_ioty_init(pthread_t *out_thread)
 {
        FN_CALL;
@@ -566,6 +602,9 @@ static int _icl_ioty_remote_resource_observe(iotcon_remote_resource_h resource,
                return ret;
        }
 
+       if (IOTCON_RESOURCE_SECURE & resource->properties)
+               dev_addr.flags |= OC_FLAG_SECURE;
+
        /* options */
        if (resource->header_options && resource->header_options->hash) {
                ret = icl_ioty_convert_header_options(resource->header_options, oic_options,
@@ -768,6 +807,9 @@ static int _icl_ioty_remote_resource_crud(
                return ret;
        }
 
+       if (IOTCON_RESOURCE_SECURE & resource->properties)
+               dev_addr.flags |= OC_FLAG_SECURE;
+
        /* representation */
        if (repr) {
                ret = icl_ioty_convert_representation(repr, &payload);
index c76a897bc85ae7dbcefdc6a9c17029a0733d3a04..8876458e18b9f18b1a113ada7bea4bd045796c9c 100644 (file)
@@ -42,6 +42,8 @@ typedef struct {
 void icl_ioty_deinit(pthread_t thread);
 int icl_ioty_init(pthread_t *out_thread);
 
+int icl_ioty_set_persistent_storage(const char *file_path);
+
 int icl_ioty_set_device_info(const char *device_name);
 int icl_ioty_set_platform_info();
 
index 6d42f70372524ca2079873c9cf1175c18c9b4228..dd6f6fe04cb2f95f83ef5970863f0cc8f792dc91 100644 (file)
@@ -40,7 +40,7 @@ API int iotcon_list_create(iotcon_type_e type, iotcon_list_h *ret_list)
 {
        iotcon_list_h list;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ret_list, IOTCON_ERROR_INVALID_PARAMETER);
 
        if (type < IOTCON_TYPE_INT || IOTCON_TYPE_STATE < type) {
@@ -67,7 +67,7 @@ API int iotcon_list_add_int(iotcon_list_h list, int val, int pos)
 {
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_INT != list->type, IOTCON_ERROR_INVALID_TYPE, "Invalid Type(%d)",
                        list->type);
@@ -86,7 +86,7 @@ API int iotcon_list_add_bool(iotcon_list_h list, bool val, int pos)
 {
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_BOOL != list->type, IOTCON_ERROR_INVALID_TYPE,
                        "Invalid Type(%d)", list->type);
@@ -105,7 +105,7 @@ API int iotcon_list_add_double(iotcon_list_h list, double val, int pos)
 {
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_DOUBLE != list->type, IOTCON_ERROR_INVALID_TYPE,
                        "Invalid Type(%d)", list->type);
@@ -124,7 +124,7 @@ API int iotcon_list_add_str(iotcon_list_h list, char *val, int pos)
 {
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_STR != list->type, IOTCON_ERROR_INVALID_TYPE,
@@ -145,7 +145,7 @@ API int iotcon_list_add_byte_str(iotcon_list_h list, unsigned char *val, int len
 {
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_BYTE_STR != list->type, IOTCON_ERROR_INVALID_TYPE,
@@ -165,7 +165,7 @@ API int iotcon_list_add_list(iotcon_list_h list, iotcon_list_h val, int pos)
 {
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_LIST != list->type, IOTCON_ERROR_INVALID_TYPE,
@@ -185,7 +185,7 @@ API int iotcon_list_add_state(iotcon_list_h list, iotcon_state_h val, int pos)
 {
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_STATE != list->type, IOTCON_ERROR_INVALID_TYPE,
@@ -206,7 +206,7 @@ API int iotcon_list_get_nth_int(iotcon_list_h list, int pos, int *val)
        int ival, ret;
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == list->list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -235,7 +235,7 @@ API int iotcon_list_get_nth_bool(iotcon_list_h list, int pos, bool *val)
        bool bval;
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == list->list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -264,7 +264,7 @@ API int iotcon_list_get_nth_double(iotcon_list_h list, int pos, double *val)
        double dbval;
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == list->list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -293,7 +293,7 @@ API int iotcon_list_get_nth_str(iotcon_list_h list, int pos, char **val)
        char *strval;
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == list->list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -323,7 +323,7 @@ API int iotcon_list_get_nth_byte_str(iotcon_list_h list, int pos,
        int ret, byte_len;
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == list->list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -354,7 +354,7 @@ API int iotcon_list_get_nth_list(iotcon_list_h src, int pos, iotcon_list_h *dest
        iotcon_value_h value;
        iotcon_list_h list_val;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == src, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == src->list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == dest, IOTCON_ERROR_INVALID_PARAMETER);
@@ -383,7 +383,7 @@ API int iotcon_list_get_nth_state(iotcon_list_h list, int pos, iotcon_state_h *s
        iotcon_value_h value;
        iotcon_state_h state_val;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == list->list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
@@ -410,7 +410,7 @@ API int iotcon_list_remove_nth(iotcon_list_h list, int pos)
 {
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == list->list, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -430,7 +430,7 @@ API int iotcon_list_remove_nth(iotcon_list_h list, int pos)
 
 API int iotcon_list_get_type(iotcon_list_h list, iotcon_type_e *type)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == type, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -442,7 +442,7 @@ API int iotcon_list_get_type(iotcon_list_h list, iotcon_type_e *type)
 
 API int iotcon_list_get_length(iotcon_list_h list, unsigned int *length)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == length, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -471,7 +471,7 @@ API int iotcon_list_foreach_int(iotcon_list_h list, iotcon_list_int_cb cb,
        int index = 0;
        icl_basic_s *real = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_INT != list->type, IOTCON_ERROR_INVALID_TYPE, "Invalid Type(%d)",
                        list->type);
@@ -497,7 +497,7 @@ API int iotcon_list_foreach_bool(iotcon_list_h list, iotcon_list_bool_cb cb,
        int index = 0;
        icl_basic_s *real = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_BOOL != list->type, IOTCON_ERROR_INVALID_TYPE,
                        "Invalid Type(%d)", list->type);
@@ -523,7 +523,7 @@ API int iotcon_list_foreach_double(iotcon_list_h list, iotcon_list_double_cb cb,
        int index = 0;
        icl_basic_s *real = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_DOUBLE != list->type, IOTCON_ERROR_INVALID_TYPE,
                        "Invalid Type(%d)", list->type);
@@ -549,7 +549,7 @@ API int iotcon_list_foreach_str(iotcon_list_h list, iotcon_list_str_cb cb,
        int index = 0;
        icl_basic_s *real = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_STR != list->type, IOTCON_ERROR_INVALID_TYPE, "Invalid Type(%d)",
                        list->type);
@@ -575,7 +575,7 @@ API int iotcon_list_foreach_byte_str(iotcon_list_h list, iotcon_list_byte_str_cb
        int index = 0;
        icl_val_byte_str_s *real = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_BYTE_STR != list->type, IOTCON_ERROR_INVALID_TYPE,
                        "Invalid Type(%d)", list->type);
@@ -601,7 +601,7 @@ API int iotcon_list_foreach_list(iotcon_list_h list, iotcon_list_list_cb cb,
        GList *cur = NULL;
        icl_val_list_s *real = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_LIST != list->type, IOTCON_ERROR_INVALID_TYPE,
                        "Invalid Type(%d)", list->type);
@@ -627,7 +627,7 @@ API int iotcon_list_foreach_state(iotcon_list_h list, iotcon_list_state_cb cb,
        GList *cur = NULL;
        icl_val_state_s *real = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(IOTCON_TYPE_STATE != list->type, IOTCON_ERROR_INVALID_TYPE,
                        "Invalid Type(%d)", list->type);
index 8873d250e38d011a90299fb8229fafd0f4a9b705..568743eb868434d7d8a84ab7c784e75319256f20 100644 (file)
@@ -41,7 +41,7 @@ API int iotcon_lite_resource_create(const char *uri_path,
 {
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == uri_path, IOTCON_ERROR_INVALID_PARAMETER);
@@ -66,7 +66,7 @@ API int iotcon_lite_resource_destroy(iotcon_lite_resource_h resource)
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -94,7 +94,7 @@ API int iotcon_lite_resource_update_state(iotcon_lite_resource_h resource,
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -121,7 +121,7 @@ API int iotcon_lite_resource_update_state(iotcon_lite_resource_h resource,
 API int iotcon_lite_resource_get_state(iotcon_lite_resource_h resource,
                iotcon_state_h *state)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
 
index 19ef08d3549e2b43f979c90e860c9586218b9bc3..22a9bc283d6e12e365120db7ba613ba086a179f4 100644 (file)
@@ -24,7 +24,7 @@
 
 API int iotcon_observers_create(iotcon_observers_h *ret_observers)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ret_observers, IOTCON_ERROR_INVALID_PARAMETER);
 
        iotcon_observers_h observers = calloc(1, sizeof(struct icl_observers));
@@ -50,7 +50,7 @@ API void iotcon_observers_destroy(iotcon_observers_h observers)
 
 API int iotcon_observers_add(iotcon_observers_h observers, int obs_id)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == observers, IOTCON_ERROR_INVALID_PARAMETER);
 
        observers->observers_list = g_list_append(observers->observers_list,
@@ -62,7 +62,7 @@ API int iotcon_observers_add(iotcon_observers_h observers, int obs_id)
 
 API int iotcon_observers_remove(iotcon_observers_h observers, int obs_id)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == observers, IOTCON_ERROR_INVALID_PARAMETER);
 
        observers->observers_list = g_list_remove(observers->observers_list,
index 669227ea116e952a80d8e6a2ad95980443c75622..19ad7b2128fbeef2cd74dd3fddf063f0638696c4 100644 (file)
@@ -69,7 +69,7 @@ API int iotcon_options_create(iotcon_options_h *ret_options)
 {
        iotcon_options_h options;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ret_options, IOTCON_ERROR_INVALID_PARAMETER);
 
        options = calloc(1, sizeof(struct icl_options));
@@ -106,7 +106,7 @@ API void iotcon_options_destroy(iotcon_options_h options)
 API int iotcon_options_add(iotcon_options_h options, unsigned short id,
                const char *data)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(1 < options->ref_count, IOTCON_ERROR_INVALID_PARAMETER,
                        "Don't modify it. It is already set.");
@@ -130,7 +130,7 @@ API int iotcon_options_remove(iotcon_options_h options, unsigned short id)
 {
        gboolean is_removed;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(1 < options->ref_count, IOTCON_ERROR_INVALID_PARAMETER,
                        "Don't modify it. It is already set.");
@@ -149,7 +149,7 @@ API int iotcon_options_lookup(iotcon_options_h options, unsigned short id,
 {
        char *value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == data, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -171,7 +171,7 @@ API int iotcon_options_foreach(iotcon_options_h options,
        GHashTableIter iter;
        gpointer key, value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
 
index 80092f719824ed3a6766461bdddc8e4f9b69e6d3..107fb10c28d9e0781a44be7ca445fe6b925eebd0 100644 (file)
@@ -30,7 +30,7 @@ API int iotcon_start_presence(unsigned int time_to_live)
        FN_CALL;
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
 
@@ -54,7 +54,7 @@ API int iotcon_stop_presence(void)
        FN_CALL;
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
 
@@ -78,7 +78,7 @@ API int iotcon_add_presence_cb(const char *host_address,
        FN_CALL;
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
@@ -118,7 +118,7 @@ API int iotcon_remove_presence_cb(iotcon_presence_h presence)
        FN_CALL;
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == presence, IOTCON_ERROR_INVALID_PARAMETER);
@@ -147,7 +147,7 @@ API int iotcon_remove_presence_cb(iotcon_presence_h presence)
 API int iotcon_presence_get_host_address(iotcon_presence_h presence,
                char **host_address)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == presence, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == host_address, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -160,7 +160,7 @@ API int iotcon_presence_get_host_address(iotcon_presence_h presence,
 API int iotcon_presence_get_connectivity_type(iotcon_presence_h presence,
                iotcon_connectivity_type_e *connectivity_type)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == presence, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == connectivity_type, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -173,7 +173,7 @@ API int iotcon_presence_get_connectivity_type(iotcon_presence_h presence,
 API int iotcon_presence_get_resource_type(iotcon_presence_h presence,
                char **resource_type)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == presence, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == resource_type, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -186,7 +186,7 @@ API int iotcon_presence_get_resource_type(iotcon_presence_h presence,
 API int iotcon_presence_response_get_host_address(
                iotcon_presence_response_h response, char **host_address)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == response, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == host_address, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -199,7 +199,7 @@ API int iotcon_presence_response_get_host_address(
 API int iotcon_presence_response_get_connectivity_type(
                iotcon_presence_response_h response, iotcon_connectivity_type_e *connectivity_type)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == response, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == connectivity_type, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -212,7 +212,7 @@ API int iotcon_presence_response_get_connectivity_type(
 API int iotcon_presence_response_get_resource_type(
                iotcon_presence_response_h response, char **resource_type)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == response, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == resource_type, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -225,7 +225,7 @@ API int iotcon_presence_response_get_resource_type(
 API int iotcon_presence_response_get_result(iotcon_presence_response_h response,
                iotcon_presence_result_e *result)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == response, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == result, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -238,7 +238,7 @@ API int iotcon_presence_response_get_result(iotcon_presence_response_h response,
 API int iotcon_presence_response_get_trigger(iotcon_presence_response_h response,
                iotcon_presence_trigger_e *trigger)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == response, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == trigger, IOTCON_ERROR_INVALID_PARAMETER);
 
index 1c11c36eae929d0e04260f26e00f5637f1b43161..a9ec29f23c5a5d627692c946125e26c73e41fc2e 100644 (file)
@@ -31,7 +31,7 @@ API int iotcon_query_create(iotcon_query_h *ret_query)
 {
        iotcon_query_h query;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ret_query, IOTCON_ERROR_INVALID_PARAMETER);
 
        query = calloc(1, sizeof(struct icl_query));
@@ -62,7 +62,7 @@ API int iotcon_query_get_resource_type(iotcon_query_h query,
 {
        char *type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == resource_type, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -81,7 +81,7 @@ API int iotcon_query_get_interface(iotcon_query_h query, char **resource_iface)
 {
        char *iface = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == resource_iface, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -103,7 +103,7 @@ API int iotcon_query_set_resource_type(iotcon_query_h query,
        int length_new = 0;
        char *value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(resource_type && (false == icl_resource_check_type(resource_type)),
                        IOTCON_ERROR_INVALID_PARAMETER);
@@ -135,7 +135,7 @@ API int iotcon_query_set_interface(iotcon_query_h query, const char *resource_if
        int length_new = 0;
        char *value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(resource_iface && (false == icl_resource_check_interface(resource_iface)),
                        IOTCON_ERROR_INVALID_PARAMETER);
@@ -165,7 +165,7 @@ API int iotcon_query_add(iotcon_query_h query, const char *key, const char *valu
 {
        int query_len;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == value, IOTCON_ERROR_INVALID_PARAMETER);
@@ -191,7 +191,7 @@ API int iotcon_query_remove(iotcon_query_h query, const char *key)
        int query_len;
        char *value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -218,7 +218,7 @@ API int iotcon_query_lookup(iotcon_query_h query, const char *key, char **data)
 {
        char *value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == data, IOTCON_ERROR_INVALID_PARAMETER);
@@ -240,7 +240,7 @@ API int iotcon_query_foreach(iotcon_query_h query, iotcon_query_foreach_cb cb,
        GHashTableIter iter;
        gpointer key, value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
 
index 2e4c0cb49795015ec0b0ade83b042b53e9af7069..812f22ffd6a73ed0628f00cac233dca1ae341218 100644 (file)
@@ -31,7 +31,7 @@ API int iotcon_remote_resource_start_caching(iotcon_remote_resource_h resource,
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -67,7 +67,7 @@ API int iotcon_remote_resource_stop_caching(iotcon_remote_resource_h resource)
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -99,7 +99,7 @@ API int iotcon_remote_resource_get_cached_representation(
                iotcon_remote_resource_h resource,
                iotcon_representation_h *representation)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == representation, IOTCON_ERROR_INVALID_PARAMETER);
        WARN_IF(NULL == resource->cached_repr, "No Cached Representation");
index d8bf4d2871fb3c9b15dfbd39a3b131d8e5236678..e3534a3bf43f5e5b46fe0d5f8a0d7de142a34f38 100644 (file)
@@ -27,7 +27,7 @@ API int iotcon_remote_resource_get(iotcon_remote_resource_h resource,
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -67,7 +67,7 @@ API int iotcon_remote_resource_put(iotcon_remote_resource_h resource,
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -108,7 +108,7 @@ API int iotcon_remote_resource_post(iotcon_remote_resource_h resource,
 
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -145,7 +145,7 @@ API int iotcon_remote_resource_delete(iotcon_remote_resource_h resource,
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -184,7 +184,7 @@ API int iotcon_remote_resource_observe_register(
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -223,7 +223,7 @@ API int iotcon_remote_resource_observe_deregister(
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
index 955ed3c122edcf766aff79eb216b846703970033..42d1b33767bd4b7e50e1098c9e96e199e92281c1 100644 (file)
@@ -30,7 +30,7 @@ API int iotcon_remote_resource_start_monitoring(
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -67,7 +67,7 @@ API int iotcon_remote_resource_stop_monitoring(
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
index 1c537052055b233cb988e242d1cfe55f7a5a942b..bac98b8a90baa09da863068c549c746838f61d73 100644 (file)
@@ -42,7 +42,7 @@ API int iotcon_find_resource(const char *host_address,
 {
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
@@ -80,7 +80,7 @@ API int iotcon_remote_resource_create(const char *host_address,
        FN_CALL;
        iotcon_remote_resource_h resource = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == host_address, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == uri_path, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(false == icl_resource_check_uri_path(uri_path),
@@ -193,7 +193,7 @@ API int iotcon_remote_resource_clone(iotcon_remote_resource_h src,
        int ret;
        iotcon_remote_resource_h resource = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == src, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == dest, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -246,7 +246,7 @@ API int iotcon_remote_resource_clone(iotcon_remote_resource_h src,
 API int iotcon_remote_resource_get_uri_path(iotcon_remote_resource_h resource,
                char **uri_path)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == uri_path, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -260,7 +260,7 @@ API int iotcon_remote_resource_get_uri_path(iotcon_remote_resource_h resource,
 API int iotcon_remote_resource_get_host_address(
                iotcon_remote_resource_h resource, char **host_address)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == host_address, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -274,7 +274,7 @@ API int iotcon_remote_resource_get_host_address(
 API int iotcon_remote_resource_get_connectivity_type(
                iotcon_remote_resource_h resource, iotcon_connectivity_type_e *connectivity_type)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == connectivity_type, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -288,7 +288,7 @@ API int iotcon_remote_resource_get_connectivity_type(
 API int iotcon_remote_resource_get_device_id(iotcon_remote_resource_h resource,
                char **device_id)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == device_id, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(NULL == resource->device_id, IOTCON_ERROR_NO_DATA,
@@ -303,7 +303,7 @@ API int iotcon_remote_resource_get_device_id(iotcon_remote_resource_h resource,
 API int iotcon_remote_resource_get_types(iotcon_remote_resource_h resource,
                iotcon_resource_types_h *types)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == types, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -317,7 +317,7 @@ API int iotcon_remote_resource_get_types(iotcon_remote_resource_h resource,
 API int iotcon_remote_resource_get_interfaces(iotcon_remote_resource_h resource,
                iotcon_resource_interfaces_h *ifaces)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == ifaces, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -330,7 +330,7 @@ API int iotcon_remote_resource_get_interfaces(iotcon_remote_resource_h resource,
 API int iotcon_remote_resource_get_properties(iotcon_remote_resource_h resource,
                int *properties)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == properties, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -342,7 +342,7 @@ API int iotcon_remote_resource_get_properties(iotcon_remote_resource_h resource,
 API int iotcon_remote_resource_get_options(iotcon_remote_resource_h resource,
                iotcon_options_h *options)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
        WARN_IF(NULL == resource->header_options, "Not Set header options");
@@ -356,7 +356,7 @@ API int iotcon_remote_resource_get_options(iotcon_remote_resource_h resource,
 API int iotcon_remote_resource_set_options(iotcon_remote_resource_h resource,
                iotcon_options_h options)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
 
        if (options)
@@ -374,7 +374,7 @@ API int iotcon_remote_resource_get_time_interval(int *time_interval)
 {
        int ret, arg_time_interval;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == time_interval, IOTCON_ERROR_INVALID_PARAMETER);
 
        ret = icl_ioty_remote_resource_get_time_interval(&arg_time_interval);
@@ -393,7 +393,7 @@ API int iotcon_remote_resource_set_time_interval(int time_interval)
 {
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(ICL_REMOTE_RESOURCE_MAX_TIME_INTERVAL < time_interval || time_interval <= 0,
                        IOTCON_ERROR_INVALID_PARAMETER);
 
index 0bbb62d38b538530bbcded27a62cdc21aed92aa6..7c3768dd7719e6296c6e72b7245f9ada2ed33546 100644 (file)
@@ -52,7 +52,7 @@ API int iotcon_representation_create(iotcon_representation_h *ret_repr)
 {
        iotcon_representation_h repr;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ret_repr, IOTCON_ERROR_INVALID_PARAMETER);
 
        repr = calloc(1, sizeof(struct icl_representation_s));
@@ -103,7 +103,7 @@ API void iotcon_representation_destroy(iotcon_representation_h repr)
 API int iotcon_representation_get_uri_path(iotcon_representation_h repr,
                char **uri_path)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == uri_path, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == repr->uri_path, IOTCON_ERROR_NO_DATA);
@@ -116,7 +116,7 @@ API int iotcon_representation_get_uri_path(iotcon_representation_h repr,
 API int iotcon_representation_set_uri_path(iotcon_representation_h repr,
                const char *uri_path)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == uri_path, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(false == icl_resource_check_uri_path(uri_path),
@@ -135,7 +135,7 @@ API int iotcon_representation_set_uri_path(iotcon_representation_h repr,
 API int iotcon_representation_get_resource_types(iotcon_representation_h repr,
                iotcon_resource_types_h *types)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == types, IOTCON_ERROR_INVALID_PARAMETER);
        WARN_IF(NULL == repr->res_types, "Not Set Resource Types");
@@ -148,7 +148,7 @@ API int iotcon_representation_get_resource_types(iotcon_representation_h repr,
 API int iotcon_representation_set_resource_types(iotcon_representation_h repr,
                iotcon_resource_types_h types)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
 
        if (types)
@@ -165,7 +165,7 @@ API int iotcon_representation_set_resource_types(iotcon_representation_h repr,
 API int iotcon_representation_get_resource_interfaces(iotcon_representation_h repr,
                iotcon_resource_interfaces_h *ifaces)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == ifaces, IOTCON_ERROR_INVALID_PARAMETER);
        WARN_IF(NULL == repr->interfaces, "Not Set Resource Interfaces");
@@ -178,7 +178,7 @@ API int iotcon_representation_get_resource_interfaces(iotcon_representation_h re
 API int iotcon_representation_set_resource_interfaces(
                iotcon_representation_h repr, iotcon_resource_interfaces_h ifaces)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
 
        if (ifaces)
@@ -195,7 +195,7 @@ API int iotcon_representation_set_resource_interfaces(
 API int iotcon_representation_set_state(iotcon_representation_h repr,
                iotcon_state_h state)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
 
        if (state)
@@ -213,7 +213,7 @@ API int iotcon_representation_set_state(iotcon_representation_h repr,
 API int iotcon_representation_get_state(iotcon_representation_h repr,
                iotcon_state_h *state)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -227,7 +227,7 @@ API int iotcon_representation_add_child(iotcon_representation_h parent,
 {
        iotcon_representation_h repr;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == child, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -242,7 +242,7 @@ API int iotcon_representation_add_child(iotcon_representation_h parent,
 API int iotcon_representation_remove_child(iotcon_representation_h parent,
                iotcon_representation_h child)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == child, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -259,7 +259,7 @@ API int iotcon_representation_foreach_children(iotcon_representation_h parent,
 {
        GList *list, *next;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -277,7 +277,7 @@ API int iotcon_representation_foreach_children(iotcon_representation_h parent,
 API int iotcon_representation_get_child_count(iotcon_representation_h parent,
                unsigned int *count)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == count, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -291,7 +291,7 @@ API int iotcon_representation_get_nth_child(iotcon_representation_h parent,
 {
        iotcon_representation_h repr;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == child, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(pos < 0, IOTCON_ERROR_INVALID_PARAMETER);
@@ -319,7 +319,7 @@ API int iotcon_representation_clone(const iotcon_representation_h src,
        iotcon_resource_interfaces_h ifaces;
        iotcon_representation_h cloned_repr, copied_repr;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == src, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == dest, IOTCON_ERROR_INVALID_PARAMETER);
 
index 18099a5deab7a26ac06b4f0f55aeb2b57cbed257..a70850af24a7df027f98369460163533b41d58b2 100644 (file)
@@ -21,7 +21,7 @@
 API int iotcon_request_get_host_address(iotcon_request_h request,
                char **host_address)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == request, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == host_address, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -34,7 +34,7 @@ API int iotcon_request_get_host_address(iotcon_request_h request,
 API int iotcon_request_get_connectivity_type(iotcon_request_h request,
                iotcon_connectivity_type_e *connectivity_type)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == request, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == connectivity_type, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -48,7 +48,7 @@ API int iotcon_request_get_connectivity_type(iotcon_request_h request,
 API int iotcon_request_get_representation(iotcon_request_h request,
                iotcon_representation_h *repr)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == request, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -61,7 +61,7 @@ API int iotcon_request_get_representation(iotcon_request_h request,
 API int iotcon_request_get_request_type(iotcon_request_h request,
                iotcon_request_type_e *type)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == request, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == type, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -75,7 +75,7 @@ API int iotcon_request_get_request_type(iotcon_request_h request,
 API int iotcon_request_get_options(iotcon_request_h request,
                iotcon_options_h *options)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == request, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
        WARN_IF(NULL == request->header_options, "Not Set header options");
@@ -89,7 +89,7 @@ API int iotcon_request_get_options(iotcon_request_h request,
 /* The content of the request should not be freed by user. */
 API int iotcon_request_get_query(iotcon_request_h request, iotcon_query_h *query)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == request, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
        WARN_IF(NULL == request->query, "Not Set query");
@@ -103,7 +103,7 @@ API int iotcon_request_get_query(iotcon_request_h request, iotcon_query_h *query
 API int iotcon_request_get_observe_type(iotcon_request_h request,
                iotcon_observe_type_e *observe_type)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == request, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == observe_type, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -115,7 +115,7 @@ API int iotcon_request_get_observe_type(iotcon_request_h request,
 
 API int iotcon_request_get_observe_id(iotcon_request_h request, int *observe_id)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == request, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == observe_id, IOTCON_ERROR_INVALID_PARAMETER);
 
index 148b3d02c7e988c9b4fa0409c6da506d0bc9482d..ded8d879515fa4801873cd5e440f0acd28abb856 100644 (file)
@@ -39,7 +39,7 @@ API int iotcon_resource_interfaces_create(iotcon_resource_interfaces_h *ret_ifac
 {
        iotcon_resource_interfaces_h ifaces;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ret_ifaces, IOTCON_ERROR_INVALID_PARAMETER);
 
        ifaces = calloc(1, sizeof(struct icl_resource_ifaces));
@@ -97,7 +97,7 @@ API int iotcon_resource_interfaces_add(iotcon_resource_interfaces_h ifaces,
 {
        char *resource_iface;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ifaces, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == iface, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(1 < ifaces->ref_count, IOTCON_ERROR_INVALID_PARAMETER,
@@ -127,7 +127,7 @@ API int iotcon_resource_interfaces_remove(iotcon_resource_interfaces_h ifaces,
        GList *node;
        char *node_data;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ifaces, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == iface, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(1 < ifaces->ref_count, IOTCON_ERROR_INVALID_PARAMETER,
@@ -152,7 +152,7 @@ API int iotcon_resource_interfaces_foreach(iotcon_resource_interfaces_h ifaces,
 {
        GList *node;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ifaces, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -172,7 +172,7 @@ API int iotcon_resource_interfaces_clone(iotcon_resource_interfaces_h src,
        char *resource_iface;
        iotcon_resource_interfaces_h resource_ifaces;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == src, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == dest, IOTCON_ERROR_INVALID_PARAMETER);
 
index 5fa392825fb988487905d0fa65816c7cf56e4dfe..6f42cacb1ad9f9c104dcdffd0ca33f224ed9c9f5 100644 (file)
@@ -39,7 +39,7 @@ API int iotcon_resource_types_create(iotcon_resource_types_h *ret_types)
 {
        iotcon_resource_types_h types;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ret_types, IOTCON_ERROR_INVALID_PARAMETER);
 
        types = calloc(1, sizeof(struct icl_resource_types));
@@ -97,7 +97,7 @@ API int iotcon_resource_types_add(iotcon_resource_types_h types, const char *typ
 {
        char *resource_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == types, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == type, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(1 < types->ref_count, IOTCON_ERROR_INVALID_PARAMETER,
@@ -127,7 +127,7 @@ API int iotcon_resource_types_remove(iotcon_resource_types_h types,
        GList *found_node;
        char *node_data;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == types, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == type, IOTCON_ERROR_INVALID_PARAMETER);
        RETVM_IF(1 < types->ref_count, IOTCON_ERROR_INVALID_PARAMETER,
@@ -152,7 +152,7 @@ API int iotcon_resource_types_foreach(iotcon_resource_types_h types,
 {
        GList *node;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == types, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -172,7 +172,7 @@ API int iotcon_resource_types_clone(iotcon_resource_types_h src,
        char *resource_type;
        iotcon_resource_types_h resource_types;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == src, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == dest, IOTCON_ERROR_INVALID_PARAMETER);
 
index 8923568cfb248ec553b761f45a075e807f7ed412..c67a61aa5564c5fee574b2bd5d432aab15d8bdb9 100644 (file)
@@ -113,7 +113,7 @@ API int iotcon_resource_create(const char *uri_path,
 {
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == uri_path, IOTCON_ERROR_INVALID_PARAMETER);
@@ -141,7 +141,7 @@ API int iotcon_resource_destroy(iotcon_resource_h resource)
        FN_CALL;
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -171,7 +171,7 @@ API int iotcon_resource_bind_interface(iotcon_resource_h resource,
        FN_CALL;
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -202,7 +202,7 @@ API int iotcon_resource_bind_type(iotcon_resource_h resource,
        FN_CALL;
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
@@ -229,7 +229,7 @@ API int iotcon_resource_bind_type(iotcon_resource_h resource,
 API int iotcon_resource_set_request_handler(iotcon_resource_h resource,
                iotcon_request_handler_cb cb, void *user_data)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -246,7 +246,7 @@ API int iotcon_resource_bind_child_resource(iotcon_resource_h parent,
 {
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER);
@@ -274,7 +274,7 @@ API int iotcon_resource_unbind_child_resource(iotcon_resource_h parent,
 {
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER);
@@ -305,7 +305,7 @@ API int iotcon_resource_unbind_child_resource(iotcon_resource_h parent,
 API int iotcon_resource_get_child_count(iotcon_resource_h resource,
                unsigned int *count)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == count, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -320,7 +320,7 @@ API int iotcon_resource_get_nth_child(iotcon_resource_h parent, int index,
 {
        iotcon_resource_h resource;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == parent, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == child, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(index < 0, IOTCON_ERROR_INVALID_PARAMETER);
@@ -341,7 +341,7 @@ API int iotcon_resource_get_nth_child(iotcon_resource_h parent, int index,
 /* The content of the resource should not be freed by user. */
 API int iotcon_resource_get_uri_path(iotcon_resource_h resource, char **uri_path)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == uri_path, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -355,7 +355,7 @@ API int iotcon_resource_get_uri_path(iotcon_resource_h resource, char **uri_path
 API int iotcon_resource_get_types(iotcon_resource_h resource,
                iotcon_resource_types_h *types)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == types, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -368,7 +368,7 @@ API int iotcon_resource_get_types(iotcon_resource_h resource,
 API int iotcon_resource_get_interfaces(iotcon_resource_h resource,
                iotcon_resource_interfaces_h *ifaces)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == ifaces, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -380,7 +380,7 @@ API int iotcon_resource_get_interfaces(iotcon_resource_h resource,
 
 API int iotcon_resource_get_properties(iotcon_resource_h resource, int *properties)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == properties, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -394,7 +394,7 @@ API int iotcon_resource_notify(iotcon_resource_h resource,
 {
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
index b7bc8e20d8c5f5328516b059d66d59497d8a77b7..98b0852f2d1b4a0ac888a7a3f98589687b104ebc 100644 (file)
@@ -36,7 +36,7 @@ API int iotcon_response_create(iotcon_request_h request,
 {
        FN_CALL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == request, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == response, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -72,7 +72,7 @@ API void iotcon_response_destroy(iotcon_response_h resp)
 API int iotcon_response_get_options(iotcon_response_h resp,
                iotcon_options_h *options)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
        WARN_IF(NULL == resp->header_options, "Not Set header options");
@@ -85,7 +85,7 @@ API int iotcon_response_get_options(iotcon_response_h resp,
 API int iotcon_response_get_representation(iotcon_response_h resp,
                iotcon_representation_h *repr)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == resp->repr, IOTCON_ERROR_NO_DATA);
@@ -99,7 +99,7 @@ API int iotcon_response_get_representation(iotcon_response_h resp,
 API int iotcon_response_get_result(iotcon_response_h resp,
                iotcon_response_result_e *result)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == result, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -111,7 +111,7 @@ API int iotcon_response_get_result(iotcon_response_h resp,
 API int iotcon_response_set_result(iotcon_response_h resp,
                iotcon_response_result_e result)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
 
        if (result < IOTCON_RESPONSE_OK || ICL_RESPONSE_RESULT_MAX <= result) {
@@ -127,7 +127,7 @@ API int iotcon_response_set_result(iotcon_response_h resp,
 API int iotcon_response_set_representation(iotcon_response_h resp,
                const char *iface, iotcon_representation_h repr)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == iface, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -149,7 +149,7 @@ API int iotcon_response_set_representation(iotcon_response_h resp,
 API int iotcon_response_set_options(iotcon_response_h resp,
                iotcon_options_h options)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
 
        if (options)
@@ -168,7 +168,7 @@ API int iotcon_response_send(iotcon_response_h resp)
        FN_CALL;
        int ret, connectivity_type;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission(IC_PERMISSION_INTERNET),
                        IOTCON_ERROR_PERMISSION_DENIED);
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
index e06e0cbef4020762d1224076cf2f6b4ff008cc8f..8168baf32539de7fb197ea2300476a09be35cb56 100644 (file)
@@ -39,7 +39,7 @@ API int iotcon_state_create(iotcon_state_h *ret_state)
 {
        iotcon_state_h state;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == ret_state, IOTCON_ERROR_INVALID_PARAMETER);
 
        state = calloc(1, sizeof(struct icl_state_s));
@@ -77,7 +77,7 @@ API int iotcon_state_remove(iotcon_state_h state, const char *key)
        gboolean ret = FALSE;
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -101,7 +101,7 @@ API int iotcon_state_get_int(iotcon_state_h state, const char *key, int *val)
 {
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -127,7 +127,7 @@ API int iotcon_state_add_int(iotcon_state_h state, const char *key, int val)
 {
        iotcon_value_h value;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -147,7 +147,7 @@ API int iotcon_state_get_bool(iotcon_state_h state, const char *key, bool *val)
        icl_basic_s *real = NULL;
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -173,7 +173,7 @@ API int iotcon_state_add_bool(iotcon_state_h state, const char *key, bool val)
 {
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -193,7 +193,7 @@ API int iotcon_state_get_double(iotcon_state_h state, const char *key, double *v
        icl_basic_s *real = NULL;
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -219,7 +219,7 @@ API int iotcon_state_add_double(iotcon_state_h state, const char *key, double va
 {
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -239,7 +239,7 @@ API int iotcon_state_get_str(iotcon_state_h state, const char *key, char **val)
        icl_basic_s *real = NULL;
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -265,7 +265,7 @@ API int iotcon_state_add_str(iotcon_state_h state, const char *key, char *val)
 {
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -287,7 +287,7 @@ API int iotcon_state_get_byte_str(iotcon_state_h state, const char *key,
        iotcon_value_h value = NULL;
        icl_val_byte_str_s *real = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -316,7 +316,7 @@ API int iotcon_state_add_byte_str(iotcon_state_h state, const char *key,
 {
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -338,7 +338,7 @@ API int iotcon_state_is_null(iotcon_state_h state, const char *key, bool *is_nul
        icl_basic_s *real = NULL;
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == is_null, IOTCON_ERROR_INVALID_PARAMETER);
@@ -359,7 +359,7 @@ API int iotcon_state_add_null(iotcon_state_h state, const char *key)
 {
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -380,7 +380,7 @@ API int iotcon_state_get_list(iotcon_state_h state, const char *key,
        iotcon_value_h value = NULL;
        icl_val_list_s *real = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
@@ -407,7 +407,7 @@ API int iotcon_state_add_list(iotcon_state_h state, const char *key,
 {
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == list, IOTCON_ERROR_INVALID_PARAMETER);
@@ -430,7 +430,7 @@ API int iotcon_state_get_state(iotcon_state_h src, const char *key,
        icl_val_state_s *real = NULL;
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == src, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == dest, IOTCON_ERROR_INVALID_PARAMETER);
@@ -457,7 +457,7 @@ API int iotcon_state_add_state(iotcon_state_h state, const char *key,
 {
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == val, IOTCON_ERROR_INVALID_PARAMETER);
@@ -478,7 +478,7 @@ API int iotcon_state_get_type(iotcon_state_h state, const char *key,
 {
        iotcon_value_h value = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == key, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == type, IOTCON_ERROR_INVALID_PARAMETER);
@@ -507,7 +507,7 @@ int icl_state_set_value(iotcon_state_h state, const char *key, iotcon_value_h va
 
 API int iotcon_state_get_keys_count(iotcon_state_h state, unsigned int *count)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == count, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == state->hash_table, IOTCON_ERROR_INVALID_PARAMETER);
@@ -524,7 +524,7 @@ API int iotcon_state_clone(iotcon_state_h state, iotcon_state_h *state_clone)
 
        iotcon_state_h temp = NULL;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == state_clone, IOTCON_ERROR_INVALID_PARAMETER);
 
@@ -566,7 +566,7 @@ API int iotcon_state_foreach(iotcon_state_h state, iotcon_state_cb cb,
        GHashTableIter iter;
        gpointer key;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == state, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
 
index e80ffced54e879e4da5539ecee6553e39612b898..00071a0536c37d4b5afe5e5baf10ef2cd2e526af 100644 (file)
--- a/lib/icl.c
+++ b/lib/icl.c
@@ -27,11 +27,36 @@ static pthread_t icl_thread;
 static int icl_timeout_seconds = ICL_TIMEOUT_DEFAULT;
 static int icl_init_count;
 
+API int iotcon_secure_initialize(const char *file_path)
+{
+       int ret;
+
+       RETV_IF(false == ic_utils_check_oic_security_feature(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_permission((IC_PERMISSION_INTERNET|IC_PERMISSION_NETWORK_GET)),
+                       IOTCON_ERROR_PERMISSION_DENIED);
+       // TODO: Consider (NULL == Path)
+       RETV_IF(NULL == file_path, IOTCON_ERROR_INVALID_PARAMETER);
+
+       ret = icl_ioty_set_persistent_storage(file_path);
+       if (IOTCON_ERROR_NONE != ret) {
+               ERR("icl_set_persistent_storage() Fail(%d)", ret);
+               return ret;
+       }
+
+       ret = iotcon_initialize();
+       if (IOTCON_ERROR_NONE != ret) {
+               ERR("iotcon_initialize() Fail(%d)", ret);
+               return ret;
+       }
+
+       return IOTCON_ERROR_NONE;
+}
+
 API int iotcon_initialize(void)
 {
        int ret;
 
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(false == ic_utils_check_permission((IC_PERMISSION_INTERNET|IC_PERMISSION_NETWORK_GET)),
                        IOTCON_ERROR_PERMISSION_DENIED);
 
@@ -77,7 +102,7 @@ API void iotcon_deinitialize(void)
 
 API int iotcon_get_timeout(int *timeout_seconds)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == timeout_seconds, IOTCON_ERROR_INVALID_PARAMETER);
 
        *timeout_seconds = icl_timeout_seconds;
@@ -88,7 +113,7 @@ API int iotcon_get_timeout(int *timeout_seconds)
 
 API int iotcon_set_timeout(int timeout_seconds)
 {
-       RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
+       RETV_IF(false == ic_utils_check_oic_feature(), IOTCON_ERROR_NOT_SUPPORTED);
        if (ICL_TIMEOUT_MAX < timeout_seconds || timeout_seconds <= 0) {
                ERR("timeout_seconds(%d) must be in range from 1 to 3600", timeout_seconds);
                return IOTCON_ERROR_INVALID_PARAMETER;
index 592c80969573d152fb00b4029877656078cb01f6..f8d4aba32dbfac3a37f4190efb0295f409a2303b 100644 (file)
@@ -36,9 +36,14 @@ extern "C" {
  * @section CAPI_IOT_CONNECTIVITY_MODULE_FEATURE Related Features
  * This API is related with the following features:\n
  * - http://tizen.org/feature/iot.oic\n
+ * - http://tizen.org/feature/iot.oic.security\n
  *
  * It is recommended to design feature related codes in your application for reliability.\n
  *
+ * If the feature(http://tizen.org/feature/iot.oic.security) for OIC security architecture
+ * is applied, you MUST call iotcon_secure_initialize() instead of iotcon_initialize().
+ * Then applications communicate with each other based on OIC security architecture.
+ *
  * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application.\n
  *
  * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
@@ -49,7 +54,37 @@ extern "C" {
  */
 
 /**
- * @brief Initializes to the iotcon service.
+ * @brief Initializes IoTCon with secure mode.
+ * @details Call this function to start IoTCon above OIC security architecture.
+ *
+ * @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/internet
+ *
+ * @remarks If the device has the feature("http://tizen.org/feature/iot.oic.security"),
+ * you must call this function instead of iotcon_initialize().\n
+ * @a file_path point to a file for handling secure virtual resources.
+ * The file that is CBOR(Concise Binary Object Representation)-format must already exist
+ * in @a file_path. We recommend to use application-local file for @a file_path.\n
+ * You must call iotcon_deinitialize() if IoTCon API is no longer needed.
+ *
+ * @param[in] file_path The file path to point to storage for handling secure virtual resources.
+ *
+ * @return  0 on success, otherwise a negative error value.
+ * @retval #IOTCON_ERROR_NONE Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
+ * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #IOTCON_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #IOTCON_ERROR_IOTIVITY  Iotivity errors
+ *
+ * @see iotcon_deinitialize()
+ * @see system_info_get_platform_bool()
+ */
+int iotcon_secure_initialize(const char *file_path);
+
+/**
+ * @brief Initializes IoTCon.
  * @details Call this function to start IoTCon.
  *
  * @since_tizen 3.0
@@ -57,11 +92,11 @@ extern "C" {
  * @privilege %http://tizen.org/privilege/network.get
  * @privilege %http://tizen.org/privilege/internet
  *
- * @remarks You must free all resources of the IoTCon by calling iotcon_deinitialize()
- * if IoTCon API is no longer needed.
+ * @remarks You must call iotcon_deinitialize() if IoTCon API is no longer needed.
  *
  * @return  0 on success, otherwise a negative error value.
  * @retval #IOTCON_ERROR_NONE Successful
+ * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
  * @retval #IOTCON_ERROR_PERMISSION_DENIED Permission denied
  *
  * @see iotcon_deinitialize()
@@ -69,7 +104,7 @@ extern "C" {
 int iotcon_initialize(void);
 
 /**
- * @brief Deinitializes from the iotcon service.
+ * @brief Deinitializes IoTCon.
  * @details Frees the resources allocated to IoTCon.
  *
  * @since_tizen 3.0
@@ -79,6 +114,7 @@ int iotcon_initialize(void);
  * @return void
  *
  * @see iotcon_initialize()
+ * @see iotcon_secure_initialize()
  */
 void iotcon_deinitialize(void);