MQTT API Reference
MQTT 3.1.1 client library
Handles

Opaque handles of the MQTT library. More...

Typedefs

typedef struct _mqttConnection * IotMqttConnection_t
 Opaque handle of an MQTT connection. More...
 
typedef struct _mqttOperation * IotMqttOperation_t
 Opaque handle that references an in-progress MQTT operation. More...
 

Detailed Description

Opaque handles of the MQTT library.

Typedef Documentation

◆ IotMqttConnection_t

typedef struct _mqttConnection* IotMqttConnection_t

Opaque handle of an MQTT connection.

This type identifies an MQTT connection, which is valid after a successful call to IotMqtt_Connect. A variable of this type is passed as the first argument to MQTT library functions to identify which connection that function acts on.

A call to IotMqtt_Disconnect makes a connection handle invalid. Once IotMqtt_Disconnect returns, the connection handle should no longer be used.

All instances of IotMqttConnection_t should be initialized with IOT_MQTT_CONNECTION_INITIALIZER.

◆ IotMqttOperation_t

typedef struct _mqttOperation* IotMqttOperation_t

Opaque handle that references an in-progress MQTT operation.

Set as an output parameter of IotMqtt_PublishAsync, IotMqtt_SubscribeAsync, and IotMqtt_UnsubscribeAsync. These functions queue an MQTT operation; the result of the operation is unknown until a response from the MQTT server is received. Therefore, this handle serves as a reference to MQTT operations awaiting MQTT server response.

This reference will be valid from the successful return of IotMqtt_PublishAsync, IotMqtt_SubscribeAsync, or IotMqtt_UnsubscribeAsync. The reference becomes invalid once the completion callback is invoked, or IotMqtt_Wait returns.

All instances of IotMqttOperation_t should be initialized with IOT_MQTT_OPERATION_INITIALIZER.

See also
IotMqtt_Wait and IOT_MQTT_FLAG_WAITABLE for waiting on a reference. IotMqttCallbackInfo_t and IotMqttCallbackParam_t for an asynchronous notification of completion.