forked from isc-atoth/COS-MQTTClient
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MQTTOptions.xml
61 lines (54 loc) · 2.56 KB
/
MQTTOptions.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2016.1.2 (Build 206U)" ts="2016-09-01 14:58:19">
<Routine name="MQTTOptions" type="INC" timestamp="64162,53820.637419"><![CDATA[
#; General
#define MQTTEncodeNumber(%num) $Reverse($ZWChar(%num))
#define MQTTDecodeNumber(%str) $ZWAscii($Reverse(%str))
#; Trace level conditions
#define MQTTNoTrace (..traceLevel = 0)
#define MQTTTraceErrors (..traceLevel > 0)
#define MQTTTraceWarnings (..traceLevel > 1)
#define MQTTTraceInfo (..traceLevel > 2)
#define MQTTTraceDebug (..traceLevel > 3)
#define MQTTTrace(%type,%dir,%msg) Set:(..trace) var=..traceTarget,@var@($I(@var),$ZDT($ZU(188),3,1,3),%dir,$Case(%type,"":"UNKNOWN",:%type))=%msg
#define MQTTTraceCond(%type,%dir,%msg,%cond) Set:(..trace && (%cond)) var=..traceTarget,@var@($I(@var),$ZDT($ZU(188),3,1,3),%dir,$Case(%type,"":"UNKNOWN",:%type))=%msg
#define MQTTTraceIN(%type,%msg,%level) $$$MQTTTraceCond(%type,"I",%msg,%level)
#define MQTTTraceOUT(%type,%msg,%level) $$$MQTTTraceCond(%type,"O",%msg,%level)
#define MQTTTraceWRN(%msg) $$$MQTTTraceCond("WARNING","S",%msg,$$$MQTTTraceWarnings)
#define MQTTTraceERR(%msg) $$$MQTTTraceCond("ERROR","S",%msg,$$$MQTTTraceErrors)
#define MQTTTraceINF(%msg) $$$MQTTTraceCond("INFO","S",%msg,$$$MQTTTraceInfo)
#define MQTTTraceDEB(%msg) $$$MQTTTraceCond("DEBUG","S",%msg,$$$MQTTTraceDebug)
#; Fixed header
#define MQTTRetain 1
#define MQTTQoS1 2
#define MQTTQoS2 4
#define MQTTDup 8
#; Message types
#define MQTTCONNECT 16
#define MQTTCONNACK 32
#define MQTTPUBLISH 48
#define MQTTPUBACK 64
#define MQTTPUBREC 80
#define MQTTPUBREL 96
#define MQTTPUBCOMP 112
#define MQTTSUBSCRIBE 128
#define MQTTSUBACK 144
#define MQTTUNSUBSCRIBE 160
#define MQTTUNSUBACK 176
#define MQTTPINGREQ 192
#define MQTTPINGRESP 208
#define MQTTDISCONNECT 224
#define MQTTMsgType(%code) $Case(%code,$$$MQTTCONNECT:"CONNECT",$$$MQTTCONNACK:"CONNACK",$$$MQTTPUBLISH:"PUBLISH",$$$MQTTPUBACK:"PUBACK",$$$MQTTPUBREC:"PUBREC",$$$MQTTPUBREL:"PUBREL",$$$MQTTPUBCOMP:"PUBCOMP",$$$MQTTSUBSCRIBE:"SUBSCRIBE",$$$MQTTSUBACK:"SUBACK",$$$MQTTUNSUBSCRIBE:"UNSUBSCRIBE",$$$MQTTUNSUBACK:"UNSUBACK",$$$MQTTPINGREQ:"PINGREQ",$$$MQTTPINGRESP:"PINGRESP",$$$MQTTDISCONNECT:"DISCONNECT",:"Unkown")
#; CONNECT
#define MQTTCleanSession 2
#define MQTTWillFlag 4
#define MQTTWillQoS1 8
#define MQTTWillQoS2 16
#define MQTTWillRetain 32
#define MQTTPasswordFlag 64
#define MQTTUsernameFlag 128
#; SUBSCRIBE
#define MQTTSubQoS1 1
#define MQTTSubQoS2 2
]]></Routine>
</Export>