Functions | |
int | MQTTSerialize_ack (unsigned char *buf, int buflen, unsigned char packettype, unsigned char dup, unsigned short packetid) |
Serializes the ack packet into the supplied buffer. More... | |
int | MQTTSerialize_puback (unsigned char *buf, int buflen, unsigned short packetid) |
Serializes a puback packet into the supplied buffer. More... | |
int | MQTTSerialize_pubcomp (unsigned char *buf, int buflen, unsigned short packetid) |
Serializes a pubrel packet into the supplied buffer. More... | |
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... | |
int | MQTTSerialize_publishLength (int qos, MQTTString topicName, int payloadlen) |
Determines the length of the MQTT publish packet that would be produced using the supplied parameters. More... | |
int | MQTTSerialize_pubrel (unsigned char *buf, int buflen, unsigned char dup, unsigned short packetid) |
Serializes a pubrel packet into the supplied buffer. More... | |
int MQTTSerialize_ack | ( | unsigned char * | buf, |
int | buflen, | ||
unsigned char | packettype, | ||
unsigned char | dup, | ||
unsigned short | packetid | ||
) |
Serializes the ack packet into the supplied buffer.
buf | the buffer into which the packet will be serialized |
buflen | the length in bytes of the supplied buffer |
type | the MQTT packet type |
dup | the MQTT dup flag |
packetid | the MQTT packet identifier |
References MQTTHeader::bits, MQTTHeader::byte, MQTTHeader::dup, FUNC_ENTRY, FUNC_EXIT_RC, header, MQTTPACKET_BUFFER_TOO_SHORT, MQTTPacket_encode(), ptr, PUBREL, MQTTHeader::qos, MQTTHeader::type, writeChar(), and writeInt().
Referenced by cycle(), MQTTSerialize_puback(), MQTTSerialize_pubcomp(), and MQTTSerialize_pubrel().
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.
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.
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().
int MQTTSerialize_publishLength | ( | int | qos, |
MQTTString | topicName, | ||
int | payloadlen | ||
) |
Determines the length of the MQTT publish packet that would be produced using the supplied parameters.
qos | the MQTT QoS of the publish (packetid is omitted for QoS 0) |
topicName | the topic name to be used in the publish |
payloadlen | the length of the payload to be sent |
References MQTTstrlen().
Referenced by MQTTSerialize_publish().
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.