modify return value of some APIs (IOTCON_ERROR_ALREADY, IOTCON_ERROR_NO_DATA) 05/86005/2
authoryoungman <yman.jung@samsung.com>
Tue, 30 Aug 2016 06:25:01 +0000 (15:25 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Tue, 6 Sep 2016 07:38:18 +0000 (00:38 -0700)
Change-Id: I84e1b53ef410479f563e39cf2dacf9487b87d303
Signed-off-by: youngman <yman.jung@samsung.com>
include/iotcon-resource-interfaces.h
include/iotcon-resource-types.h
include/iotcon-resource.h
src/ic-resource-interfaces.c
src/ic-resource-types.c
src/ic-resource.c

index 709d044..01bd0eb 100644 (file)
@@ -155,6 +155,7 @@ void iotcon_resource_interfaces_destroy(iotcon_resource_interfaces_h ifaces);
  * @retval #IOTCON_ERROR_NONE  Successful
  * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
  * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #IOTCON_ERROR_ALREADY  Already done
  *
  * @see iotcon_resource_interfaces_create()
  * @see iotcon_resource_interfaces_destroy()
index 6247bac..c2ce105 100644 (file)
@@ -157,6 +157,7 @@ void iotcon_resource_types_destroy(iotcon_resource_types_h types);
  * @retval #IOTCON_ERROR_NONE  Successful
  * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
  * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #IOTCON_ERROR_ALREADY  Already done
  *
  * @see iotcon_resource_types_create()
  * @see iotcon_resource_types_destroy()
index 30d462e..2bf0f2f 100644 (file)
@@ -306,6 +306,7 @@ int iotcon_resource_destroy(iotcon_resource_h resource_handle);
  * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval #IOTCON_ERROR_SYSTEM System error
  * @retval #IOTCON_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #IOTCON_ERROR_ALREADY  Already done
  *
  * @pre iotcon_initialize() should be called to initialize.
  *
@@ -339,6 +340,7 @@ int iotcon_resource_bind_interface(iotcon_resource_h resource, const char *iface
  * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval #IOTCON_ERROR_SYSTEM System error
  * @retval #IOTCON_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #IOTCON_ERROR_ALREADY  Already done
  *
  * @pre iotcon_initialize() should be called to initialize.
  *
@@ -429,6 +431,7 @@ int iotcon_resource_bind_child_resource(iotcon_resource_h parent,
  * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
  * @retval #IOTCON_ERROR_SYSTEM System error
  * @retval #IOTCON_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #IOTCON_ERROR_NO_DATA No data available
  *
  * @pre iotcon_initialize() should be called to initialize.
  *
index fdfc6fe..3d57280 100644 (file)
@@ -106,7 +106,7 @@ API int iotcon_resource_interfaces_add(iotcon_resource_interfaces_h ifaces,
 
        if (true == _icl_resource_interfaces_duplicate_check(ifaces, iface)) {
                ERR("%s is already contained.", iface);
-               return IOTCON_ERROR_INVALID_PARAMETER;
+               return IOTCON_ERROR_ALREADY;
        }
 
        resource_iface = strdup(iface);
index 3dc43e4..edf5a18 100644 (file)
@@ -106,7 +106,7 @@ API int iotcon_resource_types_add(iotcon_resource_types_h types, const char *typ
 
        if (true == _icl_resource_types_duplicate_check(types, type)) {
                ERR("%s is already contained.", type);
-               return IOTCON_ERROR_INVALID_PARAMETER;
+               return IOTCON_ERROR_ALREADY;
        }
 
        resource_type = strdup(type);
index d6353f9..ef8bdfb 100644 (file)
@@ -254,7 +254,7 @@ API int iotcon_resource_unbind_child_resource(iotcon_resource_h parent,
 
        if (NULL == g_list_find(parent->children, child)) {
                ERR("child resource is not bound to parent resource.");
-               return IOTCON_ERROR_INVALID_PARAMETER;
+               return IOTCON_ERROR_NO_DATA;
        }
 
        ret = icl_ioty_resource_unbind_child_resource(parent, child);