AWS IoT Embedded C Device SDK
Data Structures | Enumerations | Functions
aws_iot_mqtt_client_connect.c File Reference

MQTT client connect API definition and related functions. More...

#include <stdio.h>
#include <aws_iot_mqtt_client.h>
#include "aws_iot_mqtt_client_interface.h"
#include "aws_iot_mqtt_client_common_internal.h"

Data Structures

union  MQTT_Connect_Header_Flags
 
union  MQTT_Connack_Header_Flags
 

Enumerations

enum  MQTT_Connack_Return_Codes {
  CONNACK_CONNECTION_ACCEPTED = 0, CONNACK_UNACCEPTABLE_PROTOCOL_VERSION_ERROR = 1, CONNACK_IDENTIFIER_REJECTED_ERROR = 2, CONNACK_SERVER_UNAVAILABLE_ERROR = 3,
  CONNACK_BAD_USERDATA_ERROR = 4, CONNACK_NOT_AUTHORIZED_ERROR = 5
}
 

Functions

IoT_Error_t aws_iot_mqtt_connect (AWS_IoT_Client *pClient, IoT_Client_Connect_Params *pConnectParams)
 MQTT Connection Function. More...
 
IoT_Error_t _aws_iot_mqtt_internal_disconnect (AWS_IoT_Client *pClient)
 Disconnect an MQTT Connection. More...
 
IoT_Error_t aws_iot_mqtt_disconnect (AWS_IoT_Client *pClient)
 Disconnect an MQTT Connection. More...
 
IoT_Error_t aws_iot_mqtt_attempt_reconnect (AWS_IoT_Client *pClient)
 MQTT Manual Re-Connection Function. More...
 

Function Documentation

IoT_Error_t _aws_iot_mqtt_internal_disconnect ( AWS_IoT_Client pClient)

Called to send a disconnect message to the broker. This is the internal function which is called by the disconnect API to perform the operation. Not meant to be called directly as it doesn't do validations or client state changes

Parameters
pClientReference to the IoT Client
Returns
An IoT Error Type defining successful/failed send of the disconnect control packet.
IoT_Error_t aws_iot_mqtt_attempt_reconnect ( AWS_IoT_Client pClient)

Called to establish an MQTT connection with the AWS IoT Service using parameters from the last time a connection was attempted Use after disconnect to start the reconnect process manually Makes only one reconnect attempt. Sets the client state to pending reconnect in case of failure

Parameters
pClientReference to the IoT Client
Returns
An IoT Error Type defining successful/failed connection
IoT_Error_t aws_iot_mqtt_connect ( AWS_IoT_Client pClient,
IoT_Client_Connect_Params pConnectParams 
)

Called to establish an MQTT connection with the AWS IoT Service This is the outer function which does the validations and calls the internal connect above to perform the actual operation. It is also responsible for client state changes

Parameters
pClientReference to the IoT Client
pConnectParamsPointer to MQTT connection parameters
Returns
An IoT Error Type defining successful/failed connection
IoT_Error_t aws_iot_mqtt_disconnect ( AWS_IoT_Client pClient)

Called to send a disconnect message to the broker. This is the outer function which does the validations and calls the internal disconnect above to perform the actual operation. It is also responsible for client state changes

Parameters
pClientReference to the IoT Client
Returns
An IoT Error Type defining successful/failed send of the disconnect control packet.