AWS IoT Device SDK C: MQTT
MQTT 3.1.1 client library
Return to main page ↑
IotMqttNetworkInfo_t Struct Reference

MQTT network connection details. More...

#include <iot_mqtt_types.h>

Data Fields

bool createNetworkConnection
 Whether a new network connection should be created. More...
 
union {
   struct {
      IotNetworkServerInfo_t   pNetworkServerInfo
 Information on the MQTT server, passed as pServerInfo to IotNetworkInterface_t::create. More...
 
      IotNetworkCredentials_t   pNetworkCredentialInfo
 Credentials for the MQTT server, passed as pCredentialInfo to IotNetworkInterface_t::create. More...
 
   }   setup
 
   IotNetworkConnection_t   pNetworkConnection
 An established transport-layer network connection. More...
 
u
 Valid member depends of IotMqttNetworkInfo_t.createNetworkConnection. More...
 
const IotNetworkInterface_tpNetworkInterface
 The network functions used by the new MQTT connection. More...
 
IotMqttCallbackInfo_t disconnectCallback
 A callback function to invoke when this MQTT connection is disconnected.
 
const IotMqttSerializer_tpMqttSerializer
 MQTT packet serializer overrides used by the new MQTT connection. More...
 

Detailed Description

MQTT network connection details.

Parameter for: IotMqtt_Connect

The MQTT library needs to be able to send and receive data over a network. This struct provides an interface for interacting with the network.

All instances of IotMqttNetworkInfo_t should be initialized with IOT_MQTT_NETWORK_INFO_INITIALIZER.

Field Documentation

◆ createNetworkConnection

bool IotMqttNetworkInfo_t::createNetworkConnection

Whether a new network connection should be created.

When this value is true, a new transport-layer network connection will be created along with the MQTT connection. IotMqttNetworkInfo_t::pNetworkServerInfo and IotMqttNetworkInfo_t::pNetworkCredentialInfo are valid when this value is true.

When this value is false, the MQTT connection will use a transport-layer network connection that has already been established. The MQTT library will still set the appropriate receive callback even if the network connection has been established. IotMqttNetworkInfo_t::pNetworkConnection, which represents an established network connection, is valid when this value is false.

◆ pNetworkServerInfo

IotNetworkServerInfo_t IotMqttNetworkInfo_t::pNetworkServerInfo

Information on the MQTT server, passed as pServerInfo to IotNetworkInterface_t::create.

This member is opaque to the MQTT library. It is passed to the network interface when creating a new network connection. It is only valid when IotMqttNetworkInfo_t::createNetworkConnection is true.

◆ pNetworkCredentialInfo

IotNetworkCredentials_t IotMqttNetworkInfo_t::pNetworkCredentialInfo

Credentials for the MQTT server, passed as pCredentialInfo to IotNetworkInterface_t::create.

This member is opaque to the MQTT library. It is passed to the network interface when creating a new network connection. It is only valid when IotMqttNetworkInfo_t::createNetworkConnection is true.

◆ pNetworkConnection

IotNetworkConnection_t IotMqttNetworkInfo_t::pNetworkConnection

An established transport-layer network connection.

This member is opaque to the MQTT library. It is passed to the network interface to reference an established network connection. It is only valid when IotMqttNetworkInfo_t::createNetworkConnection is false.

◆ u

union { ... } IotMqttNetworkInfo_t::u

◆ pNetworkInterface

const IotNetworkInterface_t* IotMqttNetworkInfo_t::pNetworkInterface

The network functions used by the new MQTT connection.

Attention
The function pointers of the network interface must remain valid for the lifetime of the MQTT connection.

◆ pMqttSerializer

const IotMqttSerializer_t* IotMqttNetworkInfo_t::pMqttSerializer

MQTT packet serializer overrides used by the new MQTT connection.

Attention
The function pointers of the MQTT serializer overrides must remain valid for the lifetime of the MQTT connection.

The documentation for this struct was generated from the following file: