mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-19 19:13:11 +08:00
34 lines
971 B
C#
34 lines
971 B
C#
namespace MQTTnet.Packets
|
|
{
|
|
public class MqttConnectPacket : MqttBasePacket
|
|
{
|
|
public string ProtocolName { get; set; }
|
|
|
|
public byte? ProtocolLevel { get; set; }
|
|
|
|
public string ClientId { get; set; }
|
|
|
|
public string Username { get; set; }
|
|
|
|
public string Password { get; set; }
|
|
|
|
public ushort KeepAlivePeriod { get; set; }
|
|
|
|
// Also called "Clean Start" in MQTTv5.
|
|
public bool CleanSession { get; set; }
|
|
|
|
public MqttApplicationMessage WillMessage { get; set; }
|
|
|
|
#region Added in MQTTv5.0.0
|
|
|
|
public MqttConnectPacketProperties Properties { get; set; }
|
|
|
|
#endregion
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Concat("Connect: [ProtocolLevel=", ProtocolLevel, "] [ClientId=", ClientId, "] [Username=", Username, "] [Password=", Password, "] [KeepAlivePeriod=", KeepAlivePeriod, "] [CleanSession=", CleanSession, "]");
|
|
}
|
|
}
|
|
}
|