MQTT C Client Libraries Internals: MQTTAsync_createOptions Struct Reference

| MQTT C Client Libraries Internals

Data Fields
MQTTAsync_createOptions Struct Reference

Options for the ::MQTTAsync_createWithOptions call. More...

`#include <MQTTAsync.h>`

## Data Fields
char | struct_id [4]
| The eyecatcher for this structure. More...
int | struct_version
| The version number of this structure. More...
int | sendWhileDisconnected
| Whether to allow messages to be sent when the client library is not connected.
int | maxBufferedMessages
| The maximum number of messages allowed to be buffered. More...
int | MQTTVersion
| Whether the MQTT version is 3.1, 3.1.1, or 5. More...
int | allowDisconnectedSendAtAnyTime
| Allow sending of messages while disconnected before a first successful connect.
int | deleteOldestMessages
int | restoreMessages
int | persistQoS0

## Detailed Description

Options for the ::MQTTAsync_createWithOptions call.

## Field Documentation

## ◆ maxBufferedMessages

int MQTTAsync_createOptions::maxBufferedMessages

The maximum number of messages allowed to be buffered.

This is intended to be used to limit the number of messages queued while the client is not connected. It also applies when the client is connected, however, so has to be greater than 0.

## ◆ MQTTVersion

int MQTTAsync_createOptions::MQTTVersion

Whether the MQTT version is 3.1, 3.1.1, or 5.

To use V5, this must be set. MQTT V5 has to be chosen here, because during the create call the message persistence is initialized, and we want to know whether the format of any persisted messages is appropriate for the MQTT version we are going to connect with. Selecting 3.1 or 3.1.1 and attempting to read 5.0 persisted messages will result in an error on create.

## ◆ struct_id

char MQTTAsync_createOptions::struct_id[4]

The eyecatcher for this structure.

must be MQCO.

## ◆ struct_version

int MQTTAsync_createOptions::struct_version

The version number of this structure.

Must be 0, 1, 2 or 3 0 means no MQTTVersion 1 means no allowDisconnectedSendAtAnyTime, deleteOldestMessages, restoreMessages 2 means no persistQoS0

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

- MQTTAsync.h