Skip to content

Commit

Permalink
Update oc_ri API
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielius1922 committed Sep 29, 2024
1 parent b28a73a commit 66ff75f
Show file tree
Hide file tree
Showing 8 changed files with 665 additions and 639 deletions.
1 change: 1 addition & 0 deletions api/cloud/unittest/cloud_store_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "api/cloud/oc_cloud_resource_internal.h"
#include "api/cloud/oc_cloud_store_internal.h"
#include "api/oc_event_callback_internal.h"
#include "api/oc_rep_internal.h"
#include "api/oc_storage_internal.h"
#include "oc_api.h"
#include "oc_config.h"
Expand Down
1 change: 1 addition & 0 deletions api/oc_collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "api/oc_link_internal.h"
#include "api/oc_resource_internal.h"
#include "api/oc_ri_internal.h"
#include "api/oc_ri_server_internal.h"
#include "messaging/coap/observe_internal.h"
#include "oc_api.h"
#include "oc_core_res.h"
Expand Down
6 changes: 4 additions & 2 deletions api/oc_discovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ oc_wkcore_discovery_handler(oc_request_t *request,
}
}

if (rt_request != 0 && rt_device != 0 &&
if (rt_request != 0 && rt_device != NULL &&
strncmp(rt_request, rt_device, rt_len) == 0) {
/* request for specific device type */
matches = 1;
Expand Down Expand Up @@ -1273,7 +1273,9 @@ oc_wkcore_discovery_handler(oc_request_t *request,

length += clf_add_line_to_buffer("/oic/res>;");
length += clf_add_line_to_buffer("rt=\"oic.wk.res ");
length += clf_add_str_to_buffer(rt_device, rt_devlen);
if (rt_device != NULL) {
length += clf_add_str_to_buffer(rt_device, rt_devlen);
}
length += clf_add_line_to_buffer("\";");
length +=
clf_add_line_to_buffer("if=\"oic.if.ll oic.if.baseline\";ct=10000");
Expand Down
Loading

0 comments on commit 66ff75f

Please sign in to comment.