40#define MQTT_TLS_PORT 8883
43#define MQTT_PROTOCOL_NAME_3_1 "MQIsdp"
45#define MQTT_PROTOCOL_NAME_3_1_1 "MQTT"
48#define MQTT_MIN_HEADER_SIZE 2
50#define MQTT_MAX_HEADER_SIZE 5
75 MQTT_TRANSPORT_PROTOCOL_TCP = 1,
124 MQTT_CONNECT_FLAG_CLEAN_SESSION = 0x02,
125 MQTT_CONNECT_FLAG_WILL = 0x04,
126 MQTT_CONNECT_FLAG_WILL_QOS_0 = 0x00,
127 MQTT_CONNECT_FLAG_WILL_QOS_1 = 0x08,
128 MQTT_CONNECT_FLAG_WILL_QOS_2 = 0x10,
129 MQTT_CONNECT_FLAG_WILL_RETAIN = 0x20,
130 MQTT_CONNECT_FLAG_PASSWORD = 0x40,
131 MQTT_CONNECT_FLAG_USERNAME = 0x80
141 MQTT_CONNECT_ACK_FLAG_SESSION_PRESENT = 0x01
151 MQTT_CONNECT_RET_CODE_ACCEPTED = 0,
152 MQTT_CONNECT_RET_CODE_UNACCEPTABLE_VERSION = 1,
153 MQTT_CONNECT_RET_CODE_ID_REJECTED = 2,
154 MQTT_CONNECT_RET_CODE_SERVER_UNAVAILABLE = 3,
155 MQTT_CONNECT_RET_CODE_BAD_USER_NAME = 4,
156 MQTT_CONNECT_RET_CODE_NOT_AUTHORIZED = 5
161#if defined(__CWCC__) || defined(_WIN32)
162 #pragma pack(push, 1)
172#if defined(_CPU_BIG_ENDIAN) && !defined(__ICCRX__)
199#if defined(__CWCC__) || defined(_WIN32)
MqttConnectFlags
Connect flags.
Definition mqtt_common.h:123
MqttConnectAckFlags
Connect Acknowledge flags.
Definition mqtt_common.h:140
MqttQosLevel
Quality of service level.
Definition mqtt_common.h:87
@ MQTT_QOS_LEVEL_2
Exactly once delivery.
Definition mqtt_common.h:90
@ MQTT_QOS_LEVEL_1
At least once delivery.
Definition mqtt_common.h:89
@ MQTT_QOS_LEVEL_0
At most once delivery.
Definition mqtt_common.h:88
MqttTransportProtocol
Transport protocol.
Definition mqtt_common.h:74
@ MQTT_TRANSPORT_PROTOCOL_WSS
WebSocket protocol.
Definition mqtt_common.h:78
@ MQTT_TRANSPORT_PROTOCOL_TLS
TCP protocol.
Definition mqtt_common.h:76
@ MQTT_TRANSPORT_PROTOCOL_WS
TLS protocol.
Definition mqtt_common.h:77
typedef __packed_struct
Fixed header.
Definition mqtt_common.h:171
MqttVersion
MQTT protocol level.
Definition mqtt_common.h:63
@ MQTT_VERSION_3_1
MQTT version 3.1.
Definition mqtt_common.h:64
@ MQTT_VERSION_3_1_1
MQTT version 3.1.1.
Definition mqtt_common.h:65
MqttConnectRetCode
Connect return codes.
Definition mqtt_common.h:150
MqttPacketType
MQTT control packet type.
Definition mqtt_common.h:99
@ MQTT_PACKET_TYPE_DISCONNECT
Client is disconnecting.
Definition mqtt_common.h:114
@ MQTT_PACKET_TYPE_SUBACK
Subscribe acknowledgment.
Definition mqtt_common.h:109
@ MQTT_PACKET_TYPE_PUBACK
Publish acknowledgment.
Definition mqtt_common.h:104
@ MQTT_PACKET_TYPE_SUBSCRIBE
Client subscribe request.
Definition mqtt_common.h:108
@ MQTT_PACKET_TYPE_UNSUBSCRIBE
Unsubscribe request.
Definition mqtt_common.h:110
@ MQTT_PACKET_TYPE_CONNACK
Connect acknowledgment.
Definition mqtt_common.h:102
@ MQTT_PACKET_TYPE_PINGRESP
Ping response.
Definition mqtt_common.h:113
@ MQTT_PACKET_TYPE_PUBCOMP
Publish complete (assured delivery part 3)
Definition mqtt_common.h:107
@ MQTT_PACKET_TYPE_INVALID
Invalid packet.
Definition mqtt_common.h:100
@ MQTT_PACKET_TYPE_PUBREC
Publish received (assured delivery part 1)
Definition mqtt_common.h:105
@ MQTT_PACKET_TYPE_PINGREQ
Ping request.
Definition mqtt_common.h:112
@ MQTT_PACKET_TYPE_CONNECT
Client request to connect to server.
Definition mqtt_common.h:101
@ MQTT_PACKET_TYPE_PUBLISH
Publish message.
Definition mqtt_common.h:103
@ MQTT_PACKET_TYPE_UNSUBACK
Unsubscribe acknowledgment.
Definition mqtt_common.h:111
@ MQTT_PACKET_TYPE_PUBREL
Publish release (assured delivery part 2)
Definition mqtt_common.h:106