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
MaximumPacketSize
Maximum Packet Size, v5.0 only
public uint MaximumPacketSize { get; set; }
Property Value
MessageId
Message identifier for the message
public ushort MessageId { get; set; }
Property Value
QosLevel
Quality of Service level
public MqttQoSLevel QosLevel { get; set; }
Property Value
Retain
Retain message flag
public bool Retain { get; set; }
Property Value
Type
Message type
public MqttMessageType Type { get; set; }
Property Value
UserProperties
User Property, v5.0 only
public ArrayList UserProperties { get; }
Property Value
Methods
DecodeVariableByte(IMqttNetworkChannel)
Decode remaining length reading bytes from socket
protected static int DecodeVariableByte(IMqttNetworkChannel channel)
Parameters
channel
IMqttNetworkChannelChannel 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
intRemaining length value to encode
buffer
byte[]Message buffer for inserting encoded value
index
intIndex 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
MqttProtocolVersionProtocol version
Returns
- byte[]
Bytes rapresentation