Macros | |
#define | DLLExport |
#define | DLLImport |
Functions | |
DLLExport int | MQTTDeserialize_publish (unsigned char *dup, int *qos, unsigned char *retained, unsigned short *packetid, MQTTString *topicName, unsigned char **payload, int *payloadlen, unsigned char *buf, int len) |
Deserializes the supplied (wire) buffer into publish data. More... | |
DLLExport int | MQTTSerialize_puback (unsigned char *buf, int buflen, unsigned short packetid) |
Serializes a puback packet into the supplied buffer. More... | |
DLLExport int | MQTTSerialize_pubcomp (unsigned char *buf, int buflen, unsigned short packetid) |
Serializes a pubrel packet into the supplied buffer. More... | |
DLLExport int | MQTTSerialize_publish (unsigned char *buf, int buflen, unsigned char dup, int qos, unsigned char retained, unsigned short packetid, MQTTString topicName, unsigned char *payload, int payloadlen) |
Serializes the supplied publish data into the supplied buffer, ready for sending. More... | |
DLLExport int | MQTTSerialize_pubrel (unsigned char *buf, int buflen, unsigned char dup, unsigned short packetid) |
Serializes a pubrel packet into the supplied buffer. More... | |
#define DLLExport |
#define DLLImport |
DLLExport int MQTTDeserialize_publish | ( | unsigned char * | dup, |
int * | qos, | ||
unsigned char * | retained, | ||
unsigned short * | packetid, | ||
MQTTString * | topicName, | ||
unsigned char ** | payload, | ||
int * | payloadlen, | ||
unsigned char * | buf, | ||
int | buflen | ||
) |
Deserializes the supplied (wire) buffer into publish data.
dup | returned integer - the MQTT dup flag |
qos | returned integer - the MQTT QoS value |
retained | returned integer - the MQTT retained flag |
packetid | returned integer - the MQTT packet identifier |
topicName | returned MQTTString - the MQTT topic in the publish |
payload | returned byte buffer - the MQTT publish payload |
payloadlen | returned integer - the length of the MQTT payload |
buf | the raw buffer data, of the correct length determined by the remaining length field |
buflen | the length in bytes of the data in the supplied buffer |
References MQTTHeader::bits, MQTTHeader::byte, MQTTHeader::dup, FUNC_ENTRY, FUNC_EXIT_RC, header, MQTTPacket_decodeBuf(), NULL, PUBLISH, MQTTHeader::qos, readChar(), readInt(), readMQTTLenString(), MQTTHeader::retain, and MQTTHeader::type.
Referenced by cycle(), MQTTFormat_toClientString(), and MQTTFormat_toServerString().
DLLExport int MQTTSerialize_puback | ( | unsigned char * | buf, |
int | buflen, | ||
unsigned short | packetid | ||
) |
Serializes a puback packet into the supplied buffer.
buf | the buffer into which the packet will be serialized |
buflen | the length in bytes of the supplied buffer |
packetid | integer - the MQTT packet identifier |
References MQTTSerialize_ack(), and PUBACK.
DLLExport int MQTTSerialize_pubcomp | ( | unsigned char * | buf, |
int | buflen, | ||
unsigned short | packetid | ||
) |
Serializes a pubrel packet into the supplied buffer.
buf | the buffer into which the packet will be serialized |
buflen | the length in bytes of the supplied buffer |
packetid | integer - the MQTT packet identifier |
References MQTTSerialize_ack(), and PUBCOMP.
DLLExport int MQTTSerialize_publish | ( | unsigned char * | buf, |
int | buflen, | ||
unsigned char | dup, | ||
int | qos, | ||
unsigned char | retained, | ||
unsigned short | packetid, | ||
MQTTString | topicName, | ||
unsigned char * | payload, | ||
int | payloadlen | ||
) |
Serializes the supplied publish data into the supplied buffer, ready for sending.
buf | the buffer into which the packet will be serialized |
buflen | the length in bytes of the supplied buffer |
dup | integer - the MQTT dup flag |
qos | integer - the MQTT QoS value |
retained | integer - the MQTT retained flag |
packetid | integer - the MQTT packet identifier |
topicName | MQTTString - the MQTT topic in the publish |
payload | byte buffer - the MQTT publish payload |
payloadlen | integer - the length of the MQTT payload |
References MQTTHeader::bits, MQTTHeader::byte, MQTTHeader::dup, FUNC_ENTRY, FUNC_EXIT_RC, header, MQTTPACKET_BUFFER_TOO_SHORT, MQTTPacket_encode(), MQTTPacket_len(), MQTTSerialize_publishLength(), ptr, PUBLISH, MQTTHeader::qos, MQTTHeader::retain, MQTTHeader::type, writeChar(), writeInt(), and writeMQTTString().
Referenced by MQTTPublish().
DLLExport int MQTTSerialize_pubrel | ( | unsigned char * | buf, |
int | buflen, | ||
unsigned char | dup, | ||
unsigned short | packetid | ||
) |
Serializes a pubrel packet into the supplied buffer.
buf | the buffer into which the packet will be serialized |
buflen | the length in bytes of the supplied buffer |
dup | integer - the MQTT dup flag |
packetid | integer - the MQTT packet identifier |
References MQTTSerialize_ack(), and PUBREL.