天嵌二次封装库使用手册
V2.1.2
|
#include "MQTTExportDeclarations.h"
类 | |
struct | MQTTLenString |
struct | MQTTProperty |
struct | MQTTProperties |
宏定义 | |
#define | MQTT_INVALID_PROPERTY_ID -2 |
#define | MQTTProperties_initializer {0, 0, 0, NULL} |
类型定义 | |
typedef struct MQTTProperties | MQTTProperties |
#define MQTT_INVALID_PROPERTY_ID -2 |
在文件 MQTTProperties.h 第 22 行定义.
#define MQTTProperties_initializer {0, 0, 0, NULL} |
在文件 MQTTProperties.h 第 120 行定义.
typedef struct MQTTProperties MQTTProperties |
MQTT version 5 property list
enum MQTTPropertyCodes |
The one byte MQTT V5 property indicator
在文件 MQTTProperties.h 第 25 行定义.
enum MQTTPropertyTypes |
The one byte MQTT V5 property type
在文件 MQTTProperties.h 第 64 行定义.
LIBMQTT_API 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. |
LIBMQTT_API MQTTProperties MQTTProperties_copy | ( | const MQTTProperties * | props | ) |
Copy the contents of a property list, allocating additional memory if needed.
props | pointer to the property list. |
LIBMQTT_API void MQTTProperties_free | ( | MQTTProperties * | properties | ) |
Free all memory allocated to the property list, including any to individual properties.
properties | pointer to the property list. |
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.
props | pointer to the property list. |
propid | the property id to check for. |
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.
props | pointer to the property list. |
propid | the property id to check for. |
index | the instance number, starting at 0. |
LIBMQTT_API 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. |
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.
props | pointer to the property list. |
propid | the property id to check for. |
index | the instance number, starting at 0. |
LIBMQTT_API 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_len | ( | MQTTProperties * | props | ) |
Returns the length of the properties structure when serialized ready for network transmission.
props | an MQTT V5 property structure. |
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.
props | pointer to the property list. |
propid | the property id to check for. |
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. |
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 |
LIBMQTT_API int MQTTProperty_getType | ( | enum MQTTPropertyCodes | value | ) |
Returns the MQTT V5 type code of an MQTT V5 property.
value | an MQTT V5 property code. |
LIBMQTT_API const char* MQTTPropertyName | ( | enum MQTTPropertyCodes | value | ) |
Returns a printable string description of an MQTT V5 property code.
value | an MQTT V5 property code. |