Class MqttMsgSubscribe
- Namespace
- nanoFramework.M2Mqtt.Messages
- Assembly
- nanoFramework.M2Mqtt.dll
Class for SUBSCRIBE message from client to broker
public class MqttMsgSubscribe : MqttMsgBase
- Inheritance
-
MqttMsgSubscribe
- Inherited Members
- Extension Methods
Constructors
MqttMsgSubscribe()
Constructor
public MqttMsgSubscribe()
MqttMsgSubscribe(string[], MqttQoSLevel[])
Constructor
public MqttMsgSubscribe(string[] topics, MqttQoSLevel[] qosLevels)
Parameters
topics
string[]List of topics to subscribe
qosLevels
MqttQoSLevel[]List of QOS Levels related to topics
Properties
NoLocal
If True, Application Messages MUST NOT be forwarded to a connection with a ClientID equal to the ClientID of the publishing connection, v5.0 only
public bool NoLocal { get; set; }
Property Value
QoSLevels
List of QOS Levels related to topics
public MqttQoSLevel[] QoSLevels { get; set; }
Property Value
RetainAsPublished
If true, Application Messages forwarded using this subscription keep the RETAIN flag they were published with. If false, Application Messages forwarded using this subscription have the RETAIN flag set to 0 v5.0 only
public bool RetainAsPublished { get; set; }
Property Value
RetainHandeling
Retain Handling option. This option specifies whether retained messages are sent when the subscription is established, v5.0 only
public MqttRetainHandeling RetainHandeling { get; set; }
Property Value
SubscriptionIdentifier
The Subscription Identifier can have the value of 1 to 268,435,455, v5.0 only
public int SubscriptionIdentifier { get; set; }
Property Value
Topics
List of topics to subscribe
public string[] Topics { get; set; }
Property Value
- string[]
Methods
GetBytes(MqttProtocolVersion)
Returns the bytes that represents the current object.
public override byte[] GetBytes(MqttProtocolVersion protocolVersion)
Parameters
protocolVersion
MqttProtocolVersionMQTT protocol version
Returns
- byte[]
An array of bytes that represents the current object.
Parse(byte, MqttProtocolVersion, IMqttNetworkChannel)
Parse bytes for a SUBSCRIBE message
public static MqttMsgSubscribe Parse(byte fixedHeaderFirstByte, MqttProtocolVersion protocolVersion, IMqttNetworkChannel channel)
Parameters
fixedHeaderFirstByte
byteFirst fixed header byte
protocolVersion
MqttProtocolVersionMQTT Protocol Version
channel
IMqttNetworkChannelChannel connected to the broker
Returns
- MqttMsgSubscribe
SUBSCRIBE message instance
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.