Commit f4ae603d authored by Kishen Maloor's avatar Kishen Maloor

Merge branch 'origin/master' into fargo

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parents 89a79af8 9f66512d
Pipeline #794 passed with stage
in 14 minutes and 44 seconds
......@@ -52,17 +52,13 @@ Android_build:
- cd port/android
- make DYNAMIC=1 TCP=1 IPV4=1 SECURE=1 PKI=1 CLOUD=1 JAVA=1 DEBUG=0
whitespace_and_doxygen:
doxygen:
variables:
GIT_SUBMODULE_STRATEGY: none
stage: build
before_script:
- apt update && apt -y install make autoconf doxygen clang-format
- apt update && apt -y install doxygen
script:
- clang-format --version
- doxygen --version
- cp tools/_clang-format _clang-format
- cp tools/whitespace_commit_checker.sh whitespace_commit_checker.sh
- ./whitespace_commit_checker.sh
- cd tools
- ./build_doc.sh
......@@ -113,7 +113,7 @@ cloud_deregister_on_reset_internal(oc_cloud_context_t *ctx,
cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx);
ctx->last_error = 0;
ctx->cps = 0;
ctx->store.cps = 0;
}
#endif /* OC_SECURITY */
......@@ -137,7 +137,7 @@ oc_cloud_reset_context(size_t device)
cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx);
ctx->last_error = 0;
ctx->cps = 0;
ctx->store.cps = 0;
return 0;
}
......@@ -168,7 +168,7 @@ oc_cloud_provision_conf_resource(oc_cloud_context_t *ctx, const char *server,
}
ctx->store.status = OC_CLOUD_INITIALIZED;
ctx->cps = OC_CPS_READYTOREGISTER;
ctx->store.cps = OC_CPS_READYTOREGISTER;
cloud_store_dump_async(&ctx->store);
......@@ -204,7 +204,7 @@ cloud_update_by_resource(oc_cloud_context_t *ctx,
cloud_set_string(&ctx->store.sid, data->sid, data->sid_len);
}
ctx->store.status = OC_CLOUD_INITIALIZED;
ctx->cps = OC_CPS_READYTOREGISTER;
ctx->store.cps = OC_CPS_READYTOREGISTER;
if (ctx->cloud_manager) {
cloud_reconnect(ctx);
}
......
......@@ -109,7 +109,7 @@ oc_cloud_register(oc_cloud_context_t *ctx, oc_cloud_cb_t cb, void *data)
oc_string(ctx->store.uid), oc_string(ctx->store.access_token),
ctx->device, oc_cloud_register_handler, p)) {
cannotConnect = false;
ctx->cps = OC_CPS_REGISTERING;
ctx->store.cps = OC_CPS_REGISTERING;
}
if (cannotConnect) {
cloud_set_last_error(ctx, CLOUD_ERROR_CONNECT);
......@@ -231,17 +231,15 @@ cloud_deregistered_internal(oc_client_response_t *data)
{
cloud_api_param_t *p = (cloud_api_param_t *)data->user_data;
oc_cloud_context_t *ctx = p->ctx;
if (data->code >= OC_STATUS_SERVICE_UNAVAILABLE) {
cloud_set_last_error(ctx, CLOUD_ERROR_CONNECT);
ctx->store.status |= OC_CLOUD_FAILURE;
if (data->code < OC_STATUS_BAD_REQUEST ||
data->code >= OC_STATUS_SERVICE_UNAVAILABLE) {
ctx->store.status = OC_CLOUD_DEREGISTERED;
} else if (data->code >= OC_STATUS_BAD_REQUEST) {
cloud_set_last_error(ctx, CLOUD_ERROR_RESPONSE);
ctx->store.status |= OC_CLOUD_FAILURE;
} else {
ctx->store.status = OC_CLOUD_DEREGISTERED;
}
ctx->cps = OC_CPS_READYTOREGISTER;
ctx->store.cps = OC_CPS_READYTOREGISTER;
if (p->cb) {
p->cb(ctx, ctx->store.status, p->data);
......@@ -249,6 +247,8 @@ cloud_deregistered_internal(oc_client_response_t *data)
free_api_param(p);
ctx->store.status &= ~(OC_CLOUD_FAILURE | OC_CLOUD_DEREGISTERED);
cloud_store_dump_async(&ctx->store);
}
int
......@@ -362,7 +362,9 @@ cloud_access_register(oc_endpoint_t *endpoint, const char *auth_provider,
}
#ifdef OC_SECURITY
oc_tls_select_cloud_ciphersuite();
if (!oc_tls_connected(endpoint)) {
oc_tls_select_cloud_ciphersuite();
}
#endif /* OC_SECURITY */
if (oc_init_post(OC_RSRVD_ACCOUNT_URI, endpoint, NULL, handler, LOW_QOS,
......@@ -407,23 +409,32 @@ cloud_access_deregister(oc_endpoint_t *endpoint, const char *uid,
OC_ERR("Error of input parameters");
return false;
}
oc_string_t d;
(void)device;
oc_string_t at_uid;
oc_string_t at;
oc_concat_strings(&at, "accesstoken=", access_token);
oc_string_t u_id;
oc_concat_strings(&u_id, "&uid=", uid);
oc_concat_strings(&d, oc_string(at), oc_string(u_id));
oc_concat_strings(&at_uid, oc_string(at), oc_string(u_id));
char uuid[OC_UUID_LEN] = { 0 };
oc_uuid_to_str(oc_core_get_device_id(device), uuid, OC_UUID_LEN);
oc_string_t di;
oc_concat_strings(&di, "&di=", uuid);
oc_string_t at_uid_di;
oc_concat_strings(&at_uid_di, oc_string(at_uid), oc_string(di));
#ifdef OC_SECURITY
oc_tls_select_cloud_ciphersuite();
if (!oc_tls_connected(endpoint)) {
oc_tls_select_cloud_ciphersuite();
}
#endif /* OC_SECURITY */
bool s = oc_do_delete(OC_RSRVD_ACCOUNT_URI, endpoint, oc_string(d), handler,
HIGH_QOS, user_data);
oc_free_string(&d);
bool s = oc_do_delete(OC_RSRVD_ACCOUNT_URI, endpoint, oc_string(at_uid_di),
handler, HIGH_QOS, user_data);
oc_free_string(&at_uid);
oc_free_string(&at);
oc_free_string(&u_id);
oc_free_string(&di);
oc_free_string(&at_uid_di);
return s;
}
......@@ -445,7 +456,9 @@ cloud_access_login_out(oc_endpoint_t *endpoint, const char *uid,
}
#ifdef OC_SECURITY
oc_tls_select_cloud_ciphersuite();
if (!oc_tls_connected(endpoint)) {
oc_tls_select_cloud_ciphersuite();
}
#endif /* OC_SECURITY */
if (oc_init_post(OC_RSRVD_ACCOUNT_SESSION_URI, endpoint, NULL, handler,
......@@ -504,7 +517,9 @@ cloud_access_refresh_access_token(oc_endpoint_t *endpoint, const char *uid,
}
#ifdef OC_SECURITY
oc_tls_select_cloud_ciphersuite();
if (!oc_tls_connected(endpoint)) {
oc_tls_select_cloud_ciphersuite();
}
#endif /* OC_SECURITY */
if (oc_init_post(OC_RSRVD_ACCOUNT_TOKEN_REFRESH_URI, endpoint, NULL, handler,
......
......@@ -146,8 +146,6 @@ _register_handler(oc_cloud_context_t *ctx, oc_client_response_t *data)
oc_rep_t *payload = data->payload;
ctx->store.status = 0;
char *value = NULL;
size_t size = 0;
......@@ -195,12 +193,14 @@ _register_handler(oc_cloud_context_t *ctx, oc_client_response_t *data)
cloud_set_last_error(ctx, CLOUD_OK);
ctx->store.status |= OC_CLOUD_REGISTERED;
ctx->cps = OC_CPS_REGISTERED;
ctx->store.cps = OC_CPS_REGISTERED;
oc_notify_observers(ctx->cloud_conf);
return 0;
error:
ctx->cps = OC_CPS_FAILED;
ctx->store.cps = OC_CPS_FAILED;
ctx->store.status |= OC_CLOUD_FAILURE;
if (ctx->last_error == 0) {
cloud_set_last_error(ctx, CLOUD_ERROR_RESPONSE);
......@@ -259,7 +259,7 @@ cloud_register(void *data)
oc_string(ctx->store.uid), oc_string(ctx->store.access_token),
ctx->device, cloud_register_handler, data)) {
cannotConnect = false;
ctx->cps = OC_CPS_REGISTERING;
ctx->store.cps = OC_CPS_REGISTERING;
}
if (cannotConnect) {
cloud_set_last_error(ctx, CLOUD_ERROR_CONNECT);
......@@ -297,7 +297,7 @@ _login_handler(oc_cloud_context_t *ctx, oc_client_response_t *data)
return 0;
error:
ctx->cps = OC_CPS_FAILED;
ctx->store.cps = OC_CPS_FAILED;
ctx->store.status |= OC_CLOUD_FAILURE;
if (ctx->last_error == 0) {
cloud_set_last_error(ctx, CLOUD_ERROR_RESPONSE);
......@@ -430,7 +430,7 @@ error:
if (ctx->last_error == 0) {
cloud_set_last_error(ctx, CLOUD_ERROR_REFRESH_ACCESS_TOKEN);
}
ctx->cps = OC_CPS_FAILED;
ctx->store.cps = OC_CPS_FAILED;
ctx->store.status |= OC_CLOUD_FAILURE;
return -1;
}
......
......@@ -66,7 +66,7 @@ cloud_response(oc_cloud_context_t *ctx)
root, sid, (oc_string(ctx->store.sid) ? oc_string(ctx->store.sid) : ""));
oc_rep_set_int(root, clec, (int)ctx->last_error);
const char *cps = cps_to_str(ctx->cps);
const char *cps = cps_to_str(ctx->store.cps);
if (cps) {
oc_rep_set_text_string(root, cps, cps);
}
......@@ -145,7 +145,7 @@ post_cloud(oc_request_t *request, oc_interface_mask_t interface,
OC_DBG("POST request received");
(void)interface;
switch (ctx->cps) {
switch (ctx->store.cps) {
case OC_CPS_UNINITIALIZED:
case OC_CPS_READYTOREGISTER:
case OC_CPS_FAILED:
......
......@@ -64,10 +64,12 @@ encode_cloud_with_map(CborEncoder *object_map, const oc_cloud_store_t *store)
oc_rep_set_text_string(*object, auth_provider,
oc_string(store->auth_provider));
oc_rep_set_text_string(*object, uid, oc_string(store->uid));
oc_rep_set_text_string(*object, sid, oc_string(store->sid));
oc_rep_set_text_string(*object, access_token, oc_string(store->access_token));
oc_rep_set_text_string(*object, refresh_token,
oc_string(store->refresh_token));
oc_rep_set_int(*object, status, store->status);
oc_rep_set_int(*object, cps, store->cps);
}
static void
......@@ -145,6 +147,9 @@ cloud_store_decode(oc_rep_t *rep, oc_cloud_store_t *store)
if (len == 9 && memcmp(oc_string(t->name), "ci_server", 9) == 0) {
cloud_set_string(&store->ci_server, oc_string(t->value.string),
oc_string_len(t->value.string));
} else if (len == 3 && memcmp(oc_string(t->name), "sid", 3) == 0) {
cloud_set_string(&store->sid, oc_string(t->value.string),
oc_string_len(t->value.string));
} else if (len == 13 &&
memcmp(oc_string(t->name), "auth_provider", 13) == 0) {
cloud_set_string(&store->auth_provider, oc_string(t->value.string),
......@@ -168,6 +173,8 @@ cloud_store_decode(oc_rep_t *rep, oc_cloud_store_t *store)
case OC_REP_INT:
if (len == 6 && memcmp(oc_string(t->name), "status", 6) == 0) {
store->status = (uint8_t)t->value.integer;
} else if (len == 3 && memcmp(oc_string(t->name), "cps", 3) == 0) {
store->cps = (uint8_t)t->value.integer;
} else {
OC_ERR("[CLOUD_STORE] Unknown property %s", oc_string(t->name));
return -1;
......
......@@ -509,16 +509,17 @@ oc_endpoint_string_parse_path(oc_string_t *endpoint_str, oc_string_t *path)
const char *address = NULL;
address = strstr(oc_string(*endpoint_str), "://");
if(!address) {
if (!address) {
return -1;
}
// 3 is string length of "://"
address += 3;
size_t len = oc_string_len(*endpoint_str) - (address - oc_string(*endpoint_str));
size_t len =
oc_string_len(*endpoint_str) - (address - oc_string(*endpoint_str));
// the smallest possible address is '0' anything smaller is invalid.
if(len < 1) {
if (len < 1) {
return -1;
}
/* Extract a uri path if available */
......@@ -556,7 +557,7 @@ oc_ipv6_endpoint_is_link_local(oc_endpoint_t *endpoint)
}
int
oc_endpoint_compare_address(oc_endpoint_t *ep1, oc_endpoint_t *ep2)
oc_endpoint_compare_address(const oc_endpoint_t *ep1, const oc_endpoint_t *ep2)
{
if (!ep1 || !ep2)
return -1;
......
......@@ -17,6 +17,7 @@
#include <stdint.h>
#include <stdio.h>
#include "oc_config.h"
#include "port/oc_assert.h"
#include "port/oc_clock.h"
#include "port/oc_connectivity.h"
......
......@@ -492,6 +492,7 @@ read_pem(const char *file_path, char *buffer, size_t *buffer_len)
return -1;
}
fclose(fp);
buffer[pem_len] = '\0';
*buffer_len = (size_t)pem_len;
return 0;
}
......
......@@ -46,11 +46,11 @@ display_menu(void)
}
// define application specific values.
static const char *spec_version = "ocf.2.5.0";
static const char *spec_version = "ocf.2.0.5";
static const char *data_model_version = "ocf.res.1.3.0";
static const char *device_rt = "oic.d.cloudDevice";
static const char *device_name = "CloudDevice";
static const char *device_name = "CloudClient";
static const char *manufacturer = "ocfcloud.com";
......@@ -450,8 +450,13 @@ main(int argc, char *argv[])
{
if (argc == 1) {
PRINT("./cloud_client <device-name-without-spaces> <auth-code> <cis> <sid> "
"<apn>\n"
"Using the default values\n");
"<apn>\n");
#ifndef OC_SECURITY
PRINT("Using default parameters: device_name: %s, auth_code: %s, cis: %s, "
"sid: %s, "
"apn: %s\n",
device_name, auth_code, cis, sid, apn);
#endif /* !OC_SECURITY */
}
if (argc > 1) {
device_name = argv[1];
......@@ -474,10 +479,6 @@ main(int argc, char *argv[])
PRINT("apn: %s\n", argv[5]);
}
PRINT("device_name: %s, auth_code: %s, cis: %s, sid: %s, "
"apn: %s\n",
device_name, auth_code, cis, sid, apn);
#if defined(_WIN32)
InitializeCriticalSection(&cs);
InitializeConditionVariable(&cv);
......
......@@ -134,12 +134,12 @@ run(void)
#endif
// define application specific values.
static const char *spec_version = "ocf.1.0.0";
static const char *data_model_version = "ocf.res.1.0.0";
static const char *spec_version = "ocf.2.0.5";
static const char *data_model_version = "ocf.res.1.3.0";
static const char *resource_rt = "core.light";
static const char *device_rt = "oic.d.cloudDevice";
static const char *device_name = "Cloud Device";
static const char *device_name = "CloudServer";
static const char *manufacturer = "ocfcloud.com";
......@@ -363,13 +363,15 @@ factory_presets_cb(size_t device, void *data)
int
main(int argc, char *argv[])
{
PRINT("Default parameters: device_name: %s, auth_code: %s, cis: %s, sid: %s, "
"apn: %s\n",
device_name, auth_code, cis, sid, apn);
if (argc == 1) {
PRINT("./cloud_client <device-name-without-spaces> <auth-code> <cis> <sid> "
"<apn>\n"
"Using the default values\n");
PRINT("./cloud_server <device-name-without-spaces> <auth-code> <cis> <sid> "
"<apn>\n");
#ifndef OC_SECURITY
PRINT("Using default parameters: device_name: %s, auth_code: %s, cis: %s, "
"sid: %s, "
"apn: %s\n",
device_name, auth_code, cis, sid, apn);
#endif /* !OC_SECURITY */
}
if (argc > 1) {
device_name = argv[1];
......
......@@ -38,8 +38,7 @@
#include "port/oc_storage.h"
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
/**
......@@ -560,6 +559,64 @@ void oc_reset();
*/
void oc_reset_device(size_t device);
/**
* Callback invoked when the "owned" property of the doxm is changed
*
* @param device_uuid the UUID of the device that change ownership
* @param device_index of the logical device that changed ownership
* @param owned if true the device has been claimed by an onboarding tool
* @param user_data context pointer
*/
typedef void (*oc_ownership_status_cb_t)(const oc_uuid_t *device_uuid,
size_t device_index, bool owned,
void *user_data);
/**
* Add callback that is invoked when the doxm "owned" property is changed
*
* If oc_add_ownership_status_cb is called before oc_main_init or inside
* one of the , the oc_handler_t callback funtions the oc_ownership_status_cb_t
* will be invoked when the stack is initilized giving the startup ownership
* value. If oc_add_ownership_status_cb is called after oc_main_init the
* oc_add_ownership_status_cb will not be invoked for the startup ownership
* value.
*
* @note Use of this function requires building the stack with OC_SECURITY
* defined.
*
* @param cb callback function that will be invoked
* @param user_data context pointer passed to the oc_ownership_status_cb_t
* callback the pointer must remain valid till callback is removed.
*/
void oc_add_ownership_status_cb(oc_ownership_status_cb_t cb, void *user_data);
/**
* Remove the ownership changed callback
*
* @note Use of this function requires building the stack with OC_SECURITY
* defined.
*
* @param cb callback function to remove
* @param user_data the context pointer used when the callback was added
*/
void oc_remove_ownership_status_cb(oc_ownership_status_cb_t cb,
void *user_data);
/**
* Get the ownership status of the logical device this is the value of the
* doxm "owned" property
*
* If oc_is_owned_device is called before oc_main_init has completed it will
* always return false because stack security has not been intialized.
*
* @note Use of this function requires building the stack with OC_SECURITY
* defined.
*
* @param device_index the index of the logical device
*
* @return true if the device is owned by an onboarding tool
*/
bool oc_is_owned_device(size_t device_index);
/* Server side */
/**
@defgroup doc_module_tag_server_side Server side
......
......@@ -28,8 +28,7 @@
#endif /* OC_BLOCK_WISE */
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
typedef enum { HIGH_QOS = 0, LOW_QOS } oc_qos_t;
......
......@@ -62,6 +62,7 @@ typedef struct oc_cloud_store_t
oc_string_t refresh_token;
oc_string_t sid;
uint8_t status;
oc_cps_t cps;
size_t device;
} oc_cloud_store_t;
......@@ -104,8 +105,6 @@ typedef struct oc_cloud_context_t
oc_link_t *rd_delete_resources;
bool rd_delete_all;
oc_cps_t cps;
oc_resource_t *cloud_conf;
bool cloud_manager;
......
......@@ -23,8 +23,7 @@
#include "oc_uuid.h"
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
typedef enum { OCF_VER_1_0_0 = 2048, OIC_VER_1_1_0 = 2112 } ocf_version_t;
......@@ -92,7 +91,8 @@ int oc_string_to_endpoint(oc_string_t *endpoint_str, oc_endpoint_t *endpoint,
int oc_endpoint_string_parse_path(oc_string_t *endpoint_str, oc_string_t *path);
int oc_ipv6_endpoint_is_link_local(oc_endpoint_t *endpoint);
int oc_endpoint_compare(const oc_endpoint_t *ep1, const oc_endpoint_t *ep2);
int oc_endpoint_compare_address(oc_endpoint_t *ep1, oc_endpoint_t *ep2);
int oc_endpoint_compare_address(const oc_endpoint_t *ep1,
const oc_endpoint_t *ep2);
void oc_endpoint_set_local_address(oc_endpoint_t *ep, int interface_index);
void oc_endpoint_copy(oc_endpoint_t *dst, oc_endpoint_t *src);
void oc_endpoint_list_copy(oc_endpoint_t **dst, oc_endpoint_t *src);
......
......@@ -77,7 +77,7 @@ extern bool oc_ri_invoke_coap_entity_handler(
void *request, void *response, oc_blockwise_state_t **request_state,
oc_blockwise_state_t **response_state, uint16_t block2_size,
oc_endpoint_t *endpoint);
#else /* OC_BLOCK_WISE */
#else /* OC_BLOCK_WISE */
extern bool oc_ri_invoke_coap_entity_handler(void *request, void *response,
uint8_t *buffer,
oc_endpoint_t *endpoint);
......@@ -496,7 +496,7 @@ coap_receive(oc_message_t *msg)
if (oc_ri_invoke_coap_entity_handler(message, response, &request_buffer,
&response_buffer, block2_size,
&msg->endpoint)) {
#else /* OC_BLOCK_WISE */
#else /* OC_BLOCK_WISE */
if (oc_ri_invoke_coap_entity_handler(message, response,
transaction->message->data +
COAP_MAX_HEADER_SIZE,
......@@ -752,7 +752,8 @@ coap_receive(oc_message_t *msg)
message->token_len, coap_status_code,
&msg->endpoint);
} else {
coap_send_empty_response(message->type == COAP_TYPE_CON ? COAP_TYPE_ACK : COAP_TYPE_NON,
coap_send_empty_response(message->type == COAP_TYPE_CON ? COAP_TYPE_ACK
: COAP_TYPE_NON,
message->mid, message->token, message->token_len,
coap_status_code, &msg->endpoint);
}
......
......@@ -196,6 +196,7 @@ endif
ifeq ($(SWUPDATE),1)
EXTRA_CFLAGS += -DOC_SOFTWARE_UPDATE
export SWUPDATE
endif
ifneq ($(SECURE),0)
......
......@@ -21,9 +21,9 @@ It can be installed on Ubuntu Linux using the following command.
### Get IoTivity-Lite
Checkout IoTivity-lite git project run the following command to get a anonymous copy of
iotivity-lite. Checkout the SWIG branch.
iotivity-lite.
git clone https://gerrit.iotivity.org/gerrit/iotivity-lite
git clone https://gitlab.iotivity.org/iotivity/iotivity-lite.git
### Android SDK tools
Download the [Android SDK command line tools](https://developer.android.com/studio#downloads)
......@@ -102,8 +102,8 @@ Building and Running Samples
-------------------------------------------------
All samples have the default out of the box behavior of IoTivity-Lite which means they are are not
onboarded or provisioned. The default security will prevent the samples from communicating with
one another till onboarding and provisioning has been completed. See the following section
**Onboarding and Provisioning** for instructions on using the onboarding tool that is part of
one another till onboarding and provisioning has been completed. See **Onboarding and Provisioning**
section of the top level README file for instructions on using the onboarding tool that is part of
iotivity-lite.
A sample server and client can be found in `<iotivity-lite>/swig/apps/<sample>`
......@@ -155,9 +155,9 @@ README for step-by-step instructions to onboard and test the samples.
Building Custom Android Applications
-------------------------------------------------
These libraries and examples were built with Android API 23. When creating a new Android project you
can choose the API level. In building these examples, the native code libraries were copied to specific
directories in the project. The project structure is:
These libraries and examples were built with Android API 23. When creating a new Android project a
different API level may be chosen. When building these examples, the native code libraries were
copied to specific directories in the project. The project structure is:
```
project/
......@@ -204,7 +204,8 @@ This structure is reflected in the app `build.gradle` file:
}
```
To allow these example applications to work, permissions had to be granted in the `AndroidManifest.xml` file.
To allow these example applications to work, permissions had to be granted in the
`AndroidManifest.xml` file.
```
<manifest ...>
......@@ -228,7 +229,7 @@ To allow these example applications to work, permissions had to be granted in th
Send Feedback
-------------------------------------------------
Questions
[IoTivity-Lite Developer Mailing List](https://iotivity-dev@lists.iotivity.org)
[IoTivity-Lite Developer Mailing List](https://iotivity.groups.io/g/iotivity-dev)
Bugs
[Jira bug reporting website](https://jira.iotivity.org/projects/LITE)
[IoTivity-lite gitlab issues](https://gitlab.iotivity.org/iotivity/iotivity-lite/issues)
......@@ -14,7 +14,6 @@
// limitations under the License.
*/
#include "port/oc_random.h"
#include <assert.h>
#include <errno.h>
......
......@@ -163,6 +163,7 @@ endif
ifeq ($(SWUPDATE),1)
EXTRA_CFLAGS += -DOC_SOFTWARE_UPDATE
export SWUPDATE
endif
ifneq ($(SECURE),0)
......
......@@ -6,8 +6,7 @@
#include <time.h>
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
typedef uint64_t oc_clock_time_t;
......
......@@ -29,8 +29,7 @@
#include <stdint.h>
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
#ifndef OC_DYNAMIC_ALLOCATION
......@@ -62,8 +61,7 @@ extern "C"
#define OC_BLOCK_SIZE (OC_MAX_APP_DATA_SIZE)
#endif /* !OC_BLOCK_WISE_SET_MTU */
enum
{
enum {
#ifdef OC_TCP // TODO: need to check about tls packet.
OC_PDU_SIZE = (OC_MAX_APP_DATA_SIZE + COAP_MAX_HEADER_SIZE)
#else /* OC_TCP */
......@@ -80,8 +78,7 @@ enum
#endif