#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] | config | Pointer to struct containing connection parameters. If NULL, values from Kconfig will be used instead. |
- Return values
-
| 0 | If successful. |
| -EALREADY | if the device is already connected to an IoT Hub. |
| -EINPROGRESS | if a connection attempt is already in progress. |
| -ENOENT | if the library is not in disconnected state. |
| -EINVAL | if the provided configuration is invalid. |
| -EMSGSIZE | if the provided device ID is larger than the internal buffer size. |
| -EFAULT | if there was an internal error in the library. |