Skip to content

Commit

Permalink
samples: cellular: nrf_cloud_multi_service: fix accepted shadow handling
Browse files Browse the repository at this point in the history
Set the accepted shadow received flag to true even if there is
no config section in the shadow.

Signed-off-by: Justin Morton <[email protected]>
  • Loading branch information
jayteemo authored and nordicjm committed Sep 2, 2024
1 parent e551fc4 commit 85833d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 4 additions & 7 deletions samples/cellular/nrf_cloud_multi_service/src/shadow_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 85833d2

Please sign in to comment.