AWS IoT Device SDK C: MQTT
MQTT 3.1.1 client library
Return to main page ↑
Constants

Defined constants of the MQTT library.

Libraries may #define constants in their headers with special meanings. This page describes the meanings and uses of any constants defined by the MQTT library. Related constants are shown in a single section on this page.

MQTT Initializers

Provides default values for the data types of the MQTT library.

#define IOT_MQTT_NETWORK_INFO_INITIALIZER { .createNetworkConnection = true }
#define IOT_MQTT_SERIALIZER_INITIALIZER { 0 }
#define IOT_MQTT_CONNECT_INFO_INITIALIZER { .cleanSession = true }
#define IOT_MQTT_PUBLISH_INFO_INITIALIZER { .qos = IOT_MQTT_QOS_0 }
#define IOT_MQTT_SUBSCRIPTION_INITIALIZER { .qos = IOT_MQTT_QOS_0 }
#define IOT_MQTT_CALLBACK_INFO_INITIALIZER { 0 }
#define IOT_MQTT_CONNECTION_INITIALIZER NULL
#define IOT_MQTT_OPERATION_INITIALIZER NULL
#define IOT_MQTT_PACKET_INFO_INITIALIZER { .pRemainingData = NULL, remainingLength = 0, packetIdentifier = 0, .type = 0 }

All user-facing data types of the MQTT library should be initialized using one of the following.

Warning
Failing to initialize an MQTT data type with the appropriate initializer may result in undefined behavior!
Note
The initializers may change at any time in future versions, but their names will remain the same.

Example

MQTT Function Flags

Flags that modify the behavior of MQTT library functions.

Flags should be bitwise-ORed with each other to change the behavior of IotMqtt_SubscribeAsync, IotMqtt_UnsubscribeAsync, IotMqtt_PublishAsync, their blocking versions; or IotMqtt_Disconnect.

Note
The values of the flags may change at any time in future versions, but their names will remain the same. Additionally, flags that may be used together will be bitwise-exclusive of each other.