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

◆ nrf_cloud_coap_obj_send()

int nrf_cloud_coap_obj_send ( struct nrf_cloud_obj *const obj,
bool confirmable )

#include <include/net/nrf_cloud_coap.h>

Send an nRF Cloud object.

This only supports sending of the CoAP CBOR or JSON type objects or a pre-encoded CBOR buffer. If the object is actually an array of JSON objects, it will be sent to the d2c/bulk topic, otherwise all other documents are sent to the d2c topic. See the nrf_cloud_obj_bulk_init() function.

Parameters
[in]objAn nRF Cloud object. Will be encoded first if obj->enc_src is NRF_CLOUD_ENC_SRC_NONE.
[in]confirmableSelect whether to use a CON or NON CoAP transfer.
Return values
-EACCESDevice does not have a valid nRF Cloud CoAP connection.
Returns
0 If successful, nonzero if failed. Negative values are device-side errors defined in errno.h. Positive values are cloud-side errors (CoAP result codes) defined in zephyr/net/coap.h.