nRF Connect SDK API 2.8.0
|
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. The full DTLS handshake is performed, and on success, a connection ID (CID) is obtained. The CID allows the connection to be paused with nrf_cloud_coap_pause and resumed with nrf_cloud_coap_resume without redoing the full handshake. Use nrf_cloud_coap_keepopen_is_supported to check if network conditions allow the pause and resume actions.
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.
app_ver | Version to report to the shadow; can be NULL. |
-EACCES | if nrf_cloud_coap_init has not been called. |