AWS IoT Device SDK C:
MQTT
MQTT 3.1.1 client library
|
Return to main page ↑ |
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 } |
Connect request response codes from server. More... | |
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_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... | |
MQTT client connect API definition and related functions.
Connect request response codes from server.
IoT_Error_t aws_iot_mqtt_connect | ( | AWS_IoT_Client * | pClient, |
IoT_Client_Connect_Params * | pConnectParams | ||
) |
MQTT Connection Function.
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
pClient | Reference to the IoT Client |
pConnectParams | Pointer to MQTT connection parameters |
IoT_Error_t aws_iot_mqtt_disconnect | ( | AWS_IoT_Client * | pClient | ) |
Disconnect an MQTT Connection.
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
pClient | Reference to the IoT Client |
IoT_Error_t aws_iot_mqtt_attempt_reconnect | ( | AWS_IoT_Client * | pClient | ) |
MQTT Manual Re-Connection Function.
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
pClient | Reference to the IoT Client |