nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches

◆ nrf_cloud_shadow_config_delta_process()

int nrf_cloud_shadow_config_delta_process ( struct nrf_cloud_obj *const delta_obj,
int(* process_cfg )(struct nrf_cloud_obj *cfg_obj),
int(* add_cfg_data )(struct nrf_cloud_obj *cfg_obj) )

#include <include/net/nrf_cloud_codec.h>

Process a shadow config delta using application-provided callbacks.

Extracts the "config" object from delta_obj, calls process_cfg to apply it, and on rejection (-EBADF) repopulates it via add_cfg_data before reinserting it into delta_obj so the caller can send a shadow response.

Parameters
[in,out]delta_objThe "state" object from a shadow delta.
[in]process_cfgCallback to apply the received config; returns -EBADF to reject.
[in]add_cfg_dataCallback to populate a replacement config object on rejection.
Return values
0Config applied successfully.
-EINVALInvalid parameter.
-ENOMSGNo config found in delta.
-ENOMEMFailed to reconstruct delta object.