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

◆ nrf_cloud_obj_object_add()

int nrf_cloud_obj_object_add ( struct nrf_cloud_obj *const  obj,
const char *const  key,
struct nrf_cloud_obj *const  obj_to_add,
const bool  data_child 
)

#include <include/net/nrf_cloud_codec.h>

Add a key string and object to the provided object.

If successful, obj_to_add will be reset with nrf_cloud_obj_reset since its data has been moved to obj.

Parameters
[out]objObject to contain key and object.
[in]keyKey string; must be valid and constant for the life of the object.
[in]obj_to_addObject.
[in]data_childIf true, key and value will be added as a child to a "data" object. If false, key and value will be added as a child to the provided object.
Return values
-EINVALInvalid parameter.
-ENOENTObject is not initialized.
-ENOMEMOut of memory.
-ENOTSUPAction not supported for the object's type.
0Success; item added.