MQTTProperties.h(3)
πΈ MQTTProperties.h πΈ
okay bestie, welcome to MQTTProperties.h(3), straight out of the Library Functions Manual π
this is the header that holds all the MQTT version 5 property stuff, and it's lowkey a lot, so grab a snack π
β¨ NAME β¨
MQTTProperties.h β that's it, that's the name, no cap π
β¨ SYNOPSIS β¨
#include 'MQTTExportDeclarations.h'
#include <stdint.h>
π¦ Data Structures
struct MQTTLenStringstruct MQTTPropertystruct MQTTProperties
π¦ Macros
#define MQTT_INVALID_PROPERTY_ID -2
#define MQTTProperties_initializer {0, 0, 0, NULL}
π¦ Typedefs
typedef struct MQTTProperties MQTTProperties
π¦ Enumerations
enum MQTTPropertyCodes { MQTTPROPERTY_CODE_PAYLOAD_FORMAT_INDICATOR = 1,
MQTTPROPERTY_CODE_MESSAGE_EXPIRY_INTERVAL = 2,
MQTTPROPERTY_CODE_CONTENT_TYPE = 3, MQTTPROPERTY_CODE_RESPONSE_TOPIC
= 8, MQTTPROPERTY_CODE_CORRELATION_DATA = 9,
MQTTPROPERTY_CODE_SUBSCRIPTION_IDENTIFIER = 11,
MQTTPROPERTY_CODE_SESSION_EXPIRY_INTERVAL = 17,
MQTTPROPERTY_CODE_ASSIGNED_CLIENT_IDENTIFIER = 18,
MQTTPROPERTY_CODE_ASSIGNED_CLIENT_IDENTIFER = 18,
MQTTPROPERTY_CODE_SERVER_KEEP_ALIVE = 19,
MQTTPROPERTY_CODE_AUTHENTICATION_METHOD = 21,
MQTTPROPERTY_CODE_AUTHENTICATION_DATA = 22,
MQTTPROPERTY_CODE_REQUEST_PROBLEM_INFORMATION = 23,
MQTTPROPERTY_CODE_WILL_DELAY_INTERVAL = 24,
MQTTPROPERTY_CODE_REQUEST_RESPONSE_INFORMATION = 25,
MQTTPROPERTY_CODE_RESPONSE_INFORMATION = 26,
MQTTPROPERTY_CODE_SERVER_REFERENCE = 28,
MQTTPROPERTY_CODE_REASON_STRING = 31,
MQTTPROPERTY_CODE_RECEIVE_MAXIMUM = 33,
MQTTPROPERTY_CODE_TOPIC_ALIAS_MAXIMUM = 34,
MQTTPROPERTY_CODE_TOPIC_ALIAS = 35, MQTTPROPERTY_CODE_MAXIMUM_QOS =
36, MQTTPROPERTY_CODE_RETAIN_AVAILABLE = 37,
MQTTPROPERTY_CODE_USER_PROPERTY = 38,
MQTTPROPERTY_CODE_MAXIMUM_PACKET_SIZE = 39,
MQTTPROPERTY_CODE_WILDCARD_SUBSCRIPTION_AVAILABLE = 40,
MQTTPROPERTY_CODE_SUBSCRIPTION_IDENTIFIERS_AVAILABLE = 41,
MQTTPROPERTY_CODE_SHARED_SUBSCRIPTION_AVAILABLE = 42 }
enum MQTTPropertyTypes { MQTTPROPERTY_TYPE_BYTE,
MQTTPROPERTY_TYPE_TWO_BYTE_INTEGER,
MQTTPROPERTY_TYPE_FOUR_BYTE_INTEGER,
MQTTPROPERTY_TYPE_VARIABLE_BYTE_INTEGER,
MQTTPROPERTY_TYPE_BINARY_DATA,
MQTTPROPERTY_TYPE_UTF_8_ENCODED_STRING,
MQTTPROPERTY_TYPE_UTF_8_STRING_PAIR }
π¦ Functions
const char * MQTTPropertyName (enum MQTTPropertyCodes value)
int MQTTProperty_getType (enum MQTTPropertyCodes value)
int MQTTProperties_len (const MQTTProperties *props)
int MQTTProperties_add (MQTTProperties *props, const MQTTProperty *prop)
int MQTTProperties_write (char **pptr, const MQTTProperties *properties)
int MQTTProperties_read (MQTTProperties *properties, char **pptr, char
*enddata)
void MQTTProperties_free (MQTTProperties *properties)
MQTTProperties MQTTProperties_copy (const MQTTProperties *props)
int MQTTProperties_hasProperty (const MQTTProperties *props, enum
MQTTPropertyCodes propid)
int MQTTProperties_propertyCount (const MQTTProperties *props, enum
MQTTPropertyCodes propid)
int64_t MQTTProperties_getNumericValue (const MQTTProperties *props,
enum MQTTPropertyCodes propid)
int64_t MQTTProperties_getNumericValueAt (const MQTTProperties *props,
enum MQTTPropertyCodes propid, int index)
MQTTProperty * MQTTProperties_getProperty (const MQTTProperties *props,
enum MQTTPropertyCodes propid)
MQTTProperty * MQTTProperties_getPropertyAt (const MQTTProperties
*props, enum MQTTPropertyCodes propid, int index)
β¨ Macro Definition Documentation β¨
#define MQTT_INVALID_PROPERTY_ID -2β the "this property id is not it" sentinel π#define MQTTProperties_initializer {0, 0, 0, NULL}β the little starter pack for your properties struct π«Ά
β¨ Typedef Documentation β¨
π typedef struct MQTTProperties MQTTProperties
MQTT version 5 property list, periodt. that's the whole vibe β¨
β¨ Enumeration Type Documentation β¨
π enum MQTTPropertyCodes
The one byte MQTT V5 property indicator. okay so this is the big one, here come all the enumerators π
Enumerator
MQTTPROPERTY_CODE_PAYLOAD_FORMAT_INDICATORβ The value is 1MQTTPROPERTY_CODE_MESSAGE_EXPIRY_INTERVALβ The value is 2MQTTPROPERTY_CODE_CONTENT_TYPEβ The value is 3MQTTPROPERTY_CODE_RESPONSE_TOPICβ The value is 8MQTTPROPERTY_CODE_CORRELATION_DATAβ The value is 9MQTTPROPERTY_CODE_SUBSCRIPTION_IDENTIFIERβ The value is 11MQTTPROPERTY_CODE_SESSION_EXPIRY_INTERVALβ The value is 17MQTTPROPERTY_CODE_ASSIGNED_CLIENT_IDENTIFIERβ The value is 18MQTTPROPERTY_CODE_ASSIGNED_CLIENT_IDENTIFERβ The value is 18 (obsolete, misspelled) π yes bestie, the typo is canon, it lives here foreverMQTTPROPERTY_CODE_SERVER_KEEP_ALIVEβ The value is 19MQTTPROPERTY_CODE_AUTHENTICATION_METHODβ The value is 21MQTTPROPERTY_CODE_AUTHENTICATION_DATAβ The value is 22MQTTPROPERTY_CODE_REQUEST_PROBLEM_INFORMATIONβ The value is 23MQTTPROPERTY_CODE_WILL_DELAY_INTERVALβ The value is 24MQTTPROPERTY_CODE_REQUEST_RESPONSE_INFORMATIONβ The value is 25MQTTPROPERTY_CODE_RESPONSE_INFORMATIONβ The value is 26MQTTPROPERTY_CODE_SERVER_REFERENCEβ The value is 28MQTTPROPERTY_CODE_REASON_STRINGβ The value is 31MQTTPROPERTY_CODE_RECEIVE_MAXIMUMβ The value is 33MQTTPROPERTY_CODE_TOPIC_ALIAS_MAXIMUMβ The value is 34MQTTPROPERTY_CODE_TOPIC_ALIASβ The value is 35MQTTPROPERTY_CODE_MAXIMUM_QOSβ The value is 36MQTTPROPERTY_CODE_RETAIN_AVAILABLEβ The value is 37MQTTPROPERTY_CODE_USER_PROPERTYβ The value is 38MQTTPROPERTY_CODE_MAXIMUM_PACKET_SIZEβ The value is 39MQTTPROPERTY_CODE_WILDCARD_SUBSCRIPTION_AVAILABLEβ The value is 40MQTTPROPERTY_CODE_SUBSCRIPTION_IDENTIFIERS_AVAILABLEβ The value is 41MQTTPROPERTY_CODE_SHARED_SUBSCRIPTION_AVAILABLEβ The value is 241
not me noticing that up in the SYNOPSIS it says MQTTPROPERTY_CODE_SHARED_SUBSCRIPTION_AVAILABLE = 42 and down here it says The value is 241 π bestie I'm just the messenger, I'm reporting exactly what the page says, both of them, no editing π
π enum MQTTPropertyTypes
The one byte MQTT V5 property type, slay β¨
Enumerator
MQTTPROPERTY_TYPE_BYTEMQTTPROPERTY_TYPE_TWO_BYTE_INTEGERMQTTPROPERTY_TYPE_FOUR_BYTE_INTEGERMQTTPROPERTY_TYPE_VARIABLE_BYTE_INTEGERMQTTPROPERTY_TYPE_BINARY_DATAMQTTPROPERTY_TYPE_UTF_8_ENCODED_STRINGMQTTPROPERTY_TYPE_UTF_8_STRING_PAIR
okay that's part 1 bestie, there's more coming, don't go anywhere πΈ
π FUNCTION DOCUMENTATION π
okay bestie, this is the part where we meet the actual functions. the doers. the main characters. every single one is getting her moment, no skips, no shortcuts, we're doing the whole roster π
πΈ const char * MQTTPropertyName (enum MQTTPropertyCodes value) [extern]
gives you a cute lil printable string description of an MQTT V5 property code. it's giving "translate the number into words for me bestie" β¨
Parameters
valueβ an MQTT V5 property code.
Returns
the printable string description of the input property code. and if the code wasn't found? you get NULL. tragic, but that's the deal π
πΈ int MQTTProperty_getType (enum MQTTPropertyCodes value) [extern]
hands you the MQTT V5 type code of an MQTT V5 property. lowkey the "what kind of girl is this property" function π
Parameters
valueβ an MQTT V5 property code.
Returns
the MQTT V5 type code of the input property. if the code wasn't found, you get -1. rude but consistent.
πΈ int MQTTProperties_len (const MQTTProperties * props)
tells you how long the properties structure is once it's serialized and ready to be yeeted over the network π‘
Parameters
propsβ an MQTT V5 property structure.
Returns
the length in bytes of the properties when serialized. numbers, we love numbers.
πΈ int MQTTProperties_add (MQTTProperties * props, const MQTTProperty * prop) [extern]
adds a property pointer to the property array. now listen, this one is IMPORTANT β memory gets allocated in this function, so you must call MQTTClient_create or MQTTAsync_create first to initialize the internal heap tracking. alternatively MQTTAsync_global_init() can be called first, or you can build with the HIGH_PERFORMANCE option which disables the heap tracking entirely. pick your fighter, bestie π
Parameters
propsβ The property list to add the property to.propβ The property to add to the list.
Returns
0 on success, -1 on failure. she's simple like that.
πΈ int MQTTProperties_write (char ** pptr, const MQTTProperties * properties)
serializes the given property list into a character buffer, like for writing to the network. the glow-up from struct to bytes, iconic β¨
Parameters
pptrβ pointer to the buffer - move the pointer as we add datapropertiesβ pointer to the property list, can beNULL
Returns
whether the write succeeded or not: number of bytes written, or < 0 on failure. π
πΈ int MQTTProperties_read (MQTTProperties * properties, char ** pptr, char * enddata)
reads a property list from a character buffer into an array. the reverse glow-up π¦
Parameters
propertiesβ pointer to the property list to be filled. Should be initalized but empty.pptrβ pointer to the character buffer.enddataβ pointer to the end of the character buffer so we don't read beyond.
Returns
1 if the properties were read successfully. that's it, that's the whole answer.
πΈ void MQTTProperties_free (MQTTProperties * properties) [extern]
frees all memory allocated to the property list, including any memory allocated to individual properties. clean up after yourself, queen π§Ή
Parameters
propertiesβ pointer to the property list.
πΈ MQTTProperties MQTTProperties_copy (const MQTTProperties * props) [extern]
copies the contents of a property list, allocating additional memory if needed. the "i want what she has" function π«Ά
Parameters
propsβ pointer to the property list.
Returns
the duplicated property list.
πΈ int MQTTProperties_hasProperty (const MQTTProperties * props, enum MQTTPropertyCodes propid) [extern]
checks if the property list contains a specific property. a vibe check, essentially π
Parameters
propsβ pointer to the property list.propidβ the property id to check for.
Returns
1 if found, 0 if not.
πΈ int MQTTProperties_propertyCount (const MQTTProperties * props, enum MQTTPropertyCodes propid) [extern]
returns the number of instances of a property id. heads up: most properties can exist only once. but user properties and subscription ids can exist more than once. yes, some of them are polyamorous, it's fine π
Parameters
propsβ pointer to the property list.propidβ the property id to check for.
Returns
the number of times found. Can be 0. and 0 is a valid answer, not a personal attack.
πΈ int64_t MQTTProperties_getNumericValue (const MQTTProperties * props, enum MQTTPropertyCodes propid) [extern]
returns the integer value of a specific property. the property given must be a numeric type β do not try this on a non-numeric property, she will not participate β οΈ
Parameters
propsβ pointer to the property list.propidβ the property id to check for.
Returns
the integer value of the property. and if it fails? -9999999. yes really, that's the failure value, memorise it.
πΈ int64_t MQTTProperties_getNumericValueAt (const MQTTProperties * props, enum MQTTPropertyCodes propid, int index) [extern]
same energy as above, but for when the property is not the only instance. the property given must be a numeric type, same rules, same warning π₯
Parameters
propsβ pointer to the property list.propidβ the property id to check for.indexβ the instance number, starting at0.
Returns
the integer value of the property. -9999999 on failure. she's consistent, gotta respect it.
πΈ MQTTProperty * MQTTProperties_getProperty (const MQTTProperties * props, enum MQTTPropertyCodes propid) [extern]
returns a pointer to the property structure for a specific property. the "hand me the actual thing, not just the description" function π
Parameters
propsβ pointer to the property list.propidβ the property id to check for.
Returns
the pointer to the property structure if found. NULL if not found. bestie if it's NULL it's simply not there, accept and move on π
πΈ MQTTProperty * MQTTProperties_getPropertyAt (const MQTTProperties * props, enum MQTTPropertyCodes propid, int index) [extern]
returns a pointer to the property structure for a specific property when it's not the only instance. the "which one though" version π
Parameters
propsβ pointer to the property list.propidβ the property id to check for.indexβ the instance number, starting at0.
Returns
the pointer to the property structure if found. NULL if not found.
β¨ AUTHOR β¨
Generated automatically by Doxygen for Paho MQTT C Client Library from the source code. no human girlboss wrote this by hand, the robots did it fr fr π€π
okay that's the whole page bestie!! this was Paho MQTT C Client Library, dated Tue Jun 2 2026 00:00:00, and you've officially made it through MQTTProperties.h(3) in its entirety ππ¦β¨
go forth and manage your properties, you absolute icon π ππ
π¦ 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