MQTTClient_message(3)
π MQTTClient_message π
okay bestie, welcome to the MQTTClient_message page β this is a manual from the Library Functions Manual and it's literally the little struct that holds a whole MQTT message's payload + vibes. let's get into it β¨
β¨ SYNOPSIS β¨
#include <MQTTClient.h>
π Data Fields π
here's the whole glow-up, field by field:
char struct_id [4]int struct_versionint payloadlenvoid * payloadint qosint retainedint dupint msgidMQTTProperties properties
πΈ Detailed Description πΈ
so, this is a structure representing the payload and attributes of an MQTT message. that's the whole job. it's giving "everything you need to know about this message except the topic" π
and no, the message topic is not part of this structure, no cap. if you want the topic you gotta go hang out with these besties instead:
MQTTClient_publishMessage()MQTTClient_publish()MQTTClient_receive()MQTTClient_freeMessage()MQTTClient_messageArrived()
π¦ Field Documentation π¦
char struct_id[4]
the eyecatcher for this structure π must be MQTM. like, that's the vibe check, and if it's not MQTM it didn't pass. periodt.
int struct_version
the version number of this structure. Must be 0 or 1. a 0 indicates no message properties π«Ά
int payloadlen
the length of the MQTT message payload, in bytes. just the count, bestie, not the actual stuff.
void* payload
a pointer to the payload of the MQTT message. there it is. the goods. β¨
int qos
the quality of service (QoS) assigned to the message. there are three levels of QoS:
- QoS0 β fire and forget π₯ β the message may not be delivered.
- QoS1 β at least once β the message will be delivered, but may be delivered more than once in some circumstances π (yes really, keep that in mind).
- QoS2 β once and one only β the message will be delivered exactly once. iconic. no notes. π
int retained
the retained flag serves two purposes depending on whether the message it is associated with is being published or received. okay so watch closely:
retained = trueβ for messages being published, a true setting indicates that the MQTT server should retain a copy of the message. The message will then be transmitted to new subscribers to a topic that matches the message topic. For subscribers registering a new subscription, the flag being true indicates that the received message is not a new one, but one that has been retained by the MQTT server.retained = falseβ for publishers, this indicates that this message should not be retained by the MQTT server. For subscribers, a false setting indicates this is a normal message, received as a result of it being published to the server.
int dup
the dup flag indicates whether or not this message is a duplicate. β οΈ it is only meaningful when receiving QoS1 messages. when true, the client application should take appropriate action to deal with the duplicate message. so like, don't sleep on it.
int msgid
the message identifier is normally reserved for internal use by the MQTT client and server. π like, it's theirs, not yours. hands off bestie.
MQTTProperties properties
the MQTT V5 properties associated with the message. yes, V5, we love a modern era. π
π Author π
Generated automatically by Doxygen for Paho MQTT C Client Library from the source code. so like, nobody hand-wrote this, the robots did it, and honestly? ate. π€β¨
and that's the whole page bestie!! this one came from the <strong>Paho MQTT C Client Library</strong>, dated <strong>Tue Jun 2 2026 00:00:00</strong>, and yeah it's page <strong>MQTTClient_message(3)</strong> β section 3, library functions, iykyk. stay slay, go publish something cute πππ¦
π¦ 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