mqttsn.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
23 #ifndef NET_MQTTSN_H
24 #define NET_MQTTSN_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 
31 #ifndef MQTTSN_DEFAULT_PORT
32 
35 #define MQTTSN_DEFAULT_PORT (1883U)
36 #endif
37 
44 #define MQTTSN_CLI_ID_MINLEN (1U)
45 #define MQTTSN_CLI_ID_MAXLEN (23U)
46 
56 enum {
57  MQTTSN_DUP = 0x80,
58  MQTTSN_QOS_MASK = 0x60,
59  MQTTSN_QOS_2 = 0x40,
60  MQTTSN_QOS_1 = 0x20,
61  MQTTSN_QOS_0 = 0x00,
62  MQTTSN_RETAIN = 0x10,
63  MQTTSN_WILL = 0x08,
64  MQTTSN_CS = 0x04,
65  MQTTSN_TIT_MASK = 0x03,
69 };
70 
74 enum {
76  MQTTSN_SEARCHGW = 0x01,
77  MQTTSN_GWINFO = 0x02,
78  MQTTSN_CONNECT = 0x04,
79  MQTTSN_CONNACK = 0x05,
83  MQTTSN_WILLMSG = 0x09,
84  MQTTSN_REGISTER = 0x0a,
85  MQTTSN_REGACK = 0x0b,
86  MQTTSN_PUBLISH = 0x0c,
87  MQTTSN_PUBACK = 0x0d,
88  MQTTSN_PUBCOMP = 0x0e,
89  MQTTSN_PUBREC = 0x0f,
90  MQTTSN_PUBREL = 0x10,
92  MQTTSN_SUBACK = 0x13,
94  MQTTSN_UNSUBACK = 0x15,
95  MQTTSN_PINGREQ = 0x16,
96  MQTTSN_PINGRESP = 0x17,
102 };
103 
109 enum {
114 };
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif /* NET_MQTTSN_H */
121 
MQTTSN_WILLMSGREQ
@ MQTTSN_WILLMSGREQ
will message request
Definition: mqttsn.h:82
MQTTSN_TIT_PREDEF
@ MQTTSN_TIT_PREDEF
topic ID: pre-defined
Definition: mqttsn.h:67
MQTTSN_PUBCOMP
@ MQTTSN_PUBCOMP
publish received (QoS 2)
Definition: mqttsn.h:88
MQTTSN_REJ_CONGESTION
@ MQTTSN_REJ_CONGESTION
rejected: congestion
Definition: mqttsn.h:111
MQTTSN_WILLTOPIC
@ MQTTSN_WILLTOPIC
will topic
Definition: mqttsn.h:81
MQTTSN_TIT_SHORT
@ MQTTSN_TIT_SHORT
topic ID: short
Definition: mqttsn.h:66
MQTTSN_QOS_0
@ MQTTSN_QOS_0
QoS level 0.
Definition: mqttsn.h:61
MQTTSN_ADVERTISE
@ MQTTSN_ADVERTISE
advertise message
Definition: mqttsn.h:75
MQTTSN_WILLMSG
@ MQTTSN_WILLMSG
will message
Definition: mqttsn.h:83
MQTTSN_PUBREL
@ MQTTSN_PUBREL
publish release (QoS 2)
Definition: mqttsn.h:90
MQTTSN_WILLMSGUPD
@ MQTTSN_WILLMSGUPD
will message update request
Definition: mqttsn.h:100
MQTTSN_SUBSCRIBE
@ MQTTSN_SUBSCRIBE
subscribe message
Definition: mqttsn.h:91
MQTTSN_QOS_MASK
@ MQTTSN_QOS_MASK
QoS level mask.
Definition: mqttsn.h:58
MQTTSN_WILLTOPICUPD
@ MQTTSN_WILLTOPICUPD
will topic update request
Definition: mqttsn.h:98
MQTTSN_CONNACK
@ MQTTSN_CONNACK
connection acknowledgment message
Definition: mqttsn.h:79
MQTTSN_PUBACK
@ MQTTSN_PUBACK
publish acknowledgment
Definition: mqttsn.h:87
MQTTSN_PINGREQ
@ MQTTSN_PINGREQ
ping request
Definition: mqttsn.h:95
MQTTSN_RETAIN
@ MQTTSN_RETAIN
retain flag
Definition: mqttsn.h:62
MQTTSN_TIT_NORMAL
@ MQTTSN_TIT_NORMAL
topic ID: normal
Definition: mqttsn.h:68
MQTTSN_UNSUBACK
@ MQTTSN_UNSUBACK
unsubscription acknowledgment
Definition: mqttsn.h:94
MQTTSN_CONNECT
@ MQTTSN_CONNECT
connect message
Definition: mqttsn.h:78
MQTTSN_QOS_2
@ MQTTSN_QOS_2
QoS level 2.
Definition: mqttsn.h:59
MQTTSN_PUBREC
@ MQTTSN_PUBREC
publish complete (QoS 2)
Definition: mqttsn.h:89
MQTTSN_WILLTOPICRESP
@ MQTTSN_WILLTOPICRESP
will topic update response
Definition: mqttsn.h:99
MQTTSN_PINGRESP
@ MQTTSN_PINGRESP
ping response
Definition: mqttsn.h:96
MQTTSN_SEARCHGW
@ MQTTSN_SEARCHGW
search gateway message
Definition: mqttsn.h:76
MQTTSN_WILLMSGRESP
@ MQTTSN_WILLMSGRESP
will topic update response
Definition: mqttsn.h:101
MQTTSN_REGISTER
@ MQTTSN_REGISTER
topic registration request
Definition: mqttsn.h:84
MQTTSN_DISCONNECT
@ MQTTSN_DISCONNECT
disconnect message
Definition: mqttsn.h:97
MQTTSN_WILLTOPICREQ
@ MQTTSN_WILLTOPICREQ
will topic request
Definition: mqttsn.h:80
MQTTSN_PUBLISH
@ MQTTSN_PUBLISH
publish message
Definition: mqttsn.h:86
MQTTSN_WILL
@ MQTTSN_WILL
will flag, used during CONNECT
Definition: mqttsn.h:63
MQTTSN_REJ_NOTSUP
@ MQTTSN_REJ_NOTSUP
rejected: not supported
Definition: mqttsn.h:113
MQTTSN_ACCEPTED
@ MQTTSN_ACCEPTED
accepted
Definition: mqttsn.h:110
MQTTSN_DUP
@ MQTTSN_DUP
duplicate flag
Definition: mqttsn.h:57
MQTTSN_TIT_MASK
@ MQTTSN_TIT_MASK
topic ID type mask
Definition: mqttsn.h:65
MQTTSN_QOS_1
@ MQTTSN_QOS_1
QoS level 1.
Definition: mqttsn.h:60
MQTTSN_SUBACK
@ MQTTSN_SUBACK
subscription acknowledgment
Definition: mqttsn.h:92
MQTTSN_UNSUBSCRIBE
@ MQTTSN_UNSUBSCRIBE
unsubscribe message
Definition: mqttsn.h:93
MQTTSN_REJ_INV_TOPIC_ID
@ MQTTSN_REJ_INV_TOPIC_ID
rejected: invalid topic id
Definition: mqttsn.h:112
MQTTSN_CS
@ MQTTSN_CS
clean session flag
Definition: mqttsn.h:64
MQTTSN_GWINFO
@ MQTTSN_GWINFO
gateway info message
Definition: mqttsn.h:77
MQTTSN_REGACK
@ MQTTSN_REGACK
topic registration acknowledgment
Definition: mqttsn.h:85