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

◆ nrf_cloud_client_id_get()

int nrf_cloud_client_id_get ( char * id_buf,
size_t id_buf_sz )

#include <include/net/nrf_cloud.h>

Retrieve the current device ID.

Parameters
[in,out]id_bufBuffer to receive the device ID as a null-terminated string.
[in]id_buf_szSize of buffer, maximum size is NRF_CLOUD_CLIENT_ID_MAX_LEN + 1.
Return values
0If successful.
-EMSGSIZEThe provided buffer is too small.
-EIOThe client ID could not be initialized.
-ENXIOThe Kconfig option
CONFIG_NRF_CLOUD_CLIENT_ID_SRC_RUNTIME 
is enabled but the runtime client ID has not been set. See nrf_cloud_client_id_runtime_set.
Returns
A negative value indicates an error.