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

◆ azure_iot_hub_connect()

int azure_iot_hub_connect ( const struct azure_iot_hub_config * config)

#include <include/net/azure_iot_hub.h>

Establish connection to Azure IoT Hub. The function blocks until a connection to the hub is established on the transport level. Subsequent calls to other library function should await AZURE_IOT_HUB_EVT_CONNECTED and AZURE_IOT_HUB_EVT_READY events.

Parameters
[in]configPointer to struct containing connection parameters. If NULL, values from Kconfig will be used instead.
Return values
0If successful.
-EALREADYif the device is already connected to an IoT Hub.
-EINPROGRESSif a connection attempt is already in progress.
-ENOENTif the library is not in disconnected state.
-EINVALif the provided configuration is invalid.
-EMSGSIZEif the provided device ID is larger than the internal buffer size.
-EFAULTif there was an internal error in the library.