MQTT-SN Defines

Shared definitions for MQTT-SN. More...

Detailed Description

Shared definitions for MQTT-SN.

See also
http://mqtt.org/new/wp-content/uploads/2009/06/MQTT-SN_spec_v1.2.pdf

Files

file  mqttsn.h
 Generic MQTT-SN definitions.
 

Macros

#define MQTTSN_DEFAULT_PORT   (1883U)
 Default UDP port for MQTT-SN servers.
 

Enumerations

enum  {
  MQTTSN_DUP = 0x80, MQTTSN_QOS_MASK = 0x60, MQTTSN_QOS_2 = 0x40, MQTTSN_QOS_1 = 0x20,
  MQTTSN_QOS_0 = 0x00, MQTTSN_RETAIN = 0x10, MQTTSN_WILL = 0x08, MQTTSN_CS = 0x04,
  MQTTSN_TIT_MASK = 0x03, MQTTSN_TIT_SHORT = 0x02, MQTTSN_TIT_PREDEF = 0x01, MQTTSN_TIT_NORMAL = 0x00
}
 MQTT-SN flags. More...
 
enum  {
  MQTTSN_ADVERTISE = 0x00, MQTTSN_SEARCHGW = 0x01, MQTTSN_GWINFO = 0x02, MQTTSN_CONNECT = 0x04,
  MQTTSN_CONNACK = 0x05, MQTTSN_WILLTOPICREQ = 0x06, MQTTSN_WILLTOPIC = 0x07, MQTTSN_WILLMSGREQ = 0x08,
  MQTTSN_WILLMSG = 0x09, MQTTSN_REGISTER = 0x0a, MQTTSN_REGACK = 0x0b, MQTTSN_PUBLISH = 0x0c,
  MQTTSN_PUBACK = 0x0d, MQTTSN_PUBCOMP = 0x0e, MQTTSN_PUBREC = 0x0f, MQTTSN_PUBREL = 0x10,
  MQTTSN_SUBSCRIBE = 0x12, MQTTSN_SUBACK = 0x13, MQTTSN_UNSUBSCRIBE = 0x14, MQTTSN_UNSUBACK = 0x15,
  MQTTSN_PINGREQ = 0x16, MQTTSN_PINGRESP = 0x17, MQTTSN_DISCONNECT = 0x18, MQTTSN_WILLTOPICUPD = 0x1a,
  MQTTSN_WILLTOPICRESP = 0x1b, MQTTSN_WILLMSGUPD = 0x1c, MQTTSN_WILLMSGRESP = 0x1d
}
 MQTT-SN message types. More...
 
enum  { MQTTSN_ACCEPTED = 0x00, MQTTSN_REJ_CONGESTION = 0x01, MQTTSN_REJ_INV_TOPIC_ID = 0x02, MQTTSN_REJ_NOTSUP = 0x03 }
 MQTT-SN return codes. More...
 

The client ID must contain 1-23 characters

See also
MQTT-SN spec v1.2, section 5.3.1
#define MQTTSN_CLI_ID_MINLEN   (1U)
 
#define MQTTSN_CLI_ID_MAXLEN   (23U)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

MQTT-SN flags.

All MQTT-SN functions only support a sub-set of the available flags. It is up to the user to only supply valid/supported flags to a function.

Refer to the MQTT-SN spec section 5.3.4 for further information.

Enumerator
MQTTSN_DUP 

duplicate flag

MQTTSN_QOS_MASK 

QoS level mask.

MQTTSN_QOS_2 

QoS level 2.

MQTTSN_QOS_1 

QoS level 1.

MQTTSN_QOS_0 

QoS level 0.

MQTTSN_RETAIN 

retain flag

MQTTSN_WILL 

will flag, used during CONNECT

MQTTSN_CS 

clean session flag

MQTTSN_TIT_MASK 

topic ID type mask

MQTTSN_TIT_SHORT 

topic ID: short

MQTTSN_TIT_PREDEF 

topic ID: pre-defined

MQTTSN_TIT_NORMAL 

topic ID: normal

Definition at line 56 of file mqttsn.h.

◆ anonymous enum

anonymous enum

MQTT-SN message types.

Enumerator
MQTTSN_ADVERTISE 

advertise message

MQTTSN_SEARCHGW 

search gateway message

MQTTSN_GWINFO 

gateway info message

MQTTSN_CONNECT 

connect message

MQTTSN_CONNACK 

connection acknowledgment message

MQTTSN_WILLTOPICREQ 

will topic request

MQTTSN_WILLTOPIC 

will topic

MQTTSN_WILLMSGREQ 

will message request

MQTTSN_WILLMSG 

will message

MQTTSN_REGISTER 

topic registration request

MQTTSN_REGACK 

topic registration acknowledgment

MQTTSN_PUBLISH 

publish message

MQTTSN_PUBACK 

publish acknowledgment

MQTTSN_PUBCOMP 

publish received (QoS 2)

MQTTSN_PUBREC 

publish complete (QoS 2)

MQTTSN_PUBREL 

publish release (QoS 2)

MQTTSN_SUBSCRIBE 

subscribe message

MQTTSN_SUBACK 

subscription acknowledgment

MQTTSN_UNSUBSCRIBE 

unsubscribe message

MQTTSN_UNSUBACK 

unsubscription acknowledgment

MQTTSN_PINGREQ 

ping request

MQTTSN_PINGRESP 

ping response

MQTTSN_DISCONNECT 

disconnect message

MQTTSN_WILLTOPICUPD 

will topic update request

MQTTSN_WILLTOPICRESP 

will topic update response

MQTTSN_WILLMSGUPD 

will message update request

MQTTSN_WILLMSGRESP 

will topic update response

Definition at line 74 of file mqttsn.h.

◆ anonymous enum

anonymous enum

MQTT-SN return codes.

See also
MQTT-SN spec v1.2, section 5.3.10, table 5
Enumerator
MQTTSN_ACCEPTED 

accepted

MQTTSN_REJ_CONGESTION 

rejected: congestion

MQTTSN_REJ_INV_TOPIC_ID 

rejected: invalid topic id

MQTTSN_REJ_NOTSUP 

rejected: not supported

Definition at line 109 of file mqttsn.h.