Skip to content

Commit

Permalink
Merge pull request #8 from PelionIoT/release-1.4.0-lite
Browse files Browse the repository at this point in the history
pelion-client-lite 1.4.0-lite
  • Loading branch information
Risto Huhtala committed Sep 21, 2021
2 parents 48aeeee + 96877f1 commit 2f4f38c
Show file tree
Hide file tree
Showing 105 changed files with 5,137 additions and 2,107 deletions.
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
## Changelog for Pelion Device Management Client Lite

### Release 1.4.0-lite (21.09.2021)

* Fixed bug where client assumed that event_id and event_type are both 0 when event handler is initialized. Added definition `PDMC_CONNECT_STARTUP_EVENT_TYPE -1 ` to LWM2M interface. Client uses it initializes connection event handler.
* Removed the `need_reboot = false` option in the `fota_component_add()` API. When registering a component, the `need_reboot` option must always be `true`.
* Updated to support Mbed OS 6.8.0. Baremetal mbedtls is now only supported with Mbed OS version >= 6.8.0.
* The new Connection ID (CID) feature eliminates unnecessary DTLS handshake traffic between the client and the cloud during reconnection. To have the client persist the CID during reboot, the application can call the `pause()` API before shutting down the application. This call stores the CID context in persistent memory for use after reboot. The client then uses the CID to establish a secure connection to the cloud without requiring a DTLS handshake. The `PROTOMAN_USE_SSL_SESSION_RESUME` feature flag, which controls this feature, is enabled by default for Mbed OS, and disabled by default for other platforms.
* Added a compile-time check to require the mandatory Mbed TLS flags are defined when the Connection ID feature (`PROTOMAN_USE_SSL_SESSION_RESUME`) is enabled.
* Fixed FOTA full resume.
* Changes to implementation of update candidate image encryption:
* Added new `FOTA_USE_ENCRYPTED_ONE_TIME_FW_KEY` option to `MBED_CLOUD_CLIENT_FOTA_KEY_ENCRYPTION`.
* Replaced `FOTA_USE_DEVICE_KEY` with `FOTA_USE_ENCRYPTED_ONE_TIME_FW_KEY` as the default value for `MBED_CLOUD_CLIENT_FOTA_KEY_ENCRYPTION` due to security vulnerability found in `FOTA_USE_DEVICE_KEY`.
* Using `FOTA_USE_ENCRYPTED_ONE_TIME_FW_KEY` is a breaking change and requires a new bootloader that support this feature.
* Deprecated the `FOTA_USE_DEVICE_KEY` option, which will be removed in a future version.
* Added `fota_app_postpone_reboot()`. Calling this API postpones device reboot, which is required to complete the FOTA process, until the device application explicitly initiates reboot.
* Changed `fota_app_defer()` behavior such that FOTA candidate image download or install resumes only after the device application explicitly calls `fota_app_resume()`.
* Support calling `fota_app_reject()` after calling `fota_app_defer()`.
* Fix: Support for resuming installation after an unexpected interruption (for example, power loss) of a component image.
* Added support for updating device firmware with a cloud-encrypted update image.
* Enabled by the `MBED_CLOUD_CLIENT_FOTA_ENCRYPTION_SUPPORT` option.
* Limitation: Not supported when `MBED_CLOUD_CLIENT_FOTA_CANDIDATE_BLOCK_SIZE` is not 1024.
* Fixed coverity issues.
* Fixed compilation for Client Lite Linux, release mode. KVStore failed to compile in release mode.
* Fixed a bug that prevented Firmware-Over-the-Air (FOTA) from running successfully after devices were provisioned in the production flow.
* Fixed update flow when the update candidate version is 0.0.10.
* Fota block device configuration changes: `FOTA_INTERNAL_FLASH_BD` changed to `FOTA_INTERNAL_FLASH_MBED_OS_BD`, `FOTA_CUSTOM_BD` changed to `FOTA_CUSTOM_MBED_OS_BD`, added default block device configuration : `FOTA_DEFAULT_MBED_OS_BD`.
* Changed FOTA application interface APIs:
* `fota_app_on_install_authorization(uint32 token)` -> `fota_app_on_install_authorization()` (removed token)
* `fota_app_on_download_authorization(uint32_t token, ...)` -> `fota_app_on_download_authorization(...)` (removed token)
* `fota_app_authorize_update()` -> `fota_app_authorize()` (reverted to the deprecated API)
* `fota_app_reject_update()` -> `fota_app_reject()` (reverted to the deprecated API)
* `fota_app_defer_update()` -> `fota_app_defer()` (reverted to the deprecated API)
* On Linux targets, all FOTA related files (candidate, header etc.) were moved to the the configuration directory (PAL/KVstore).
* Require defining `MBED_CLOUD_CLIENT_FOTA_LINUX_SINGLE_MAIN_FILE` in Linux MCCE, Testapp or any Linux app that has a single file update.


### Release 1.3.0-lite (07.12.2020)

* Fixed the `COAP_MSG_CODE_RESPONSE_BAD_REQUEST` and `COAP_MSG_CODE_RESPONSE_FORBIDDEN` responses. Now client re-bootstraps when the server rejects registration.
Expand Down Expand Up @@ -30,4 +65,3 @@
### Release 1.0.0-lite (31.01.2020)

* Initial alpha release for public preview. Not suitable for production use.

5 changes: 4 additions & 1 deletion device-management-client/lwm2m_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ typedef enum registry_notification_status_e {
NOTIFICATION_STATUS_DELIVERED, ///< Received ACK from server.
NOTIFICATION_STATUS_SEND_FAILED, ///< Message sending failed (retransmission completed).
NOTIFICATION_STATUS_SUBSCRIBED, ///< Server has started the observation.
NOTIFICATION_STATUS_UNSUBSCRIBED ///< Server has stopped the observation (RESET message or GET with observe 1).
NOTIFICATION_STATUS_UNSUBSCRIBED, ///< Server has stopped the observation (RESET message or GET with observe 1).
#ifdef MBED_CLOUD_CLIENT_DISABLE_REGISTRY
NOTIFICATION_STATUS_NOT_REGISTERED, ///< Failed due to not being registered
#endif
} registry_notification_status_t;

/**
Expand Down
2 changes: 1 addition & 1 deletion fota/bspatch/bspatch.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*-
* Copyright 2003-2005 Colin Percival
* Copyright 2012 Matthew Endsley
* Copyright (c) 2018-2019 ARM Limited
* Copyright 2019-2021 Pelion Ltd.
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion fota/bspatch/bspatch.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*-
* Copyright 2003-2005 Colin Percival
* Copyright 2012 Matthew Endsley
* Copyright (c) 2018-2019 ARM Limited
* Copyright 2019-2021 Pelion Ltd.
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion fota/bspatch/common.h → fota/bspatch/bspatch_common.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ----------------------------------------------------------------------------
// Copyright 2019 ARM Ltd.
// Copyright 2019-2021 Pelion Ltd.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
4 changes: 2 additions & 2 deletions fota/bspatch/bspatch_private.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ----------------------------------------------------------------------------
// Copyright 2019 ARM Ltd.
// Copyright 2019-2021 Pelion Ltd.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -20,7 +20,7 @@
#define INCLUDE_BSPATCH_PRIVATE_H_

#include "bspatch.h"
#include "common.h"
#include "bspatch_common.h"

/* Patch applied successfully, but new file is not ready yet. User should re-fill patch buffer and call bspatch again. */
#define BSPATCH_NEED_MORE_PATCH_DATA 1
Expand Down
2 changes: 1 addition & 1 deletion fota/bspatch/import_ref.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Imported from delta-tool at hash: f2029f7867d37023cbf6dc5957c73b669d68a2a4
Imported from delta-tool at hash: c2f98daa8b75cfc53f6175b418f50bdb7d4c7c03
16 changes: 14 additions & 2 deletions fota/bspatch/lz4.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,15 @@
typedef uint8_t BYTE;
typedef uint16_t U16;
typedef uint32_t U32;
typedef int8_t S8;
typedef int32_t S32;
typedef uint64_t U64;
typedef uintptr_t uptrval;
#else
typedef unsigned char BYTE;
typedef unsigned short U16;
typedef unsigned int U32;
typedef signed char S8;
typedef signed int S32;
typedef unsigned long long U64;
typedef size_t uptrval; /* generally true, except OpenVMS-64 */
Expand All @@ -198,11 +200,21 @@
/*-************************************
* Reading and writing into memory
**************************************/
#ifdef __CC_ARM
#ifdef __BIG_ENDIAN
#define LZ4_isLittleEndian() 0U
#else
#define LZ4_isLittleEndian() 1U
#endif
#elif defined __BYTE_ORDER__ && defined __ORDER_LITTLE_ENDIAN__
#define LZ4_isLittleEndian() ((unsigned) (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
#else
static unsigned LZ4_isLittleEndian(void)
{
const union { U32 u; BYTE c[4]; } one = { 1 }; /* don't use static : performance detrimental */
return one.c[0];
}
#endif


#if defined(LZ4_FORCE_MEMORY_ACCESS) && (LZ4_FORCE_MEMORY_ACCESS==2)
Expand Down Expand Up @@ -1425,8 +1437,8 @@ LZ4_decompress_generic(
BYTE* cpy;

const BYTE* const dictEnd = (dictStart == NULL) ? NULL : dictStart + dictSize;
const unsigned inc32table[8] = {0, 1, 2, 1, 0, 4, 4, 4};
const int dec64table[8] = {0, 0, 0, -1, -4, 1, 2, 3};
static const BYTE inc32table[8] = {0, 1, 2, 1, 0, 4, 4, 4};
static const S8 dec64table[8] = {0, 0, 0, -1, -4, 1, 2, 3};

const int safeDecode = (endOnInput==endOnInputSize);
const int checkOffset = ((safeDecode) && (dictSize < (int)(64 KB)));
Expand Down
10 changes: 0 additions & 10 deletions fota/bspatch/mbed_lib.json

This file was deleted.

2 changes: 1 addition & 1 deletion fota/bspatch/varint.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2018-2019 ARM Limited
* Copyright 2019-2021 Pelion Ltd.
* All rights reserved
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion fota/bspatch/varint.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ----------------------------------------------------------------------------
// Copyright 2019 ARM Ltd.
// Copyright 2019-2021 Pelion Ltd.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down
Loading

0 comments on commit 2f4f38c

Please sign in to comment.