Paho Asynchronous MQTT C Client Library
|
Go to the source code of this file.
Data Structures | |
struct | MQTTLenString |
struct | MQTTProperty |
struct | MQTTProperties |
Macros | |
#define | MQTT_INVALID_PROPERTY_ID -2 |
#define | DLLImport extern |
#define | DLLExport __attribute__ ((visibility ("default"))) |
#define | MQTTProperties_initializer {0, 0, 0, NULL} |
Typedefs | |
typedef struct MQTTProperties | MQTTProperties |
#define MQTT_INVALID_PROPERTY_ID -2 |
#define DLLImport extern |
#define DLLExport __attribute__ ((visibility ("default"))) |
#define MQTTProperties_initializer {0, 0, 0, NULL} |
typedef struct MQTTProperties MQTTProperties |
MQTT version 5 property list
enum MQTTPropertyCodes |
The one byte MQTT V5 property indicator
enum MQTTPropertyTypes |
const char* MQTTPropertyName | ( | enum MQTTPropertyCodes | value | ) |
Returns a printable string description of an MQTT V5 property code.
value | an MQTT V5 property code. |
int MQTTProperty_getType | ( | enum MQTTPropertyCodes | value | ) |
Returns the MQTT V5 type code of an MQTT V5 property.
value | an MQTT V5 property code. |
int MQTTProperties_len | ( | MQTTProperties * | props | ) |
Returns the length of the properties structure when serialized ready for network transmission.
props | an MQTT V5 property structure. |
int MQTTProperties_add | ( | MQTTProperties * | props, |
const MQTTProperty * | prop | ||
) |
Add a property pointer to the property array. There is no memory allocation.
props | The property list to add the property to. |
prop | The property to add to the list. |
int MQTTProperties_write | ( | char ** | pptr, |
const MQTTProperties * | properties | ||
) |
Serialize the given property list to a character buffer, e.g. for writing to the network.
pptr | pointer to the buffer - move the pointer as we add data |
properties | pointer to the property list, can be NULL |
int MQTTProperties_read | ( | MQTTProperties * | properties, |
char ** | pptr, | ||
char * | enddata | ||
) |
Reads a property list from a character buffer into an array.
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. |
void MQTTProperties_free | ( | MQTTProperties * | properties | ) |
Free all memory allocated to the property list, including any to individual properties.
properties | pointer to the property list. |
MQTTProperties MQTTProperties_copy | ( | const MQTTProperties * | props | ) |
Copy the contents of a property list, allocating additional memory if needed.
props | pointer to the property list. |
int MQTTProperties_hasProperty | ( | MQTTProperties * | props, |
enum MQTTPropertyCodes | propid | ||
) |
Checks if property list contains a specific property.
props | pointer to the property list. |
propid | the property id to check for. |
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.
props | pointer to the property list. |
propid | the property id to check for. |
int MQTTProperties_getNumericValue | ( | MQTTProperties * | props, |
enum MQTTPropertyCodes | propid | ||
) |
Returns the integer value of a specific property. The property given must be a numeric type.
props | pointer to the property list. |
propid | the property id to check for. |
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.
props | pointer to the property list. |
propid | the property id to check for. |
index | the instance number, starting at 0. |
MQTTProperty* MQTTProperties_getProperty | ( | MQTTProperties * | props, |
enum MQTTPropertyCodes | propid | ||
) |
Returns a pointer to the property structure for a specific property.
props | pointer to the property list. |
propid | the property id to check for. |
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.
props | pointer to the property list. |
propid | the property id to check for. |
index | the instance number, starting at 0. |