Skip to content

Commit

Permalink
Merge pull request #96 from PelionIoT/release-4.11.1
Browse files Browse the repository at this point in the history
mbed-cloud-client 4.11.1
  • Loading branch information
teetak01 authored Oct 13, 2021
2 parents 105a184 + 337f01d commit 8a30590
Show file tree
Hide file tree
Showing 22 changed files with 602 additions and 143 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Changelog for Pelion Device Management Client

### Release 4.11.1 (11.10.2021)

### Device Management Client

- [Remote logging] Fixed internal flash configuration to perform a full storage erase before using it.
- Fixed compiler warnings.

### Release 4.11.0 (17.09.2021)

### Device Management Client
Expand Down
13 changes: 13 additions & 0 deletions fota/fota_sub_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ static bool is_sub_comp_registered(fota_sub_comp_table_t *sub_comp_table, int nu
return false;
}

int fota_sub_component_get_table(fota_comp_table_t *comp_table, size_t comp_table_size)
{
int res = 0 ;

if(comp_table_size < sizeof(g_comp_table)){
return FOTA_STATUS_INVALID_ARGUMENT;
}
//Copy table
memcpy( comp_table, g_comp_table, sizeof(g_comp_table));

return FOTA_STATUS_SUCCESS;
}

void fota_sub_component_clean(void)
{
for (int comp_index = 0; comp_index < FOTA_NUM_COMPONENTS; comp_index++) {
Expand Down
1 change: 1 addition & 0 deletions fota/fota_sub_component_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ int fota_sub_component_install(const char *comp_name, package_descriptor_t *desc
int fota_sub_component_finalize(const char *comp_name, package_descriptor_t *descriptor_info, fota_status_e status);
int fota_sub_component_rollback(const char *comp_name, package_descriptor_t *descriptor_info);
int fota_sub_component_verify(const char *comp_name, package_descriptor_t *descriptor_info);
int fota_sub_component_get_table(fota_comp_table_t *comp_table, size_t comp_table_size);

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,13 @@

// Non-volatile entropy source callback functions - Non PSA
#ifndef MBEDTLS_PLATFORM_NV_SEED_READ_MACRO
#include <stdlib.h>
extern int seed_read_from_kvs(unsigned char *buf, size_t buf_len);
#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO seed_read_from_kvs
#endif
#ifndef MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO
#include <stdlib.h>
extern int seed_write_to_kvs(unsigned char *buf, size_t buf_len);
#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO seed_write_to_kvs
#endif

Expand Down
15 changes: 14 additions & 1 deletion mbed-client-pal/Source/Port/Platform-API/pal_plat_entropy.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016-2019 ARM Ltd.
* Copyright 2016-2021 Pelion.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -71,6 +71,19 @@ palStatus_t pal_plat_osEntropyInject(const uint8_t *entropyBuf, size_t bufSizeBy
*/
palStatus_t pal_plat_osEntropyRead(const char *entropyFileName, uint8_t *randomBufOut, size_t bufSizeBytes, size_t *actualRandomSizeBytesOut);

/**
* Inject entropy to non-volatile memory.
*
* @param entropyBuf - pointer to buffer containing the entropy
* @param bufSizeBytes - size of entropyBuf in bytes
*
* @return PAL_SUCCESS - if operation is successful
* PAL_ERR_ENTROPY_EXISTS - Entropy already injected
* PAL_ERR_GENERIC_FAILURE - any other case
*/

palStatus_t pal_plat_DRBGEntropyInject(const uint8_t *entropyBuf, size_t bufSizeBytes);

#ifdef __cplusplus
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "psa/crypto.h"
#include "stdio.h"
#endif
#include "cs_pal_crypto.h"

#include "eventOS_scheduler.h"
#include "eventOS_event_timer.h"
Expand Down
32 changes: 16 additions & 16 deletions mbed-client/mbed-client-classic/source/m2mtimerpimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ extern "C" void tasklet_func(arm_event_s *event)
// skip the init event as there will be a timer event after
if (event->event_type == MBED_CLIENT_TIMER_EVENT) {
if (event->data_ptr) {
M2MTimerPimpl* timer = (M2MTimerPimpl*)event->data_ptr;
M2MTimerPimpl *timer = (M2MTimerPimpl *)event->data_ptr;
timer->handle_timer_event(*event);
} else {
tr_debug("M2MTimerPimpl:tasklet_func event->data_ptr == NULL: event->event_id: %d",event->event_id);
tr_debug("M2MTimerPimpl:tasklet_func event->data_ptr == NULL: event->event_id: %d", event->event_id);
}
}
}
Expand All @@ -59,18 +59,18 @@ void M2MTimerPimpl::handle_timer_event(const arm_event_s &event)
}
}

M2MTimerPimpl::M2MTimerPimpl(M2MTimerObserver& observer)
: _observer(observer),
_interval(0),
_intermediate_interval(0),
_total_interval(0),
_still_left(0),
_timer_event(NULL),
_type(M2MTimerObserver::Notdefined),
_status(0),
_dtls_type(false),
_single_shot(true),
_event_id(-1)
M2MTimerPimpl::M2MTimerPimpl(M2MTimerObserver &observer)
: _observer(observer),
_interval(0),
_intermediate_interval(0),
_total_interval(0),
_still_left(0),
_timer_event(NULL),
_type(M2MTimerObserver::Notdefined),
_status(0),
_dtls_type(false),
_single_shot(true),
_event_id(-1)
{
eventOS_scheduler_mutex_wait();
if (_tasklet_id < 0) {
Expand Down Expand Up @@ -172,7 +172,7 @@ void M2MTimerPimpl::set_event_id()
_event_id = _next_event_id;
_next_event_id++;
// check that event_ids wont over lap timer types
// _next_event_id will overflow and it is ok.
// _next_event_id will overflow and it is ok.
// when it's value change from 225 -> 0. this will set it to M2MTimerObserver::TypeNotUsed + 1
if (_next_event_id <= (uint8_t)M2MTimerObserver::TypeNotUsed) {
_next_event_id = (uint8_t)M2MTimerObserver::TypeNotUsed + 1;
Expand Down Expand Up @@ -237,7 +237,7 @@ bool M2MTimerPimpl::is_total_interval_passed() const

uint64_t M2MTimerPimpl::get_still_left_time() const
{
return _still_left;
return _still_left;
}

void M2MTimerPimpl::start_still_left_timer()
Expand Down
2 changes: 1 addition & 1 deletion mbed-client/mbed-client/m2mversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
/** PDMC_PATCH_VERSION
* Pelion Device Management Client patch version
*/
#define PDMC_PATCH_VERSION 0
#define PDMC_PATCH_VERSION 1

#endif // M2MVERSION_H
17 changes: 13 additions & 4 deletions mbed-client/source/include/m2mdynlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,18 @@ class M2MDynLog {
*/
void store(void *str);

static void dynlog_trace_mutex_wait();
static void dynlog_trace_mutex_release();
static void dynlog_mutex_wait();
static void dynlog_mutex_release();
/**
* \brief Initialize event
* \param event Event to be initialized
*/
void init_event(arm_event_storage_t *event);

#ifndef TARGET_LIKE_LINUX
/**
* \brief Erase whole update image storage area
*/
bool erase_nvm();
#endif // !TARGET_LIKE_LINUX

/**
* \brief Resource callbacks
Expand All @@ -298,6 +306,7 @@ class M2MDynLog {
int8_t _tasklet_id;
char _trigger_string[6];
arm_event_storage_t _event;
arm_event_storage_t _store_event;
size_t _total_log_size;
size_t _write_offset;
size_t _read_offset;
Expand Down
Loading

0 comments on commit 8a30590

Please sign in to comment.