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

◆ nrf_cloud_obj_msg_ts_init()

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).

Parameters
[out]objObject to initialize.
[in]app_idApplication ID string for the message.
[in]msg_typeMessage type string (ignored for CoAP).
Return values
-EINVALInvalid parameter.
-ETIMEFailed to obtain current timestamp.
-ENOMEMOut of memory.
0Success.