nRF Connect SDK API 0.1.0
|
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.
[out] | obj | Object to initialize. |
[in] | app_id | The desired app ID of the message. |
[in] | msg_type | The desired message type; can be NULL. |
-EINVAL | Invalid parameter. |
-ENOTEMPTY | Object already initialized. |
-ENOMEM | Out of memory. |
-ENOTSUP | Action not supported for the object's type. |
0 | Success; message initialized. |