nRF Connect SDK API 2.8.99
|
int nrf_cloud_coap_message_send | ( | const char * | app_id, |
const char * | message, | ||
bool | json, | ||
int64_t | ts_ms, | ||
bool | confirmable ) |
#include <include/net/nrf_cloud_coap.h>
Send a message to nRF Cloud.
The JSON or CBOR message is sent either as a non-confirmable or confirmable CoAP message. Use non-confirmable when sending low priority information for which some data loss is acceptable.
[in] | app_id | The app_id identifying the type of data. See the values in nrf_cloud_defs.h that begin with NRF_CLOUD_JSON_APPID_. You may also use custom names. |
[in] | message | The string to send. |
[in] | json | Set true if the data should be sent in JSON format, otherwise CBOR. |
[in] | ts_ms | Timestamp the data was measured, or NRF_CLOUD_NO_TIMESTAMP. |
[in] | confirmable | Select whether to use a CON or NON CoAP transfer. |
-EACCES | Device does not have a valid nRF Cloud CoAP connection. |