Commit 369141a4 authored by Kishen Maloor's avatar Kishen Maloor

oc_collection:exclude rts/rts-m unless defined

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent bb53715d
Pipeline #1040 passed with stage
in 12 minutes and 9 seconds
......@@ -577,6 +577,7 @@ oc_handle_collection_request(oc_method_t method, oc_request_t *request,
oc_rep_start_root_object();
oc_process_baseline_interface(request->resource);
/* rts */
if (oc_list_length(collection->supported_rts) > 0) {
oc_rep_open_array(root, rts);
oc_rt_t *rtt = (oc_rt_t *)oc_list_head(collection->supported_rts);
while (rtt) {
......@@ -584,7 +585,9 @@ oc_handle_collection_request(oc_method_t method, oc_request_t *request,
rtt = rtt->next;
}
oc_rep_close_array(root, rts);
}
/* rts-m */
if (oc_list_length(collection->mandatory_rts) > 0) {
const char *rtsm_key = "rts-m";
oc_rep_set_key(oc_rep_object(root), rtsm_key);
oc_rep_start_array(oc_rep_object(root), rtsm);
......@@ -594,6 +597,7 @@ oc_handle_collection_request(oc_method_t method, oc_request_t *request,
rtt = rtt->next;
}
oc_rep_end_array(oc_rep_object(root), rtsm);
}
oc_rep_set_array(root, links);
while (link != NULL) {
if (oc_filter_resource_by_rt(link->resource, request)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment