Allow retrieve of Collection links over oic.if.b
@@ -870,6 +870,13 @@ oc_handle_collection_request(oc_method_t method, oc_request_t *request,
} else
#endif /* OC_SECURITY */
{
+ if ((link->resource != (oc_resource_t *)collection) &&
+ oc_check_if_collection(link->resource)) {
+ request->resource = link->resource;
+ oc_handle_collection_request(
+ method, request, link->resource->default_interface, NULL);
+ request->resource = (oc_resource_t *)collection;
+ } else {
oc_interface_mask_t req_iface =
link->resource->default_interface;
if (link->resource == (oc_resource_t *)collection) {
@@ -910,7 +917,7 @@ oc_handle_collection_request(oc_method_t method, oc_request_t *request,
break;
}
}
-
+ }
if (method_not_found) {
ecode = oc_status_code(OC_STATUS_METHOD_NOT_ALLOWED);
memcpy(&links_array, &prev_link, sizeof(CborEncoder));
