define the missing MQTT control packets
This commit is contained in:
parent
dfbe6a1e11
commit
78d733aee3
@ -47,20 +47,27 @@
|
|||||||
|
|
||||||
#define MQTT_PROTOCOL_LEVEL 4
|
#define MQTT_PROTOCOL_LEVEL 4
|
||||||
|
|
||||||
#define MQTT_CTRL_CONNECT 0x01
|
#define MQTT_CTRL_CONNECT 0x1
|
||||||
#define MQTT_CTRL_CONNECTACK 0x02
|
#define MQTT_CTRL_CONNECTACK 0x2
|
||||||
#define MQTT_CTRL_PUBLISH 0x03
|
#define MQTT_CTRL_PUBLISH 0x3
|
||||||
#define MQTT_CTRL_SUBSCRIBE 0x08
|
#define MQTT_CTRL_PUBACK 0x4
|
||||||
#define MQTT_CTRL_SUBACK 0x09
|
#define MQTT_CTRL_PUBREC 0x5
|
||||||
#define MQTT_CTRL_PINGREQ 0x0C
|
#define MQTT_CTRL_PUBREL 0x6
|
||||||
#define MQTT_CTRL_PINGRESP 0x0D
|
#define MQTT_CTRL_PUBCOMP 0x7
|
||||||
|
#define MQTT_CTRL_SUBSCRIBE 0x8
|
||||||
|
#define MQTT_CTRL_SUBACK 0x9
|
||||||
|
#define MQTT_CTRL_UNSUBSCRIBE 0xA
|
||||||
|
#define MQTT_CTRL_UNSUBSACK 0xB
|
||||||
|
#define MQTT_CTRL_PINGREQ 0xC
|
||||||
|
#define MQTT_CTRL_PINGRESP 0xD
|
||||||
|
#define MQTT_CTRL_DISCONNECT 0xE
|
||||||
|
|
||||||
#define MQTT_QOS_1 0x1
|
#define MQTT_QOS_1 0x1
|
||||||
#define MQTT_QOS_0 0x0
|
#define MQTT_QOS_0 0x0
|
||||||
|
|
||||||
#define CONNECT_TIMEOUT_MS 3000
|
#define CONNECT_TIMEOUT_MS 3000
|
||||||
#define PUBLISH_TIMEOUT_MS 500
|
#define PUBLISH_TIMEOUT_MS 500
|
||||||
#define PING_TIMEOUT_MS 500
|
#define PING_TIMEOUT_MS 500
|
||||||
|
|
||||||
// Adjust as necessary, in seconds. Default to 5 minutes.
|
// Adjust as necessary, in seconds. Default to 5 minutes.
|
||||||
#define MQTT_CONN_KEEPALIVE 300
|
#define MQTT_CONN_KEEPALIVE 300
|
||||||
@ -70,15 +77,15 @@
|
|||||||
// 23 char client ID.
|
// 23 char client ID.
|
||||||
#define MAXBUFFERSIZE (125)
|
#define MAXBUFFERSIZE (125)
|
||||||
|
|
||||||
#define MQTT_CONN_USERNAMEFLAG 0x80
|
#define MQTT_CONN_USERNAMEFLAG 0x80
|
||||||
#define MQTT_CONN_PASSWORDFLAG 0x40
|
#define MQTT_CONN_PASSWORDFLAG 0x40
|
||||||
#define MQTT_CONN_WILLRETAIN 0x20
|
#define MQTT_CONN_WILLRETAIN 0x20
|
||||||
#define MQTT_CONN_WILLQOS 0x08
|
#define MQTT_CONN_WILLQOS_1 0x08
|
||||||
#define MQTT_CONN_WILLFLAG 0x04
|
#define MQTT_CONN_WILLQOS_2 0x18
|
||||||
#define MQTT_CONN_CLEANSESSION 0x02
|
#define MQTT_CONN_WILLFLAG 0x04
|
||||||
|
#define MQTT_CONN_CLEANSESSION 0x02
|
||||||
|
|
||||||
// how many subscriptions we want to be able to
|
// how many subscriptions we want to be able to track
|
||||||
// track
|
|
||||||
#define MAXSUBSCRIPTIONS 5
|
#define MAXSUBSCRIPTIONS 5
|
||||||
|
|
||||||
// how much data we save in a subscription object
|
// how much data we save in a subscription object
|
||||||
|
Loading…
Reference in New Issue
Block a user