![]() |
nRF Connect SDK API 3.3.99
|
| int nrf_cloud_obj_msg_ts_init | ( | struct nrf_cloud_obj *const | obj, |
| const char *const | app_id, | ||
| const char *const | msg_type ) |
#include <include/net/nrf_cloud_codec.h>
Initialize an nRF Cloud device message object with the current timestamp.
Combines nrf_cloud_obj_msg_init and nrf_cloud_obj_ts_add using the current system time. On success, memory is allocated for the object; call nrf_cloud_obj_free when done. For CoAP builds, msg_type is ignored (set to NULL internally).
| [out] | obj | Object to initialize. |
| [in] | app_id | Application ID string for the message. |
| [in] | msg_type | Message type string (ignored for CoAP). |
| -EINVAL | Invalid parameter. |
| -ETIME | Failed to obtain current timestamp. |
| -ENOMEM | Out of memory. |
| 0 | Success. |