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

◆ json_common_batch_data_add()

int json_common_batch_data_add ( cJSON * parent,
enum json_common_buffer_type type,
void * buf,
size_t buf_count,
const char * object_label )

#include <applications/asset_tracker_v2/src/cloud/cloud_codec/json_common.h>

Encode all queued entries in the passed in buffer and add it to the parent object as an array.

Parameters
[out]parentPointer to object that the encoded data is added to.
[in]typeType of data passed in to the function.
[in]bufPointer to data buffer that is to be encoded.
[in]buf_countNumber of entries in passed in data buffer.
[in]object_labelName of the array entry that is added to the parent object.
Returns
0 on success. -ENODATA if the passed in data is not valid. Otherwise a negative error code is returned.