MQTTAsync_createOptions(3)

πŸ’– MQTTAsync_createOptions πŸ’–

okay so bestie, we're in the Library Functions Manual and today's main character is literally MQTTAsync_createOptions β€” she's a struct, she's an icon, she's the whole vibe. πŸŽ€


✨ NAME ✨

MQTTAsync_createOptions β€” the options struct you hand over to MQTTAsync_createWithOptions. no cap. πŸ’…


🌸 SYNOPSIS 🌸

#include <MQTTAsync.h>

πŸ¦‹ Data Fields πŸ¦‹

char struct_id [4]
int struct_version
int sendWhileDisconnected
int maxBufferedMessages
int MQTTVersion
int allowDisconnectedSendAtAnyTime
int deleteOldestMessages
int restoreMessages
int persistQoS0

πŸ‘‘ Detailed Description πŸ‘‘

These are the options for the MQTTAsync_createWithOptions call. that's the whole assignment. slay. πŸ’–


🧚 Field Documentation 🧚

char struct_id[4]

the eyecatcher for this structure. it must be MQCO. like, it has to be, that's the rules, don't argue with her. ⭐

int struct_version

the version number of this structure. it must be 0, 1, 2 or 3. let's break it down bestie:

  • 0 means no MQTTVersion
  • 1 means no allowDisconnectedSendAtAnyTime, deleteOldestMessages, restoreMessages
  • 2 means no persistQoS0

pick your era, they're all valid. πŸ’…

int sendWhileDisconnected

whether to allow messages to be sent when the client library is not connected. yes, sending while the connection's ghosting you. it's giving chaos but it's allowed. πŸ”₯

int maxBufferedMessages

the maximum number of messages allowed to be buffered. the tea here: this is intended to be used to limit the number of messages queued while the client is not connected β€” but it also applies when the client is connected, so it has to be greater than 0. like, zero is not it. don't do zero. 😭

int MQTTVersion

whether the MQTT version is 3.1, 3.1.1, or 5. to use V5, this must be set. and here's why, bestie: 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 then attempting to read 5.0 persisted messages will result in an error on create. 🫢 so yeah, choose wisely, the create call is watching. πŸ’€

int allowDisconnectedSendAtAnyTime

allow sending of messages while disconnected before a first successful connect. so even before you've ever connected once, you can still send. main character energy fr fr. πŸ‘‘

int deleteOldestMessages

no description given in the docs, bestie. she's mysterious. she's just... there. πŸŽ€

int restoreMessages

also no description. iconic silence, honestly. πŸ’œ

int persistQoS0

no description either. the mystery continues. πŸ™ˆ


🌈 Author 🌈

generated automatically by Doxygen for the Paho Asynchronous MQTT C Client Library from the source code. the robots wrote this one, not me. πŸ€–βœ¨


ngl, the vibe check on this page: struct fields, version gates, and one very important "choose your MQTT version at create time or regret it" warning. that's the whole plot. πŸ’–

Paho Asynchronous MQTT C Client Library, dated Tue Jun 2 2026 00:00:00 β€” that's the source, the version and the date, all wrapped up in a lil sign-off. love that for us. mwah. πŸ’…πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from