Data Structures | |
union | MQTTConnackFlags |
union | MQTTConnectFlags |
struct | MQTTPacket_connectData |
struct | MQTTPacket_willOptions |
Defines the MQTT "Last Will and Testament" (LWT) settings for the connect packet. More... | |
Macros | |
#define | DLLExport |
#define | DLLImport |
#define | MQTTPacket_connectData_initializer |
#define | MQTTPacket_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 0, {NULL, {0, NULL}}, {NULL, {0, NULL}}, 0, 0 } |
Functions | |
DLLExport int | MQTTDeserialize_connack (unsigned char *sessionPresent, unsigned char *connack_rc, unsigned char *buf, int buflen) |
Deserializes the supplied (wire) buffer into connack data - return code. More... | |
DLLExport int | MQTTDeserialize_connect (MQTTPacket_connectData *data, unsigned char *buf, int len) |
Deserializes the supplied (wire) buffer into connect data structure. More... | |
DLLExport int | MQTTSerialize_connack (unsigned char *buf, int buflen, unsigned char connack_rc, unsigned char sessionPresent) |
Serializes the connack packet into the supplied buffer. More... | |
DLLExport int | MQTTSerialize_connect (unsigned char *buf, int buflen, MQTTPacket_connectData *options) |
Serializes the connect options into the buffer. More... | |
DLLExport int | MQTTSerialize_disconnect (unsigned char *buf, int buflen) |
Serializes a disconnect packet into the supplied buffer, ready for writing to a socket. More... | |
DLLExport int | MQTTSerialize_pingreq (unsigned char *buf, int buflen) |
Serializes a disconnect packet into the supplied buffer, ready for writing to a socket. More... | |
#define DLLExport |
#define DLLImport |
#define MQTTPacket_connectData_initializer |
Referenced by mqtt_connect_broker(), and MQTTConnect().
#define MQTTPacket_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 0, {NULL, {0, NULL}}, {NULL, {0, NULL}}, 0, 0 } |
DLLExport int MQTTDeserialize_connack | ( | unsigned char * | sessionPresent, |
unsigned char * | connack_rc, | ||
unsigned char * | buf, | ||
int | buflen | ||
) |
Deserializes the supplied (wire) buffer into connack data - return code.
sessionPresent | the session present flag returned (only for MQTT 3.1.1) |
connack_rc | returned integer value of the connack return code |
buf | the raw buffer data, of the correct length determined by the remaining length field |
len | the length in bytes of the data in the supplied buffer |
References MQTTConnackFlags::all, MQTTHeader::bits, MQTTConnackFlags::bits, MQTTHeader::byte, CONNACK, FUNC_ENTRY, FUNC_EXIT_RC, header, MQTTPacket_decodeBuf(), NULL, readChar(), MQTTConnackFlags::sessionpresent, and MQTTHeader::type.
Referenced by MQTTConnect(), and MQTTFormat_toClientString().
DLLExport int MQTTDeserialize_connect | ( | MQTTPacket_connectData * | data, |
unsigned char * | buf, | ||
int | len | ||
) |
Deserializes the supplied (wire) buffer into connect data structure.
data | the connect data structure to be filled out |
buf | the raw buffer data, of the correct length determined by the remaining length field |
len | the length in bytes of the data in the supplied buffer |
References MQTTConnectFlags::all, MQTTConnectFlags::bits, MQTTHeader::bits, MQTTHeader::byte, MQTTConnectFlags::cleansession, MQTTPacket_connectData::cleansession, MQTTPacket_connectData::clientID, CONNECT, FUNC_ENTRY, FUNC_EXIT_RC, header, MQTTPacket_connectData::keepAliveInterval, MQTTPacket_willOptions::message, MQTTPacket_checkVersion(), MQTTPacket_decodeBuf(), MQTTConnectFlags::password, MQTTPacket_connectData::password, MQTTPacket_willOptions::qos, readChar(), readInt(), readMQTTLenString(), MQTTPacket_willOptions::retained, MQTTPacket_willOptions::topicName, MQTTHeader::type, MQTTConnectFlags::username, MQTTPacket_connectData::username, MQTTConnectFlags::will, MQTTPacket_connectData::will, MQTTPacket_connectData::willFlag, MQTTConnectFlags::willQoS, and MQTTConnectFlags::willRetain.
Referenced by MQTTFormat_toServerString().
DLLExport int MQTTSerialize_connack | ( | unsigned char * | buf, |
int | buflen, | ||
unsigned char | connack_rc, | ||
unsigned char | sessionPresent | ||
) |
Serializes the connack packet into the supplied buffer.
buf | the buffer into which the packet will be serialized |
buflen | the length in bytes of the supplied buffer |
connack_rc | the integer connack return code to be used |
sessionPresent | the MQTT 3.1.1 sessionPresent flag |
References MQTTConnackFlags::all, MQTTHeader::bits, MQTTConnackFlags::bits, MQTTHeader::byte, CONNACK, FUNC_ENTRY, FUNC_EXIT_RC, header, MQTTPACKET_BUFFER_TOO_SHORT, MQTTPacket_encode(), ptr, MQTTConnackFlags::sessionpresent, MQTTHeader::type, and writeChar().
DLLExport int MQTTSerialize_connect | ( | unsigned char * | buf, |
int | buflen, | ||
MQTTPacket_connectData * | options | ||
) |
Serializes the connect options into the buffer.
buf | the buffer into which the packet will be serialized |
len | the length in bytes of the supplied buffer |
options | the options to be used to build the connect packet |
References MQTTConnectFlags::all, MQTTConnectFlags::bits, MQTTHeader::bits, MQTTHeader::byte, MQTTConnectFlags::cleansession, MQTTPacket_connectData::cleansession, MQTTPacket_connectData::clientID, CONNECT, MQTTString::cstring, MQTTLenString::data, FUNC_ENTRY, FUNC_EXIT_RC, header, MQTTPacket_connectData::keepAliveInterval, MQTTString::lenstring, MQTTPacket_willOptions::message, MQTTPACKET_BUFFER_TOO_SHORT, MQTTPacket_encode(), MQTTPacket_len(), MQTTSerialize_connectLength(), MQTTPacket_connectData::MQTTVersion, MQTTConnectFlags::password, MQTTPacket_connectData::password, ptr, MQTTPacket_willOptions::qos, MQTTPacket_willOptions::retained, MQTTPacket_willOptions::topicName, MQTTHeader::type, MQTTConnectFlags::username, MQTTPacket_connectData::username, MQTTConnectFlags::will, MQTTPacket_connectData::will, MQTTPacket_connectData::willFlag, MQTTConnectFlags::willQoS, MQTTConnectFlags::willRetain, writeChar(), writeCString(), writeInt(), and writeMQTTString().
Referenced by MQTTConnect().
DLLExport int MQTTSerialize_disconnect | ( | unsigned char * | buf, |
int | buflen | ||
) |
Serializes a disconnect packet into the supplied buffer, ready for writing to a socket.
buf | the buffer into which the packet will be serialized |
buflen | the length in bytes of the supplied buffer, to avoid overruns |
References DISCONNECT, and MQTTSerialize_zero().
Referenced by MQTTDisconnect().
DLLExport int MQTTSerialize_pingreq | ( | unsigned char * | buf, |
int | buflen | ||
) |
Serializes a disconnect packet into the supplied buffer, ready for writing to a socket.
buf | the buffer into which the packet will be serialized |
buflen | the length in bytes of the supplied buffer, to avoid overruns |
References MQTTSerialize_zero(), and PINGREQ.
Referenced by keepalive().