Commit f2d1d940 authored by Kishen Maloor's avatar Kishen Maloor

Merge branch 'master' into fargo

parents 85f40f1e 29a8f14b
Pipeline #135 passed with stage
in 47 seconds
---
image: gcc
build:
stage: build
before_script:
- apt update && apt -y install make autoconf
script:
- cd port/linux
- make
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
...@@ -32,7 +32,7 @@ Contents ...@@ -32,7 +32,7 @@ Contents
IoTivity-Lite Architecture IoTivity-Lite Architecture
--------------------------------- ---------------------------------
.. image:: IoTivityLite-Arch.png .. image:: Architecture.png
:scale: 100% :scale: 100%
:alt: IoTivity-Lite Architecture :alt: IoTivity-Lite Architecture
:align: center :align: center
......
...@@ -109,6 +109,7 @@ cloud_deregister_on_reset_internal(oc_cloud_context_t *ctx, ...@@ -109,6 +109,7 @@ cloud_deregister_on_reset_internal(oc_cloud_context_t *ctx,
(void)data; (void)data;
cloud_close_endpoint(ctx->cloud_ep); cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t)); memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
cloud_store_initialize(&ctx->store); cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx); cloud_manager_stop(ctx);
ctx->last_error = 0; ctx->last_error = 0;
...@@ -152,6 +153,7 @@ oc_cloud_provision_conf_resource(oc_cloud_context_t *ctx, const char *server, ...@@ -152,6 +153,7 @@ oc_cloud_provision_conf_resource(oc_cloud_context_t *ctx, const char *server,
cloud_close_endpoint(ctx->cloud_ep); cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t)); memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
cloud_store_initialize(&ctx->store); cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx); cloud_manager_stop(ctx);
...@@ -183,6 +185,7 @@ cloud_update_by_resource(oc_cloud_context_t *ctx, ...@@ -183,6 +185,7 @@ cloud_update_by_resource(oc_cloud_context_t *ctx,
{ {
cloud_close_endpoint(ctx->cloud_ep); cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t)); memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
cloud_store_initialize(&ctx->store); cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx); cloud_manager_stop(ctx);
if (data->auth_provider && data->auth_provider_len) { if (data->auth_provider && data->auth_provider_len) {
...@@ -311,6 +314,7 @@ oc_cloud_manager_stop(oc_cloud_context_t *ctx) ...@@ -311,6 +314,7 @@ oc_cloud_manager_stop(oc_cloud_context_t *ctx)
cloud_store_initialize(&ctx->store); cloud_store_initialize(&ctx->store);
cloud_close_endpoint(ctx->cloud_ep); cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t)); memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
ctx->cloud_manager = false; ctx->cloud_manager = false;
return 0; return 0;
} }
......
...@@ -163,6 +163,7 @@ _register_handler(oc_cloud_context_t *ctx, oc_client_response_t *data) ...@@ -163,6 +163,7 @@ _register_handler(oc_cloud_context_t *ctx, oc_client_response_t *data)
strcmp(ci_server, value)) { strcmp(ci_server, value)) {
cloud_close_endpoint(ctx->cloud_ep); cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t)); memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
} }
cloud_set_string(&ctx->store.ci_server, value, size); cloud_set_string(&ctx->store.ci_server, value, size);
} }
......
...@@ -130,6 +130,13 @@ oc_delete_link(oc_link_t *link) ...@@ -130,6 +130,13 @@ oc_delete_link(oc_link_t *link)
} }
} }
static oc_event_callback_retval_t
links_list_notify_collection(void *data)
{
coap_notify_links_list(data);
return OC_EVENT_DONE;
}
void void
oc_collection_add_link(oc_resource_t *collection, oc_link_t *link) oc_collection_add_link(oc_resource_t *collection, oc_link_t *link)
{ {
...@@ -138,6 +145,7 @@ oc_collection_add_link(oc_resource_t *collection, oc_link_t *link) ...@@ -138,6 +145,7 @@ oc_collection_add_link(oc_resource_t *collection, oc_link_t *link)
if (link->resource == collection) { if (link->resource == collection) {
oc_string_array_add_item(link->rel, "self"); oc_string_array_add_item(link->rel, "self");
} }
oc_set_delayed_callback(collection, links_list_notify_collection, 0);
} }
void void
...@@ -146,6 +154,7 @@ oc_collection_remove_link(oc_resource_t *collection, oc_link_t *link) ...@@ -146,6 +154,7 @@ oc_collection_remove_link(oc_resource_t *collection, oc_link_t *link)
if (collection && link) { if (collection && link) {
oc_collection_t *c = (oc_collection_t *)collection; oc_collection_t *c = (oc_collection_t *)collection;
oc_list_remove(c->links, link); oc_list_remove(c->links, link);
oc_set_delayed_callback(collection, links_list_notify_collection, 0);
} }
} }
...@@ -377,7 +386,7 @@ oc_get_next_collection_with_link(oc_resource_t *resource, ...@@ -377,7 +386,7 @@ oc_get_next_collection_with_link(oc_resource_t *resource,
} }
static oc_event_callback_retval_t static oc_event_callback_retval_t
notify_collection_for_link(void *data) batch_notify_collection_for_link(void *data)
{ {
coap_notify_observers(data, NULL, NULL); coap_notify_observers(data, NULL, NULL);
return OC_EVENT_DONE; return OC_EVENT_DONE;
...@@ -896,7 +905,7 @@ oc_handle_collection_request(oc_method_t method, oc_request_t *request, ...@@ -896,7 +905,7 @@ oc_handle_collection_request(oc_method_t method, oc_request_t *request,
response_buffer.code < response_buffer.code <
oc_status_code(OC_STATUS_BAD_REQUEST)) { oc_status_code(OC_STATUS_BAD_REQUEST)) {
oc_set_delayed_callback(link->resource, oc_set_delayed_callback(link->resource,
notify_collection_for_link, 0); batch_notify_collection_for_link, 0);
} }
if (response_buffer.code < if (response_buffer.code <
oc_status_code(OC_STATUS_BAD_REQUEST)) { oc_status_code(OC_STATUS_BAD_REQUEST)) {
......
...@@ -597,13 +597,13 @@ oc_core_get_resource_by_uri(const char *uri, size_t device) ...@@ -597,13 +597,13 @@ oc_core_get_resource_by_uri(const char *uri, size_t device)
} else if (memcmp(uri + skip, "oic/sec/cred", 12) == 0) { } else if (memcmp(uri + skip, "oic/sec/cred", 12) == 0) {
type = OCF_SEC_CRED; type = OCF_SEC_CRED;
} }
} else if ((strlen(uri) - skip) == 10 &&
memcmp(uri + skip, "oic/sec/sp", 10) == 0) {
type = OCF_SEC_SP;
} }
#ifdef OC_PKI #ifdef OC_PKI
else if ((strlen(uri) - skip) == 10 && else if ((strlen(uri) - skip) == 11 &&
memcmp(uri + skip, "oic/sec/sp", 10) == 0) { memcmp(uri + skip, "oic/sec/csr", 11) == 0) {
type = OCF_SEC_SP;
} else if ((strlen(uri) - skip) == 11 &&
memcmp(uri + skip, "oic/sec/csr", 11) == 0) {
type = OCF_SEC_CSR; type = OCF_SEC_CSR;
} else if ((strlen(uri) - skip) == 13 && } else if ((strlen(uri) - skip) == 13 &&
memcmp(uri + skip, "oic/sec/roles", 13) == 0) { memcmp(uri + skip, "oic/sec/roles", 13) == 0) {
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
static bool static bool
filter_resource(oc_resource_t *resource, oc_request_t *request, filter_resource(oc_resource_t *resource, oc_request_t *request,
const char *anchor, CborEncoder *links) const char *anchor, CborEncoder *links, size_t device_index)
{ {
if (!oc_filter_resource_by_rt(resource, request)) { if (!oc_filter_resource_by_rt(resource, request)) {
return false; return false;
...@@ -73,7 +73,7 @@ filter_resource(oc_resource_t *resource, oc_request_t *request, ...@@ -73,7 +73,7 @@ filter_resource(oc_resource_t *resource, oc_request_t *request,
// eps // eps
oc_rep_set_array(link, eps); oc_rep_set_array(link, eps);
oc_endpoint_t *eps = oc_connectivity_get_endpoints(resource->device); oc_endpoint_t *eps = oc_connectivity_get_endpoints(device_index);
while (eps != NULL) { while (eps != NULL) {
/* If this resource has been explicitly tagged as SECURE on the /* If this resource has been explicitly tagged as SECURE on the
* application layer, skip all coap:// endpoints, and only include * application layer, skip all coap:// endpoints, and only include
...@@ -147,64 +147,64 @@ process_device_resources(CborEncoder *links, oc_request_t *request, ...@@ -147,64 +147,64 @@ process_device_resources(CborEncoder *links, oc_request_t *request,
oc_concat_strings(&anchor, "ocf://", uuid); oc_concat_strings(&anchor, "ocf://", uuid);
if (filter_resource(oc_core_get_resource_by_index(OCF_P, 0), request, if (filter_resource(oc_core_get_resource_by_index(OCF_P, 0), request,
oc_string(anchor), links)) oc_string(anchor), links, device_index))
matches++; matches++;
if (filter_resource(oc_core_get_resource_by_index(OCF_D, device_index), if (filter_resource(oc_core_get_resource_by_index(OCF_D, device_index),
request, oc_string(anchor), links)) request, oc_string(anchor), links, device_index))
matches++; matches++;
if (filter_resource( if (filter_resource(
oc_core_get_resource_by_index(OCF_INTROSPECTION_WK, device_index), oc_core_get_resource_by_index(OCF_INTROSPECTION_WK, device_index),
request, oc_string(anchor), links)) request, oc_string(anchor), links, device_index))
matches++; matches++;
if (oc_get_con_res_announced() && if (oc_get_con_res_announced() &&
filter_resource(oc_core_get_resource_by_index(OCF_CON, device_index), filter_resource(oc_core_get_resource_by_index(OCF_CON, device_index),
request, oc_string(anchor), links)) request, oc_string(anchor), links, device_index))
matches++; matches++;
#ifdef OC_MNT #ifdef OC_MNT
if (filter_resource(oc_core_get_resource_by_index(OCF_MNT, device_index), if (filter_resource(oc_core_get_resource_by_index(OCF_MNT, device_index),
request, oc_string(anchor), links)) request, oc_string(anchor), links, device_index))
matches++; matches++;
#endif /* OC_MNT */ #endif /* OC_MNT */
#ifdef OC_SOFTWARE_UPDATE #ifdef OC_SOFTWARE_UPDATE
if (filter_resource( if (filter_resource(
oc_core_get_resource_by_index(OCF_SW_UPDATE, device_index), request, oc_core_get_resource_by_index(OCF_SW_UPDATE, device_index), request,
oc_string(anchor), links)) oc_string(anchor), links, device_index))
matches++; matches++;
#endif /* OC_SOFTWARE_UPDATE */ #endif /* OC_SOFTWARE_UPDATE */
#ifdef OC_SECURITY #ifdef OC_SECURITY
if (filter_resource(oc_core_get_resource_by_index(OCF_SEC_DOXM, device_index), if (filter_resource(oc_core_get_resource_by_index(OCF_SEC_DOXM, device_index),
request, oc_string(anchor), links)) request, oc_string(anchor), links, device_index))
matches++; matches++;
if (filter_resource( if (filter_resource(
oc_core_get_resource_by_index(OCF_SEC_PSTAT, device_index), request, oc_core_get_resource_by_index(OCF_SEC_PSTAT, device_index), request,
oc_string(anchor), links)) oc_string(anchor), links, device_index))
matches++; matches++;
if (filter_resource(oc_core_get_resource_by_index(OCF_SEC_ACL, device_index), if (filter_resource(oc_core_get_resource_by_index(OCF_SEC_ACL, device_index),
request, oc_string(anchor), links)) request, oc_string(anchor), links, device_index))
matches++; matches++;
if (filter_resource(oc_core_get_resource_by_index(OCF_SEC_CRED, device_index), if (filter_resource(oc_core_get_resource_by_index(OCF_SEC_CRED, device_index),
request, oc_string(anchor), links)) request, oc_string(anchor), links, device_index))
matches++; matches++;
#ifdef OC_PKI
if (filter_resource(oc_core_get_resource_by_index(OCF_SEC_SP, device_index), if (filter_resource(oc_core_get_resource_by_index(OCF_SEC_SP, device_index),
request, oc_string(anchor), links)) request, oc_string(anchor), links, device_index))
matches++; matches++;
#ifdef OC_PKI
if (filter_resource(oc_core_get_resource_by_index(OCF_SEC_CSR, device_index), if (filter_resource(oc_core_get_resource_by_index(OCF_SEC_CSR, device_index),
request, oc_string(anchor), links)) request, oc_string(anchor), links, device_index))
matches++; matches++;
if (filter_resource( if (filter_resource(
oc_core_get_resource_by_index(OCF_SEC_ROLES, device_index), request, oc_core_get_resource_by_index(OCF_SEC_ROLES, device_index), request,
oc_string(anchor), links)) oc_string(anchor), links, device_index))
matches++; matches++;
#endif /* OC_PKI */ #endif /* OC_PKI */
#endif /* OC_SECURITY */ #endif /* OC_SECURITY */
...@@ -212,7 +212,7 @@ process_device_resources(CborEncoder *links, oc_request_t *request, ...@@ -212,7 +212,7 @@ process_device_resources(CborEncoder *links, oc_request_t *request,
#if defined(OC_CLIENT) && defined(OC_SERVER) && defined(OC_CLOUD) #if defined(OC_CLIENT) && defined(OC_SERVER) && defined(OC_CLOUD)
if (filter_resource( if (filter_resource(
oc_core_get_resource_by_index(OCF_COAPCLOUDCONF, device_index), request, oc_core_get_resource_by_index(OCF_COAPCLOUDCONF, device_index), request,
oc_string(anchor), links)) oc_string(anchor), links, device_index))
matches++; matches++;
#endif /* OC_CLIENT && OC_SERVER && OC_CLOUD */ #endif /* OC_CLIENT && OC_SERVER && OC_CLOUD */
...@@ -223,7 +223,8 @@ process_device_resources(CborEncoder *links, oc_request_t *request, ...@@ -223,7 +223,8 @@ process_device_resources(CborEncoder *links, oc_request_t *request,
!(resource->properties & OC_DISCOVERABLE)) !(resource->properties & OC_DISCOVERABLE))
continue; continue;
if (filter_resource(resource, request, oc_string(anchor), links)) if (filter_resource(resource, request, oc_string(anchor), links,
device_index))
matches++; matches++;
} }
...@@ -235,7 +236,7 @@ process_device_resources(CborEncoder *links, oc_request_t *request, ...@@ -235,7 +236,7 @@ process_device_resources(CborEncoder *links, oc_request_t *request,
continue; continue;
if (filter_resource((oc_resource_t *)collection, request, oc_string(anchor), if (filter_resource((oc_resource_t *)collection, request, oc_string(anchor),
links)) links, device_index))
matches++; matches++;
} }
#endif /* OC_COLLECTIONS */ #endif /* OC_COLLECTIONS */
...@@ -417,11 +418,11 @@ process_oic_1_1_device_object(CborEncoder *device, oc_request_t *request, ...@@ -417,11 +418,11 @@ process_oic_1_1_device_object(CborEncoder *device, oc_request_t *request,
oc_rep_array(links))) oc_rep_array(links)))
matches++; matches++;
#ifdef OC_PKI
if (filter_oic_1_1_resource( if (filter_oic_1_1_resource(
oc_core_get_resource_by_index(OCF_SEC_SP, device_num), request, oc_core_get_resource_by_index(OCF_SEC_SP, device_num), request,
oc_rep_array(links))) oc_rep_array(links)))
matches++; matches++;
#ifdef OC_PKI
if (filter_oic_1_1_resource( if (filter_oic_1_1_resource(
oc_core_get_resource_by_index(OCF_SEC_CSR, device_num), request, oc_core_get_resource_by_index(OCF_SEC_CSR, device_num), request,
oc_rep_array(links))) oc_rep_array(links)))
......
...@@ -383,8 +383,8 @@ oc_parse_endpoint_string(oc_string_t *endpoint_str, oc_endpoint_t *endpoint, ...@@ -383,8 +383,8 @@ oc_parse_endpoint_string(oc_string_t *endpoint_str, oc_endpoint_t *endpoint,
/* Extract a uri path if requested and available */ /* Extract a uri path if requested and available */
const char *u = NULL; const char *u = NULL;
u = memchr(address, '/', len);
if (uri) { if (uri) {
u = memchr(address, '/', len);
if (u) { if (u) {
oc_new_string(uri, u, (len - (u - address))); oc_new_string(uri, u, (len - (u - address)));
} }
......
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
#include "security/oc_store.h" #include "security/oc_store.h"
#include "security/oc_svr.h" #include "security/oc_svr.h"
#include "security/oc_tls.h" #include "security/oc_tls.h"
#include "security/oc_sp.h"
#ifdef OC_PKI #ifdef OC_PKI
#include "security/oc_keypair.h" #include "security/oc_keypair.h"
#include "security/oc_sp.h"
#endif /* OC_PKI */ #endif /* OC_PKI */
#endif /* OC_SECURITY */ #endif /* OC_SECURITY */
...@@ -237,8 +237,8 @@ oc_main_init(const oc_handler_t *handler) ...@@ -237,8 +237,8 @@ oc_main_init(const oc_handler_t *handler)
oc_sec_load_doxm(device); oc_sec_load_doxm(device);
oc_sec_load_cred(device); oc_sec_load_cred(device);
oc_sec_load_acl(device); oc_sec_load_acl(device);
#ifdef OC_PKI
oc_sec_load_sp(device); oc_sec_load_sp(device);
#ifdef OC_PKI
oc_sec_load_ecdsa_keypair(device); oc_sec_load_ecdsa_keypair(device);
#endif /* OC_PKI */ #endif /* OC_PKI */
} }
...@@ -293,8 +293,8 @@ oc_main_shutdown(void) ...@@ -293,8 +293,8 @@ oc_main_shutdown(void)
oc_sec_cred_free(); oc_sec_cred_free();
oc_sec_doxm_free(); oc_sec_doxm_free();
oc_sec_pstat_free(); oc_sec_pstat_free();
#ifdef OC_PKI
oc_sec_sp_free(); oc_sec_sp_free();
#ifdef OC_PKI
oc_free_ecdsa_keypairs(); oc_free_ecdsa_keypairs();
#endif /* OC_PKI */ #endif /* OC_PKI */
oc_tls_shutdown(); oc_tls_shutdown();
......
...@@ -154,5 +154,21 @@ TEST(OCEndpoints, StringToEndpoint) ...@@ -154,5 +154,21 @@ TEST(OCEndpoints, StringToEndpoint)
oc_free_string(&s); oc_free_string(&s);
oc_free_string(&uri); oc_free_string(&uri);
} }
// test dns lookup when uri is NULL
const char *spu3[4] = { "coap://10.211.55.3:56789/a/light",
"coaps+tcp://10.211.55.3/a/light",
"coap://openconnectivity.org/alpha",
"coaps://openconnectivity.org:3456/alpha" };
for (int i = 0; i < 4; i++) {
oc_string_t s;
oc_new_string(&s, spu3[i], strlen(spu[i]));
oc_endpoint_t ep;
memset(&ep, 0, sizeof(oc_endpoint_t));
int ret = oc_string_to_endpoint(&s, &ep, NULL);
EXPECT_EQ(ret, 0) << "spu3[" << i << "] " << spu3[i];
}
#endif #endif
} }
...@@ -150,6 +150,32 @@ typedef struct ...@@ -150,6 +150,32 @@ typedef struct
} oc_handler_t; } oc_handler_t;
typedef void (*oc_init_platform_cb_t)(void *data); typedef void (*oc_init_platform_cb_t)(void *data);
/**
* Callback invoked during oc_add_device(). The purpose is to add any additional
* device properties that are not supplied to oc_add_device() function call.
*
* Example:
* ```
* static void set_device_custom_property(void *data)
* {
* (void)data;
* oc_set_custom_device_property(purpose, "desk lamp");
* }
*
* static int app_init(void)
* {
* int ret = oc_init_platform("My Platform", NULL, NULL);
* ret |= oc_add_device("/oic/d", "oic.d.light", "My light", "ocf.1.0.0",
* "ocf.res.1.0.0", set_device_custom_property, NULL);
* return ret;
* }
* ```
*
* @param data context pointer that comes from the oc_add_device() function
*
* @see oc_add_device
* @see oc_set_custom_device_property
*/
typedef void (*oc_add_device_cb_t)(void *data); typedef void (*oc_add_device_cb_t)(void *data);
/** /**
...@@ -183,11 +209,62 @@ typedef void (*oc_add_device_cb_t)(void *data); ...@@ -183,11 +209,62 @@ typedef void (*oc_add_device_cb_t)(void *data);
*/ */
int oc_main_init(const oc_handler_t *handler); int oc_main_init(const oc_handler_t *handler);
oc_clock_time_t oc_main_poll(void); oc_clock_time_t oc_main_poll(void);
/**
* Shutdown and free all stack related resources
*/
void oc_main_shutdown(void); void oc_main_shutdown(void);
typedef void (*oc_factory_presets_cb_t)(size_t device, void *data); typedef void (*oc_factory_presets_cb_t)(size_t device, void *data);
void oc_set_factory_presets_cb(oc_factory_presets_cb_t cb, void *data); void oc_set_factory_presets_cb(oc_factory_presets_cb_t cb, void *data);
/**
* Add an ocf device to the the stack.
*
* This function is typically called from as part of the stack initialization
* process inside the `init` callback handler.
*
* The `oc_add_device` function may be called as many times as needed.
* Each call will add a new device to the stack with its own port address.
* Each device is automatically assigned a number starting with zero and
* incremented by one each time the function is called. This number is not
* returned therefore it is important to know the order devices are added.
*
* Example:
* ```
* //app_init is an instance of the `init` callback handler.
* static int app_init(void)
* {
* int ret = oc_init_platform("Refrigerator", NULL, NULL);
* ret |= oc_add_device("/oic/d", "oic.d.refrigeration", "My fridge",
* "ocf.2.0.5", "ocf.res.1.0.0,ocf.sh.1.0.0",
* NULL, NULL);
* ret |= oc_add_device("/oic/d", "oic.d.thermostat", "My thermostat",
* "ocf.2.0.5", "ocf.res.1.0.0,ocf.sh.1.0.0",
* NULL, NULL);
* return ret;
* }
* ```
*
* @param uri the The device URI. The wellknown default URI "/oic/d" is hosted
* by every server. Used to device specific information.
* @param rt the resource type
* @param name the user readable name of the device
* @param spec_version The version of the OCF Server. This is the "icv" device
* property
* @param data_model_version Spec version of the resource and device
* specifications to which this device data model is implemtned. This is the
* "dmv" device property
* @param add_device_cb callback function that will be invoked once device has
* been added
* @param data context pointer that is passed to the oc_add_device_cb_t
*
* @return
* - `0` on success
* - `-1` on failure
*
* @see init
*/
int oc_add_device(const char *uri, const char *rt, const char *name, int oc_add_device(const char *uri, const char *rt, const char *name,
const char *spec_version, const char *data_model_version, const char *spec_version, const char *data_model_version,
oc_add_device_cb_t add_device_cb, void *data); oc_add_device_cb_t add_device_cb, void *data);
......
...@@ -109,8 +109,8 @@ typedef enum { ...@@ -109,8 +109,8 @@ typedef enum {
OCF_SEC_PSTAT, OCF_SEC_PSTAT,
OCF_SEC_ACL, OCF_SEC_ACL,
OCF_SEC_CRED, OCF_SEC_CRED,
#ifdef OC_PKI
OCF_SEC_SP, OCF_SEC_SP,
#ifdef OC_PKI
OCF_SEC_CSR, OCF_SEC_CSR,
OCF_SEC_ROLES, OCF_SEC_ROLES,
#endif /* OC_PKI */ #endif /* OC_PKI */
......
...@@ -77,7 +77,7 @@ extern bool oc_ri_invoke_coap_entity_handler( ...@@ -77,7 +77,7 @@ extern bool oc_ri_invoke_coap_entity_handler(
void *request, void *response, oc_blockwise_state_t **request_state, void *request, void *response, oc_blockwise_state_t **request_state,
oc_blockwise_state_t **response_state, uint16_t block2_size, oc_blockwise_state_t **response_state, uint16_t block2_size,
oc_endpoint_t *endpoint); oc_endpoint_t *endpoint);
#else /* OC_BLOCK_WISE */ #else /* OC_BLOCK_WISE */
extern bool oc_ri_invoke_coap_entity_handler(void *request, void *response, extern bool oc_ri_invoke_coap_entity_handler(void *request, void *response,
uint8_t *buffer, uint8_t *buffer,
oc_endpoint_t *endpoint); oc_endpoint_t *endpoint);
...@@ -236,7 +236,8 @@ coap_receive(oc_message_t *msg) ...@@ -236,7 +236,8 @@ coap_receive(oc_message_t *msg)
OC_DBG(" QUERY: %.*s", (int)message->uri_query_len, message->uri_query); OC_DBG(" QUERY: %.*s", (int)message->uri_query_len, message->uri_query);
OC_DBG(" Payload: %.*s", (int)message->payload_len, message->payload);