From 85833d251206c8e97e4e273948c23297fa2217d0 Mon Sep 17 00:00:00 2001 From: Justin Morton Date: Mon, 29 Jul 2024 13:30:16 -0700 Subject: [PATCH] samples: cellular: nrf_cloud_multi_service: fix accepted shadow handling Set the accepted shadow received flag to true even if there is no config section in the shadow. Signed-off-by: Justin Morton --- .../releases/release-notes-changelog.rst | 2 ++ .../nrf_cloud_multi_service/src/shadow_config.c | 11 ++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 40a8f1b839bf..e6e05e0b3a24 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -375,6 +375,8 @@ Cellular samples * Renamed the :file:`overlay_nrf7002ek_wifi_no_lte.conf` overlay to :file:`overlay_nrf700x_wifi_mqtt_no_lte.conf`. * Renamed the :file:`overlay_nrf7002ek_wifi_coap_no_lte.conf` overlay to :file:`overlay_nrf700x_wifi_coap_no_lte.conf`. + * Fixed an issue where the accepted shadow was not marked as received because the config section did not yet exist in the shadow. + * :ref:`nrf_cloud_rest_device_message` sample: * Added: diff --git a/samples/cellular/nrf_cloud_multi_service/src/shadow_config.c b/samples/cellular/nrf_cloud_multi_service/src/shadow_config.c index ec2313a6753a..6f940a5fd6de 100644 --- a/samples/cellular/nrf_cloud_multi_service/src/shadow_config.c +++ b/samples/cellular/nrf_cloud_multi_service/src/shadow_config.c @@ -186,16 +186,13 @@ int shadow_config_accepted_process(struct nrf_cloud_obj *const accepted_obj) return -EINVAL; } + /* The accepted shadow has been received */ + accepted_rcvd = true; + if ((accepted_obj->type != NRF_CLOUD_OBJ_TYPE_JSON) || !accepted_obj->json) { /* No config JSON */ return -ENOMSG; } - int err = process_cfg(accepted_obj); - - if (err == 0) { - accepted_rcvd = true; - } - - return err; + return process_cfg(accepted_obj); }