Macros | |
#define | min(a, b) ((a < b) ? a : b) |
Functions | |
int | MQTTDeserialize_connect (MQTTPacket_connectData *data, unsigned char *buf, int len) |
Deserializes the supplied (wire) buffer into connect data structure. More... | |
int | MQTTPacket_checkVersion (MQTTString *protocol, int version) |
Validates MQTT protocol name and version combinations. More... | |
int | MQTTSerialize_connack (unsigned char *buf, int buflen, unsigned char connack_rc, unsigned char sessionPresent) |
Serializes the connack packet into the supplied buffer. More... | |
#define min | ( | a, | |
b | |||
) | ((a < b) ? a : b) |
Referenced by MQTTPacket_checkVersion().
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().
int MQTTPacket_checkVersion | ( | MQTTString * | protocol, |
int | version | ||
) |
Validates MQTT protocol name and version combinations.
protocol | the MQTT protocol name as an MQTTString |
version | the MQTT protocol version number, as in the connect packet |
References MQTTLenString::data, MQTTLenString::len, MQTTString::lenstring, and min.
Referenced by MQTTDeserialize_connect().
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().