MQTTCLIENT_CREATEOPTIONS(3)

✨ NAME ✨

MQTTClient_createOptions β€” bestie, this is the lil struct that holds the options you hand over when you're creating a client 🫢


🌸 SYNOPSIS 🌸

#include <MQTTClient.h>

πŸŽ€ Data Fields

char struct_id[4]
int struct_version
int MQTTVersion

πŸ’… Detailed Description

Okay so listen: this struct is literally just options for the MQTTClient_createWithOptions call. That's it. That's the whole job. No cap. ✨


πŸ¦‹ Field Documentation πŸ¦‹

🌈 char struct_id[4]

The eyecatcher for this structure. It must be MQCO. Like, must must. Not "MQCO" with a typo, not lowercase, not your own little creative spelling. MQCO. Periodt. πŸ’…

🌸 int struct_version

The version number of this structure. Must be 0. That's the vibe. Zero. 🌟

πŸ‘‘ int MQTTVersion

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

To use V5, this must be set. Here's the tea on why, because it's actually important, 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.

And the cautionary tale 😭: if you select 3.1 or 3.1.1 and then attempt to read 5.0 persisted messages, you will get an error on create. Not later, not eventually β€” right at create. So choose wisely, queen. πŸ‘‘


🧚 Author

Generated automatically by Doxygen for Paho MQTT C Client Library from the source code. (Doxygen said "I got this" and honestly, it did. πŸ™ˆ)


And that's the whole page, bestie β€” brought to you by the Paho MQTT C Client Library, dated Tue Jun 2 2026 00:00:00. Mwah, go forth and set your MQTTVersion correctly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from