MQTTAsync_willOptions(3)
π MQTTAsync_willOptions π (NAME)
okay bestie, welcome to the MQTTAsync_willOptions page from the Library Functions Manual β this is the struct that holds your client's goodbye note π«Ά
β¨ SYNOPSIS β¨
#include <MQTTAsync.h>
π Data Fields π
char struct_id [4]
int struct_version
const char * topicName
const char * message
int retained
int qos
struct {
int len
const void * data
} payload
πΈ Detailed Description πΈ
so like. MQTTAsync_willOptions defines the MQTT "Last Will and Testament" (LWT) settings for the client. and the way this works is iconic: if a client unexpectedly loses its connection to the server, the server publishes the LWT message to the LWT topic on behalf of the client. that means every other client subscribed to that LWT topic finds out the client has disconnected. no ghosting, no silence. π
to enable the LWT function for a specific client, you pass a valid pointer to an MQTTAsync_willOptions structure in the MQTTAsync_connectOptions structure used in the MQTTAsync_connect() call that connects the client to the server. and if you don't want the LWT function at all? that pointer can just be set to NULL. simple. periodt. β¨
π₯ Field Documentation π₯
π char struct_id[4]
the eyecatcher for this structure. must be MQTW. no cap, it has to be that exact thing.
π int struct_version
the version number of this structure. must be 0 or 1 β 0 indicates no binary will message support.
π¦ const char* topicName
the LWT topic that the LWT message will be published to. π
π const char* message
the LWT payload.
π int retained
the retained flag for the LWT message β peep MQTTAsync_message.retained if you need the deets.
β int qos
the quality of service setting for the LWT message β see MQTTAsync_message.qos and Quality of service.
π§ int len
binary payload length.
π const void* data
binary payload data.
π struct { ... } payload
the LWT payload in binary form. heads up though: this is only checked and used if the message option is NULL. so if you filled in message, this one's just sitting there minding its own business. π
π Author π
Generated automatically by Doxygen for Paho Asynchronous MQTT C Client Library from the source code. (not me writing it by hand, the robots did it π )
okay that's the whole page bestie, mwah π this was Paho Asynchronous MQTT C Client Library, dated Tue Jun 2 2026 00:00:00 β go forth and write your wills responsibly, ily π«Άβ¨
π¦ where this page comes from
- fedora 44: paho-c-devel 1.3.16-1.fc44 Β· BSD-3-Clause AND EPL-2.0
- fedora 44: paho-c-devel 1.3.16-1.fc44 Β· BSD-3-Clause AND EPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms