Skip to content

Commit

Permalink
Merge pull request #102 from PelionIoT/release-4.13.2
Browse files Browse the repository at this point in the history
mbed-cloud-client 4.13.2
  • Loading branch information
jenia81 authored Dec 10, 2023
2 parents cdacedb + e594774 commit 660b307
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 16 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 Izuma Device Management Client

### Release 4.13.2 (10.12.2023)

- `PAL_MAX_FOLDER_DEPTH_CHAR` increased from 66 to 128 bytes for Linux targets.
- [Linux]: Bugfix - update with large images and a short lifetime was failing.
- The downloading of the image happens only after the FOTA state is being updated in the service to `FOTA_SOURCE_STATE_DOWNLOADING`.
- The FOTA state auto-observable resource is kept observable even upon CoAP RESET message from the service.

### Release 4.13.1 (16.02.2023)

- Improved error logging for certificate enrollment misconfiguration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ palStatus_t pal_aesECB(palAesHandle_t aes, const unsigned char input[PAL_CRYPT_B
return pal_plat_aesECB(aes, input, output, mode);
}

palStatus_t pal_sha256(const unsigned char* input, size_t inLen, unsigned char* output)
palStatus_t pal_sha256(const unsigned char* input, size_t inLen, unsigned char output[PAL_SHA256_SIZE])
{
FCC_PAL_VALIDATE_ARGUMENTS((NULL == input || NULL == output))

Expand Down
37 changes: 24 additions & 13 deletions fota/fota.c
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,29 @@ static int calc_and_erase_needed_storage()
return ret;
}

static void on_downloading_state_delivered(void)
{
int ret;

ret = fota_download_init(&fota_ctx->download_handle);
if (ret) {
FOTA_TRACE_ERROR("init download failed %d", ret);
goto fail;
}

ret = fota_download_start(fota_ctx->download_handle, fota_ctx->fw_info->uri, fota_ctx->payload_offset);
if (ret) {
FOTA_TRACE_ERROR("start firmware download failed %d", ret);
goto fail;
}

return;

fail:
FOTA_TRACE_DEBUG("Failed on download event. ret code %d", ret);
abort_update(ret, "Failed on download authorization event");
}

static void fota_on_download_authorize()
{
int ret;
Expand Down Expand Up @@ -2114,19 +2137,7 @@ static void fota_on_download_authorize()
#endif

fota_ctx->state = FOTA_STATE_DOWNLOADING;
fota_source_report_state(FOTA_SOURCE_STATE_DOWNLOADING, NULL, NULL);

ret = fota_download_init(&fota_ctx->download_handle);
if (ret) {
FOTA_TRACE_ERROR("init download failed %d", ret);
goto fail;
}

ret = fota_download_start(fota_ctx->download_handle, fota_ctx->fw_info->uri, fota_ctx->payload_offset);
if (ret) {
FOTA_TRACE_ERROR("start firmware download failed %d", ret);
goto fail;
}
fota_source_report_state(FOTA_SOURCE_STATE_DOWNLOADING, on_downloading_state_delivered, on_state_set_failure);

return;

Expand Down
4 changes: 4 additions & 0 deletions mbed-client-pal/Source/PAL-Impl/Services-API/pal_fileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@

#define PAL_MAX_FILE_NAME_SIZE 8 //!< Max length for file name received by user.
#define PAL_MAX_FILE_NAME_SUFFIX 3 //!< Max length for file name suffix.
#ifdef __linux__
#define PAL_MAX_FOLDER_DEPTH_CHAR 128 //!< Max folder length in chars, snaps need more.
#else
#define PAL_MAX_FOLDER_DEPTH_CHAR 66 //!< Max folder length in chars.
#endif
#define PAL_MAX_FILE_AND_FOLDER_LENGTH (PAL_MAX_FILE_NAME_SIZE + PAL_MAX_FILE_NAME_SUFFIX + PAL_MAX_FOLDER_DEPTH_CHAR + 1) //!< Maximum combined file and folder name length. Plus 1 is for the period that separates file name and file suffix.
#define PAL_MAX_FULL_FILE_NAME (PAL_MAX_FILE_NAME_SUFFIX + PAL_MAX_FOLDER_DEPTH_CHAR + 1) //!< Maximum combined file name. Plus 1 is for the period that separates file name and file suffix.

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 1
#define PDMC_PATCH_VERSION 2

#endif // M2MVERSION_H
8 changes: 7 additions & 1 deletion mbed-client/source/m2mnsdlinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3635,7 +3635,13 @@ void M2MNsdlInterface::handle_empty_ack(const sn_coap_hdr_s *coap_header, bool i
M2MBase *base = find_resource(resp->uri_path);
if (base) {
if (resp->type == M2MBase::NOTIFICATION) {
base->cancel_observation();
if (base->is_auto_observable()) {
// If the resource is auto-observable,don't cancel the observation but do send an error
base->send_message_delivery_status(*base, M2MBase::MESSAGE_STATUS_SEND_FAILED, M2MBase::NOTIFICATION);
} else {
// If the resource is not auto-observable, cancel the observation
base->cancel_observation();
}
_notification_send_ongoing = false;
_notification_handler->send_notification(this);
} else if (resp->type == M2MBase::DELAYED_POST_RESPONSE) {
Expand Down

0 comments on commit 660b307

Please sign in to comment.