#include "MQTTProperties.h"
#include "MQTTPacket.h"
#include "MQTTProtocolClient.h"
#include "Heap.h"
#include "StackTrace.h"
#include <memory.h>
Go to the source code of this file.
|
static char * | datadup (const MQTTLenString *str) |
|
int | MQTTProperties_add (MQTTProperties *props, const MQTTProperty *prop) |
|
MQTTProperties | MQTTProperties_copy (const MQTTProperties *props) |
|
void | MQTTProperties_free (MQTTProperties *props) |
|
int | MQTTProperties_getNumericValue (MQTTProperties *props, enum MQTTPropertyCodes propid) |
|
int | MQTTProperties_getNumericValueAt (MQTTProperties *props, enum MQTTPropertyCodes propid, int index) |
|
MQTTProperty * | MQTTProperties_getProperty (MQTTProperties *props, enum MQTTPropertyCodes propid) |
|
MQTTProperty * | MQTTProperties_getPropertyAt (MQTTProperties *props, enum MQTTPropertyCodes propid, int index) |
|
int | MQTTProperties_hasProperty (MQTTProperties *props, enum MQTTPropertyCodes propid) |
|
int | MQTTProperties_len (MQTTProperties *props) |
|
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) |
|
int | MQTTProperty_getType (enum MQTTPropertyCodes value) |
|
int | MQTTProperty_read (MQTTProperty *prop, char **pptr, char *enddata) |
|
int | MQTTProperty_write (char **pptr, MQTTProperty *prop) |
|
const char * | MQTTPropertyName (enum MQTTPropertyCodes value) |
|
#define ARRAY_SIZE |
( |
|
a | ) |
(sizeof(a) / sizeof(a[0])) |
Add a new property to a property list
- Parameters
-
props | the property list |
prop | the new property |
- Returns
- code 0 is success
Definition at line 102 of file MQTTProperties.c.
Copy the contents of a property list, allocating additional memory if needed.
- Parameters
-
props | pointer to the property list. |
- Returns
- the duplicated property list.
Definition at line 409 of file MQTTProperties.c.
Free all memory allocated to the property list, including any to individual properties.
- Parameters
-
properties | pointer to the property list. |
Definition at line 378 of file MQTTProperties.c.
Returns the integer value of a specific property. The property given must be a numeric type.
- Parameters
-
props | pointer to the property list. |
propid | the property id to check for. |
- Returns
- the integer value of the property. -9999999 on failure.
Definition at line 499 of file MQTTProperties.c.
Returns the integer value of a specific property when it's not the only instance. The property given must be a numeric type.
- 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.
Definition at line 459 of file MQTTProperties.c.
Returns a pointer to the property structure for a specific property.
- 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.
Definition at line 530 of file MQTTProperties.c.
Returns a pointer to the property structure for a specific property when it's not the only instance.
- 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.
Definition at line 505 of file MQTTProperties.c.
Checks if property list contains a specific property.
- Parameters
-
props | pointer to the property list. |
propid | the property id to check for. |
- Returns
- 1 if found, 0 if not.
Definition at line 428 of file MQTTProperties.c.
Returns the length of the properties structure when serialized ready for network transmission.
- Parameters
-
props | an MQTT V5 property structure. |
- Returns
- the length in bytes of the properties when serialized.
Definition at line 89 of file MQTTProperties.c.
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
-
props | pointer to the property list. |
propid | the 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
-
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.
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
-
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.
Definition at line 208 of file MQTTProperties.c.
Returns the MQTT V5 type code of an MQTT V5 property.
- Parameters
-
value | an 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.
int MQTTProperty_read |
( |
MQTTProperty * |
prop, |
|
|
char ** |
pptr, |
|
|
char * |
enddata |
|
) |
| |
int MQTTProperty_write |
( |
char ** |
pptr, |
|
|
MQTTProperty * |
prop |
|
) |
| |
Returns a printable string description of an MQTT V5 property code.
- Parameters
-
value | an 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.
struct { ... } nameToString[] |