Table of Contents

Class MqttMsgConnect

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

Class for CONNECT message from client to broker

public class MqttMsgConnect : MqttMsgBase
Inheritance
MqttMsgConnect
Inherited Members
Extension Methods

Constructors

MqttMsgConnect()

Constructor

public MqttMsgConnect()

MqttMsgConnect(string)

Constructor

public MqttMsgConnect(string clientId)

Parameters

clientId string

Client identifier

MqttMsgConnect(string, string, string, bool, MqttQoSLevel, bool, string, string, bool, ushort, MqttProtocolVersion)

Constructor

public MqttMsgConnect(string clientId, string username, string password, bool willRetain, MqttQoSLevel willQosLevel, bool willFlag, string willTopic, string willMessage, bool cleanSession, ushort keepAlivePeriod, MqttProtocolVersion protocolVersion)

Parameters

clientId string

Client identifier

username string

Username

password string

Password

willRetain bool

Will retain flag

willQosLevel MqttQoSLevel

Will QOS level

willFlag bool

Will flag

willTopic string

Will topic

willMessage string

Will message

cleanSession bool

Clean sessione flag

keepAlivePeriod ushort

Keep alive period

protocolVersion MqttProtocolVersion

MQTT Protocol version

Properties

AuthenticationData

Authentication Data, v5.0 only

public byte[] AuthenticationData { get; set; }

Property Value

byte[]

AuthenticationMethod

Authentication Method, v5.0 only

public string AuthenticationMethod { get; set; }

Property Value

string

CleanSession

Clean session flag

public bool CleanSession { get; set; }

Property Value

bool

ClientId

Client identifier

public string ClientId { get; set; }

Property Value

string

KeepAlivePeriod

Keep alive period

public ushort KeepAlivePeriod { get; set; }

Property Value

ushort

Password

Password

public string Password { get; set; }

Property Value

string

ProtocolName

Protocol name

public string ProtocolName { get; set; }

Property Value

string

ProtocolVersion

Protocol version

public MqttProtocolVersion ProtocolVersion { get; set; }

Property Value

MqttProtocolVersion

ReceiveMaximum

ReceiveMaximum, v5.0 only

public ushort ReceiveMaximum { get; set; }

Property Value

ushort

RequestProblemInformation

Request Problem Information, v5.0 only

public bool RequestProblemInformation { get; set; }

Property Value

bool

RequestResponseInformation

Request Response Information, v5.0 only

public bool RequestResponseInformation { get; set; }

Property Value

bool

SessionExpiryInterval

Session Expiry Interval, v5.0 only

public uint SessionExpiryInterval { get; set; }

Property Value

uint

TopicAliasMaximum

TopicAliasMaximum, v5.0 only

public ushort TopicAliasMaximum { get; set; }

Property Value

ushort

Username

Username

public string Username { get; set; }

Property Value

string

WillDelayInterval

Will Delay Interval, v5.0 only

public uint WillDelayInterval { get; set; }

Property Value

uint

WillFlag

Will flag

public bool WillFlag { get; set; }

Property Value

bool

WillMessage

Will message

public string WillMessage { get; set; }

Property Value

string

WillQosLevel

Will QOS level

public byte WillQosLevel { get; set; }

Property Value

byte

WillRetain

Will retain flag

public bool WillRetain { get; set; }

Property Value

bool

WillTopic

Will topic

public string WillTopic { get; set; }

Property Value

string

Methods

GetBytes(MqttProtocolVersion)

public override byte[] GetBytes(MqttProtocolVersion protocolVersion)

Parameters

protocolVersion MqttProtocolVersion

MQTT protocol version

Returns

byte[]

Parse(byte, MqttProtocolVersion, IMqttNetworkChannel)

Parse bytes for a CONNECT message

public static MqttMsgConnect Parse(byte fixedHeaderFirstByte, MqttProtocolVersion protocolVersion, IMqttNetworkChannel channel)

Parameters

fixedHeaderFirstByte byte

First fixed header byte

protocolVersion MqttProtocolVersion

MQTT Protocol Version

channel IMqttNetworkChannel

Channel connected to the broker

Returns

MqttMsgConnect

CONNECT message instance

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.