mqttsn

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgTypeAdvertise     = 0x00 // Gateway advertisement
	MsgTypeSearchGw      = 0x01 // Gateway search request
	MsgTypeGwInfo        = 0x02 // Gateway info response
	MsgTypeConnect       = 0x04 // Connect request
	MsgTypeConnack       = 0x05 // Connect acknowledgment
	MsgTypeWillTopicReq  = 0x06 // Will topic request
	MsgTypeWillTopic     = 0x07 // Will topic
	MsgTypeWillMsgReq    = 0x08 // Will message request
	MsgTypeWillMsg       = 0x09 // Will message
	MsgTypeRegister      = 0x0A // Topic registration request
	MsgTypeRegack        = 0x0B // Topic registration acknowledgment
	MsgTypePublish       = 0x0C // Publish message
	MsgTypePuback        = 0x0D // Publish acknowledgment
	MsgTypePubcomp       = 0x0E // Publish complete (QoS 2)
	MsgTypePubrec        = 0x0F // Publish received (QoS 2)
	MsgTypePubrel        = 0x10 // Publish release (QoS 2)
	MsgTypeSubscribe     = 0x12 // Subscribe request
	MsgTypeSuback        = 0x13 // Subscribe acknowledgment
	MsgTypeUnsubscribe   = 0x14 // Unsubscribe request
	MsgTypeUnsuback      = 0x15 // Unsubscribe acknowledgment
	MsgTypePingreq       = 0x16 // Ping request
	MsgTypePingresp      = 0x17 // Ping response
	MsgTypeDisconnect    = 0x18 // Disconnect
	MsgTypeWillTopicUpd  = 0x1A // Will topic update
	MsgTypeWillTopicResp = 0x1B // Will topic update response
	MsgTypeWillMsgUpd    = 0x1C // Will message update
	MsgTypeWillMsgResp   = 0x1D // Will message update response
	MsgTypeForwarder     = 0xFE // Forwarder encapsulation
)

MQTT-SN Message Types

View Source
const (
	ReturnCodeAccepted               = 0x00
	ReturnCodeRejectedCongestion     = 0x01
	ReturnCodeRejectedInvalidTopicId = 0x02
	ReturnCodeRejectedNotSupported   = 0x03
)

Return codes

View Source
const (
	FlagDUP          = 0x80 // Duplicate flag
	FlagQoSMask      = 0x60 // QoS bits (6-5)
	FlagQoSShift     = 5
	FlagRetain       = 0x10 // Retain flag
	FlagWill         = 0x08 // Will flag
	FlagCleanSession = 0x04 // Clean session flag
	FlagTopicIdType  = 0x03 // Topic ID type bits
)

Flag bit positions

Variables

View Source
var Decoder = &decoder.StreamDecoder{
	Type:        types.Type_NC_MQTTSN,
	Name:        serviceMQTTSN,
	Description: "MQTT for Sensor Networks (MQTT-SN) is a publish/subscribe protocol for wireless sensor networks and IoT devices",
	PostInit: func(d *decoder.StreamDecoder) error {
		var err error
		mqttsnLog, _, err = logging.InitZapLogger(
			decoderconfig.Instance.Out,
			"mqttsn",
			decoderconfig.Instance.Debug,
		)
		return err
	},
	CanDecode: func(client, server []byte) bool {

		return canDecodeMQTTSN(client) || canDecodeMQTTSN(server)
	},
	DeInit: func(sd *decoder.StreamDecoder) error {
		return mqttsnLog.Sync()
	},
	Factory: &mqttsnReader{},
	Typ:     core.UDP,
}

Decoder for protocol analysis and writing audit records to disk.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL