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

◆ aws_iot_connect()

int aws_iot_connect ( const struct aws_iot_config *const config)

#include <include/net/aws_iot.h>

Connect to the AWS IoT broker.

This function is synchronous and will only return success when the client has connected to the broker and all subscriptions (if any) have been acknowledged. If these conditions have not completed within CONFIG_AWS_IOT_CONNECT_TIMEOUT_SECONDS, the function times out and the application will need to call this function again.

Parameters
[out]configPointer to a structure that contains connection parameters. If this structure is passed in as NULL, static configurations set via Kconfig options are used. See CONFIG_AWS_IOT_BROKER_HOST_NAME and CONFIG_AWS_IOT_CLIENT_ID_STATIC.
Return values
0If successful.
-EAGAINIf the client failed to connect within CONFIG_AWS_IOT_CONNECT_TIMEOUT_SECONDS.