Modify return type of getting API 66/67866/5
authoryoungman <yman.jung@samsung.com>
Thu, 28 Apr 2016 23:58:21 +0000 (08:58 +0900)
committeryoungman <yman.jung@samsung.com>
Fri, 29 Apr 2016 06:33:19 +0000 (15:33 +0900)
Change-Id: I63cc406d47a1944c3f9046d2310a15eb5df05c79
Signed-off-by: youngman <yman.jung@samsung.com>
lib/icl-ioty-ocprocess.c
lib/icl-remote-resource-caching.c
lib/icl-remote-resource.c
lib/icl-representation.c
lib/icl-request.c
lib/icl-response.c
lib/include/iotcon-remote-resource.h
lib/include/iotcon-representation.h
lib/include/iotcon-response.h

index ac034ba09cd195f9ee75452fd9278fc9d6dc25ad..8c1e3f5aeb174bc5714583000d5f1c7a148134fb 100644 (file)
@@ -562,10 +562,14 @@ OCEntityHandlerResult icl_ioty_ocprocess_request_cb(OCEntityHandlerFlag flag,
        }
 
        /* representation */
-       if (request->payload)
+       if (request->payload) {
                icl_ioty_parse_oic_rep_payload((OCRepPayload*)request->payload, true, &repr);
-       else
+               if (repr && NULL == repr->uri_path)
+                       repr->uri_path = ic_utils_strdup(resource->uri_path);
+       } else {
                repr = NULL;
+       }
+
 
        /* for iotcon_resource_notify */
        if (IOTCON_OBSERVE_REGISTER == obs_type) {
index 73280d15058df50a2f33b49533489770f9da72c6..eaae19914e3e2d94759b3763734d53fca17fa81e 100644 (file)
@@ -104,11 +104,7 @@ API int iotcon_remote_resource_get_cached_representation(
        RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == representation, IOTCON_ERROR_INVALID_PARAMETER);
-
-       if (NULL == resource->cached_repr) {
-               ERR("No Caching Representation");
-               return IOTCON_ERROR_NO_DATA;
-       }
+       WARN_IF(NULL == resource->cached_repr, "No Cached Representation");
 
        *representation = resource->cached_repr;
 
index 554ceb68b5310ac2d693e5ee4fa69fd5e04a8bf6..6ab20dae792acc21e2ecf5537b9991b9930b7ad9 100644 (file)
@@ -347,7 +347,7 @@ API int iotcon_remote_resource_get_options(iotcon_remote_resource_h resource,
        RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resource, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
-       RETV_IF(NULL == resource->header_options, IOTCON_ERROR_NO_DATA);
+       WARN_IF(NULL == resource->header_options, "Not Set header options");
 
        *options = resource->header_options;
 
index 41085c102881a9b07e03b326d62bd3c196088cdd..a3f75105e39ce193aeb48047236326cda0fbf5fa 100644 (file)
@@ -139,7 +139,7 @@ API int iotcon_representation_get_resource_types(iotcon_representation_h repr,
        RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == types, IOTCON_ERROR_INVALID_PARAMETER);
-       RETV_IF(NULL == repr->res_types, IOTCON_ERROR_NO_DATA);
+       WARN_IF(NULL == repr->res_types, "Not Set Resource Types");
 
        *types = repr->res_types;
 
@@ -169,7 +169,7 @@ API int iotcon_representation_get_resource_interfaces(iotcon_representation_h re
        RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == repr, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == ifaces, IOTCON_ERROR_INVALID_PARAMETER);
-       RETV_IF(NULL == repr->interfaces, IOTCON_ERROR_NO_DATA);
+       WARN_IF(NULL == repr->interfaces, "Not Set Resource Interfaces");
 
        *ifaces = repr->interfaces;
 
index 375bf44c7e4bf707759cc6acdd8c92d31b46eb71..cb15c08bb55099b3c93e3254fa26407d23454fa7 100644 (file)
@@ -78,6 +78,7 @@ API int iotcon_request_get_options(iotcon_request_h request,
        RETV_IF(false == ic_utils_check_oic_feature_supported(), 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");
 
        *options = request->header_options;
 
@@ -91,6 +92,7 @@ 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(NULL == request, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == query, IOTCON_ERROR_INVALID_PARAMETER);
+       WARN_IF(NULL == request->query, "Not Set query");
 
        *query = request->query;
 
index cc1e3b84f570835957a4a72a6a393ed589b7c166..eb5b2eacf42b58caafc95fc57b4bea6a4bfb7f1f 100644 (file)
@@ -75,7 +75,7 @@ API int iotcon_response_get_options(iotcon_response_h resp,
        RETV_IF(false == ic_utils_check_oic_feature_supported(), IOTCON_ERROR_NOT_SUPPORTED);
        RETV_IF(NULL == resp, IOTCON_ERROR_INVALID_PARAMETER);
        RETV_IF(NULL == options, IOTCON_ERROR_INVALID_PARAMETER);
-       RETV_IF(NULL == resp->header_options, IOTCON_ERROR_NO_DATA);
+       WARN_IF(NULL == resp->header_options, "Not Set header options");
 
        *options = resp->header_options;
 
index 53f7ddd51aa667ce75280becd4ecc25fe3bb9191..98fe875473d8d256069d1c9700b48828e829598e 100644 (file)
@@ -757,7 +757,6 @@ int iotcon_remote_resource_get_properties(iotcon_remote_resource_h resource,
  * @retval #IOTCON_ERROR_NONE  Successful
  * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
  * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA No data available
  *
  * @see iotcon_remote_resource_get_uri_path()
  * @see iotcon_remote_resource_get_host_address()
@@ -810,7 +809,6 @@ int iotcon_remote_resource_set_options(iotcon_remote_resource_h resource,
  * @retval #IOTCON_ERROR_NONE  Successful
  * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
  * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA  No data
  */
 int iotcon_remote_resource_get_cached_representation(
                iotcon_remote_resource_h resource,
index 5de2770a96b63312ba11a5087abe69f92c280980..4eb182f123dfd3cd64dc7ac3d525b48af33e1405 100644 (file)
@@ -321,7 +321,6 @@ int iotcon_representation_set_resource_types(iotcon_representation_h repr,
  * @retval #IOTCON_ERROR_NONE  Successful
  * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
  * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA No data available
  */
 int iotcon_representation_get_resource_types(iotcon_representation_h repr,
                iotcon_resource_types_h *types);
@@ -359,7 +358,6 @@ int iotcon_representation_set_resource_interfaces(iotcon_representation_h repr,
  * @retval #IOTCON_ERROR_NONE  Successful
  * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
  * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA No data available
  */
 int iotcon_representation_get_resource_interfaces(iotcon_representation_h repr,
                iotcon_resource_interfaces_h *ifaces);
index a5aa8e9ba8eae5714d8828611a9a1fe719c504e5..bc45f35917ee50ee5eb2284d095e8aa09c269028 100644 (file)
@@ -239,7 +239,6 @@ void iotcon_response_destroy(iotcon_response_h resp);
  * @retval #IOTCON_ERROR_NONE  Successful
  * @retval #IOTCON_ERROR_NOT_SUPPORTED  Not supported
  * @retval #IOTCON_ERROR_INVALID_PARAMETER  Invalid parameter
- * @retval #IOTCON_ERROR_NO_DATA  No data
  *
  * @see iotcon_response_get_representation()
  * @see iotcon_response_get_result()