Table of Contents

Class MqttMsgBase

Namespace
nanoFramework.M2Mqtt.Messages
Assembly
nanoFramework.M2Mqtt.dll

Base class for all MQTT messages

public abstract class MqttMsgBase
Inheritance
MqttMsgBase
Derived
Inherited Members
Extension Methods

Constructors

MqttMsgBase()

protected MqttMsgBase()

Properties

DupFlag

Duplicate message flag

public bool DupFlag { get; set; }

Property Value

bool

MaximumPacketSize

Maximum Packet Size, v5.0 only

public uint MaximumPacketSize { get; set; }

Property Value

uint

MessageId

Message identifier for the message

public ushort MessageId { get; set; }

Property Value

ushort

QosLevel

Quality of Service level

public MqttQoSLevel QosLevel { get; set; }

Property Value

MqttQoSLevel

Retain

Retain message flag

public bool Retain { get; set; }

Property Value

bool

Type

Message type

public MqttMessageType Type { get; set; }

Property Value

MqttMessageType

UserProperties

User Property, v5.0 only

public ArrayList UserProperties { get; }

Property Value

ArrayList

Methods

DecodeVariableByte(IMqttNetworkChannel)

Decode remaining length reading bytes from socket

protected static int DecodeVariableByte(IMqttNetworkChannel channel)

Parameters

channel IMqttNetworkChannel

Channel from reading bytes

Returns

int

Decoded remaining length

EncodeVariableByte(int, byte[], int)

Encode remaining length and insert it into message buffer

protected int EncodeVariableByte(int remainingLength, byte[] buffer, int index)

Parameters

remainingLength int

Remaining length value to encode

buffer byte[]

Message buffer for inserting encoded value

index int

Index from which insert encoded value into buffer

Returns

int

Index updated

GetBytes(MqttProtocolVersion)

Returns message bytes rapresentation

public abstract byte[] GetBytes(MqttProtocolVersion protocolVersion)

Parameters

protocolVersion MqttProtocolVersion

Protocol version

Returns

byte[]

Bytes rapresentation