MQTTASYNC_DISCONNECTOPTIONS(3)

πŸ’– NAME πŸ’–

MQTTAsync_disconnectOptions β€” the little struct that holds all your ~options~ for the MQTTAsync_disconnect call. She's from the Library Functions Manual, bestie, and she's here to help you log off gracefully. πŸŽ€


🌸 SYNOPSIS 🌸

#include <MQTTAsync.h>

πŸ¦‹ Data Fields πŸ¦‹

char struct_id[4]
int struct_version
int timeout
MQTTAsync_onSuccess * onSuccess
MQTTAsync_onFailure * onFailure
void * context
MQTTProperties properties
enum MQTTReasonCodes reasonCode
MQTTAsync_onSuccess5 * onSuccess5
MQTTAsync_onFailure5 * onFailure5

✨ Detailed Description ✨

Okay so literally this is just the options struct for the MQTTAsync_disconnect call. That's the whole vibe. She holds everything you need to say bye to your broker on your own terms. πŸ’…


πŸ’… Field Documentation πŸ’…

char struct_id[4]

The eyecatcher for this structure. Must be MQTD. No cap β€” it must be MQTD, it's the lil signature that says "hi yes I am a real struct, I promise". πŸ”₯

int struct_version

The version number of this structure. Must be 0 or 1. A 0 signifies no V5 properties. Pick your fighter, bestie. πŸ‘‘

int timeout

The client delays disconnection for up to this time (in milliseconds) in order to allow in-flight message transfers to complete. So it's giving "hold on hold on I'm still finishing my sentence" energy, but in milliseconds. πŸ¦‹

MQTTAsync_onSuccess* onSuccess

A pointer to a callback function to be called if the disconnect successfully completes. Can be set to NULL, in which case no indication of successful completion will be received. Set it to NULL and you're just raw-dogging the void, fr fr β€” you'll never know if it worked. 😭

MQTTAsync_onFailure* onFailure

A pointer to a callback function to be called if the disconnect fails. Can be set to NULL, in which case no indication of unsuccessful completion will be received. Same deal β€” no callback, no clue. πŸ™ˆ

void* context

A pointer to any application-specific context. The

the context pointer is passed to success or failure callback functions to provide access to the context information in the callback.

(Yes the original really has that lil stumble in the middle, we don't gatekeep, we just pass it along. ✨)

MQTTProperties properties

MQTT V5 input properties. All the fancy V5 extras live here. 🌈

enum MQTTReasonCodes reasonCode

Reason code for MQTTV5 disconnect. Tell the broker why you're leaving, like a polite lil note on the way out. πŸ“

MQTTAsync_onSuccess5* onSuccess5

A pointer to a callback function to be called if the disconnect successfully completes. Can be set to NULL, in which case no indication of successful completion will be received. It's the V5 flavoured sibling of onSuccess, same rules, same NULL consequences. πŸ’œ

MQTTAsync_onFailure5* onFailure5

A pointer to a callback function to be called if the disconnect fails. Can be set to NULL, in which case no indication of unsuccessful completion will be received. V5 twin of onFailure, matching energy, matching NULL warnings. ⭐


🧚 Author 🧚

Generated automatically by Doxygen for Paho Asynchronous MQTT C Client Library from the source code.


That's the whole page, bestie β€” every field, every NULL warning, every millisecond, all accounted for. Go disconnect responsibly. 🫢

Paho Asynchronous MQTT C Client Library Β· Tue Jun 2 2026 00:00:00 Β· MQTTAsync_disconnectOptions, out πŸ’–

πŸ“¦ where this page comes from