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

◆ nrf_cloud_obj_msg_init()

int nrf_cloud_obj_msg_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 object as an nRF Cloud device message.

If successful, memory is allocated for the provided object. The nrf_cloud_obj_free function should be called when finished with the object.

Parameters
[out]objObject to initialize.
[in]app_idThe desired app ID of the message.
[in]msg_typeThe desired message type; can be NULL.
Return values
-EINVALInvalid parameter.
-ENOTEMPTYObject already initialized.
-ENOMEMOut of memory.
-ENOTSUPAction not supported for the object's type.
0Success; message initialized.