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

◆ nrf_cloud_rest_send_device_message()

int nrf_cloud_rest_send_device_message ( struct nrf_cloud_rest_context *const rest_ctx,
const char *const device_id,
const char *const json_msg,
const bool bulk,
const char *const topic )

#include <include/net/nrf_cloud_rest.h>

Send a JSON formatted device message using the SendDeviceMessage endpoint.

Parameters
[in,out]rest_ctxContext for communicating with nRF Cloud's REST API.
[in]device_idNull-terminated, unique device ID registered with nRF Cloud.
[in]json_msgNull-terminated JSON string containing the device message.
[in]bulkUse the bulk message topic. If true, the topic parameter is ignored.
[in]topicOptional; null-terminated MQTT topic string. If NULL, the d2c topic is used.
Return values
0If successful. Otherwise, a (negative) error code is returned. See "nRF Cloud: Request Failure" for details.