Functions | |
MQTTReturnCode | MQTTSerialize_ack (unsigned char *buf, size_t buflen, unsigned char type, uint8_t dup, uint16_t packetid, uint32_t *serialized_len) |
Serializes the ack packet into the supplied buffer. More... | |
size_t | MQTTSerialize_GetPublishLength (uint8_t qos, MQTTString topicName, size_t payloadlen) |
Determines the length of the MQTT publish packet that would be produced using the supplied parameters. More... | |
MQTTReturnCode | MQTTSerialize_puback (unsigned char *buf, size_t buflen, uint16_t packetid, uint32_t *serialized_len) |
Serializes a puback packet into the supplied buffer. More... | |
MQTTReturnCode | MQTTSerialize_pubcomp (unsigned char *buf, size_t buflen, uint16_t packetid, uint32_t *serialized_len) |
Serializes a pubrel packet into the supplied buffer. More... | |
MQTTReturnCode | MQTTSerialize_publish (unsigned char *buf, size_t buflen, uint8_t dup, QoS qos, uint8_t retained, uint16_t packetid, MQTTString topicName, unsigned char *payload, size_t payloadlen, uint32_t *serialized_len) |
Serializes the supplied publish data into the supplied buffer, ready for sending. More... | |
MQTTReturnCode | MQTTSerialize_pubrel (unsigned char *buf, size_t buflen, unsigned char dup, uint16_t packetid, uint32_t *serialized_len) |
Serializes a pubrel packet into the supplied buffer. More... | |
MQTTReturnCode MQTTSerialize_ack | ( | unsigned char * | buf, |
size_t | buflen, | ||
unsigned char | type, | ||
uint8_t | dup, | ||
uint16_t | packetid, | ||
uint32_t * | serialized_len | ||
) |
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 buf, MQTTHeader::byte, FUNC_ENTRY, FUNC_EXIT_RC, header, MQTT_NULL_VALUE_ERROR, MQTTPACKET_BUFFER_TOO_SHORT, MQTTPacket_encode(), MQTTPacket_InitHeader(), NULL, ptr, PUBREL, QOS0, QOS1, SUCCESS, writeChar(), and writePacketId().
size_t MQTTSerialize_GetPublishLength | ( | uint8_t | qos, |
MQTTString | topicName, | ||
size_t | 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 len, and MQTTstrlen().
Referenced by MQTTSerialize_publish().
MQTTReturnCode MQTTSerialize_puback | ( | unsigned char * | buf, |
size_t | buflen, | ||
uint16_t | packetid, | ||
uint32_t * | serialized_len | ||
) |
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.
MQTTReturnCode MQTTSerialize_pubcomp | ( | unsigned char * | buf, |
size_t | buflen, | ||
uint16_t | packetid, | ||
uint32_t * | serialized_len | ||
) |
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.
MQTTReturnCode MQTTSerialize_publish | ( | unsigned char * | buf, |
size_t | buflen, | ||
uint8_t | dup, | ||
QoS | qos, | ||
uint8_t | retained, | ||
uint16_t | packetid, | ||
MQTTString | topicName, | ||
unsigned char * | payload, | ||
size_t | payloadlen, | ||
uint32_t * | serialized_len | ||
) |
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 buf, MQTTHeader::byte, FUNC_ENTRY, FUNC_EXIT_RC, header, MQTT_NULL_VALUE_ERROR, MQTTPACKET_BUFFER_TOO_SHORT, MQTTPacket_encode(), MQTTPacket_InitHeader(), MQTTPacket_len(), MQTTSerialize_GetPublishLength(), NULL, ptr, PUBLISH, SUCCESS, writeChar(), writeInt(), and writeMQTTString().
MQTTReturnCode MQTTSerialize_pubrel | ( | unsigned char * | buf, |
size_t | buflen, | ||
unsigned char | dup, | ||
uint16_t | packetid, | ||
uint32_t * | serialized_len | ||
) |
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.