mqttsn

package
v0.16.12 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	},

	Specificity: core.SpecificityStructural,

	PortOnly: true,

	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