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 MQTTLenString
  • struct MQTTProperty
  • struct 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 1
  • MQTTPROPERTY_CODE_MESSAGE_EXPIRY_INTERVAL β€” The value is 2
  • MQTTPROPERTY_CODE_CONTENT_TYPE β€” The value is 3
  • MQTTPROPERTY_CODE_RESPONSE_TOPIC β€” The value is 8
  • MQTTPROPERTY_CODE_CORRELATION_DATA β€” The value is 9
  • MQTTPROPERTY_CODE_SUBSCRIPTION_IDENTIFIER β€” The value is 11
  • MQTTPROPERTY_CODE_SESSION_EXPIRY_INTERVAL β€” The value is 17
  • MQTTPROPERTY_CODE_ASSIGNED_CLIENT_IDENTIFIER β€” The value is 18
  • MQTTPROPERTY_CODE_ASSIGNED_CLIENT_IDENTIFER β€” The value is 18 (obsolete, misspelled) πŸ™ˆ yes bestie, the typo is canon, it lives here forever
  • MQTTPROPERTY_CODE_SERVER_KEEP_ALIVE β€” The value is 19
  • MQTTPROPERTY_CODE_AUTHENTICATION_METHOD β€” The value is 21
  • MQTTPROPERTY_CODE_AUTHENTICATION_DATA β€” The value is 22
  • MQTTPROPERTY_CODE_REQUEST_PROBLEM_INFORMATION β€” The value is 23
  • MQTTPROPERTY_CODE_WILL_DELAY_INTERVAL β€” The value is 24
  • MQTTPROPERTY_CODE_REQUEST_RESPONSE_INFORMATION β€” The value is 25
  • MQTTPROPERTY_CODE_RESPONSE_INFORMATION β€” The value is 26
  • MQTTPROPERTY_CODE_SERVER_REFERENCE β€” The value is 28
  • MQTTPROPERTY_CODE_REASON_STRING β€” The value is 31
  • MQTTPROPERTY_CODE_RECEIVE_MAXIMUM β€” The value is 33
  • MQTTPROPERTY_CODE_TOPIC_ALIAS_MAXIMUM β€” The value is 34
  • MQTTPROPERTY_CODE_TOPIC_ALIAS β€” The value is 35
  • MQTTPROPERTY_CODE_MAXIMUM_QOS β€” The value is 36
  • MQTTPROPERTY_CODE_RETAIN_AVAILABLE β€” The value is 37
  • MQTTPROPERTY_CODE_USER_PROPERTY β€” The value is 38
  • MQTTPROPERTY_CODE_MAXIMUM_PACKET_SIZE β€” The value is 39
  • MQTTPROPERTY_CODE_WILDCARD_SUBSCRIPTION_AVAILABLE β€” The value is 40
  • MQTTPROPERTY_CODE_SUBSCRIPTION_IDENTIFIERS_AVAILABLE β€” The value is 41
  • MQTTPROPERTY_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_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

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 data
  • properties β€” pointer to the property list, can be NULL

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 at 0.

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 at 0.

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