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

◆ nrf_cloud_coap_connect()

int nrf_cloud_coap_connect ( const char *const  app_ver)

#include <include/net/nrf_cloud_coap.h>

Connect to and obtain authorization to access the nRF Cloud CoAP server.

This function must return 0 indicating success so that the other functions below, other than nrf_cloud_coap_disconnect(), will not immediately return an error when called.

Parameters
app_verVersion to report to the shadow; can be NULL.
Returns
0 if authorized successfully, otherwise, an error number. Negative values are device-side errors defined in errno.h. Positive values are cloud-side errors (CoAP result codes) defined in zephyr/net/coap.h.
Return values
-EACCESif nrf_cloud_coap_init has not been called.