mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-23 05:13:06 +08:00
29 lines
784 B
C#
29 lines
784 B
C#
using MQTTnet.Protocol;
|
|
|
|
namespace MQTTnet.Packets
|
|
{
|
|
public class MqttPublishPacket : MqttBasePublishPacket
|
|
{
|
|
public bool Retain { get; set; }
|
|
|
|
public MqttQualityOfServiceLevel QualityOfServiceLevel { get; set; }
|
|
|
|
public bool Dup { get; set; }
|
|
|
|
public string Topic { get; set; }
|
|
|
|
public byte[] Payload { get; set; }
|
|
|
|
#region Added in MQTTv5
|
|
|
|
public MqttPublishPacketProperties Properties { get; set; }
|
|
|
|
#endregion
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Concat("Publish: [Topic=", Topic, "] [Payload.Length=", Payload?.Length, "] [QoSLevel=", QualityOfServiceLevel, "] [Dup=", Dup, "] [Retain=", Retain, "] [PacketIdentifier=", PacketIdentifier, "]");
|
|
}
|
|
}
|
|
}
|