Classes | Macros | Typedefs | Enumerations | Functions
MQTTProperties.h File Reference
#include "MQTTExportDeclarations.h"
Include dependency graph for MQTTProperties.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MQTTLenString
 
struct  MQTTProperties
 
struct  MQTTProperty
 

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_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

LIBMQTT_API int MQTTProperties_add (MQTTProperties *props, const MQTTProperty *prop)
 
LIBMQTT_API MQTTProperties MQTTProperties_copy (const MQTTProperties *props)
 
LIBMQTT_API void MQTTProperties_free (MQTTProperties *properties)
 
LIBMQTT_API int MQTTProperties_getNumericValue (MQTTProperties *props, enum MQTTPropertyCodes propid)
 
LIBMQTT_API int MQTTProperties_getNumericValueAt (MQTTProperties *props, enum MQTTPropertyCodes propid, int index)
 
LIBMQTT_API MQTTPropertyMQTTProperties_getProperty (MQTTProperties *props, enum MQTTPropertyCodes propid)
 
LIBMQTT_API MQTTPropertyMQTTProperties_getPropertyAt (MQTTProperties *props, enum MQTTPropertyCodes propid, int index)
 
LIBMQTT_API int MQTTProperties_hasProperty (MQTTProperties *props, enum MQTTPropertyCodes propid)
 
int MQTTProperties_len (MQTTProperties *props)
 
LIBMQTT_API int MQTTProperties_propertyCount (MQTTProperties *props, enum MQTTPropertyCodes propid)
 
int MQTTProperties_read (MQTTProperties *properties, char **pptr, char *enddata)
 
int MQTTProperties_write (char **pptr, const MQTTProperties *properties)
 
LIBMQTT_API int MQTTProperty_getType (enum MQTTPropertyCodes value)
 
LIBMQTT_API const char * MQTTPropertyName (enum MQTTPropertyCodes value)
 

Macro Definition Documentation

#define MQTT_INVALID_PROPERTY_ID   -2

Definition at line 22 of file MQTTProperties.h.

#define MQTTProperties_initializer   {0, 0, 0, NULL}

Definition at line 120 of file MQTTProperties.h.

Typedef Documentation

MQTT version 5 property list

Enumeration Type Documentation

The one byte MQTT V5 property indicator

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_IDENTIFER 

The value is 18

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

Definition at line 25 of file MQTTProperties.h.

The one byte MQTT V5 property type

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 

Definition at line 64 of file MQTTProperties.h.

Function Documentation

LIBMQTT_API int MQTTProperties_add ( MQTTProperties props,
const MQTTProperty prop 
)

Add a property pointer to the property array. There is no memory allocation.

Parameters
propsThe property list to add the property to.
propThe property to add to the list.
Returns
0 on success, -1 on failure.

Add a new property to a property list

Parameters
propsthe property list
propthe new property
Returns
code 0 is success

Definition at line 102 of file MQTTProperties.c.

LIBMQTT_API MQTTProperties MQTTProperties_copy ( const MQTTProperties props)

Copy the contents of a property list, allocating additional memory if needed.

Parameters
propspointer to the property list.
Returns
the duplicated property list.

Definition at line 409 of file MQTTProperties.c.

LIBMQTT_API void MQTTProperties_free ( MQTTProperties properties)

Free all memory allocated to the property list, including any to individual properties.

Parameters
propertiespointer to the property list.

Definition at line 378 of file MQTTProperties.c.

LIBMQTT_API int MQTTProperties_getNumericValue ( MQTTProperties props,
enum MQTTPropertyCodes  propid 
)

Returns the integer value of a specific property. The property given must be a numeric type.

Parameters
propspointer to the property list.
propidthe property id to check for.
Returns
the integer value of the property. -9999999 on failure.

Definition at line 499 of file MQTTProperties.c.

LIBMQTT_API int MQTTProperties_getNumericValueAt ( MQTTProperties props,
enum MQTTPropertyCodes  propid,
int  index 
)

Returns the integer value of a specific property when it's not the only instance. The property given must be a numeric type.

Parameters
propspointer to the property list.
propidthe property id to check for.
indexthe instance number, starting at 0.
Returns
the integer value of the property. -9999999 on failure.

Definition at line 459 of file MQTTProperties.c.

LIBMQTT_API MQTTProperty* MQTTProperties_getProperty ( MQTTProperties props,
enum MQTTPropertyCodes  propid 
)

Returns a pointer to the property structure for a specific property.

Parameters
propspointer to the property list.
propidthe property id to check for.
Returns
the pointer to the property structure if found. NULL if not found.

Definition at line 530 of file MQTTProperties.c.

LIBMQTT_API MQTTProperty* MQTTProperties_getPropertyAt ( MQTTProperties props,
enum MQTTPropertyCodes  propid,
int  index 
)

Returns a pointer to the property structure for a specific property when it's not the only instance.

Parameters
propspointer to the property list.
propidthe property id to check for.
indexthe instance number, starting at 0.
Returns
the pointer to the property structure if found. NULL if not found.

Definition at line 505 of file MQTTProperties.c.

LIBMQTT_API int MQTTProperties_hasProperty ( MQTTProperties props,
enum MQTTPropertyCodes  propid 
)

Checks if property list contains a specific property.

Parameters
propspointer to the property list.
propidthe property id to check for.
Returns
1 if found, 0 if not.

Definition at line 428 of file MQTTProperties.c.

int MQTTProperties_len ( MQTTProperties props)

Returns the length of the properties structure when serialized ready for network transmission.

Parameters
propsan MQTT V5 property structure.
Returns
the length in bytes of the properties when serialized.

Definition at line 89 of file MQTTProperties.c.

LIBMQTT_API int MQTTProperties_propertyCount ( MQTTProperties props,
enum MQTTPropertyCodes  propid 
)

Returns the number of instances of a property id. Most properties can exist only once. User properties and subscription ids can exist more than once.

Parameters
propspointer to the property list.
propidthe property id to check for.
Returns
the number of times found. Can be 0.

Definition at line 445 of file MQTTProperties.c.

int MQTTProperties_read ( MQTTProperties properties,
char **  pptr,
char *  enddata 
)

Reads a property list from a character buffer into an array.

Parameters
propertiespointer to the property list to be filled. Should be initalized but empty.
pptrpointer to the character buffer.
enddatapointer to the end of the character buffer so we don't read beyond.
Returns
1 if the properties were read successfully.

Definition at line 282 of file MQTTProperties.c.

int MQTTProperties_write ( char **  pptr,
const MQTTProperties properties 
)

Serialize the given property list to a character buffer, e.g. for writing to the network.

Parameters
pptrpointer to the buffer - move the pointer as we add data
propertiespointer to the property list, can be NULL
Returns
whether the write succeeded or not: number of bytes written, or < 0 on failure.

Definition at line 208 of file MQTTProperties.c.

LIBMQTT_API int MQTTProperty_getType ( enum MQTTPropertyCodes  value)

Returns the MQTT V5 type code of an MQTT V5 property.

Parameters
valuean MQTT V5 property code.
Returns
the MQTT V5 type code of the input property. -1 if the code was not found.

Definition at line 73 of file MQTTProperties.c.

LIBMQTT_API const char* MQTTPropertyName ( enum MQTTPropertyCodes  value)

Returns a printable string description of an MQTT V5 property code.

Parameters
valuean MQTT V5 property code.
Returns
the printable string description of the input property code. NULL if the code was not found.

Definition at line 361 of file MQTTProperties.c.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:49