mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 01:03:01 +08:00
20 lines
661 B
C#
20 lines
661 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace MQTTnet.Core.Packets
|
|
{
|
|
public sealed class MqttSubscribePacket : MqttBasePacket, IPacketWithIdentifier
|
|
{
|
|
public ushort PacketIdentifier { get; set; }
|
|
|
|
public IList<TopicFilter> TopicFilters { get; set; } = new List<TopicFilter>();
|
|
|
|
public override string ToString()
|
|
{
|
|
var topicFiltersText = string.Join(",", TopicFilters.Select(f => $"{f.Topic}@{f.QualityOfServiceLevel}"));
|
|
return
|
|
$"{nameof(MqttSubscribePacket)} [PacketIdentifier={PacketIdentifier}] [TopicFilters={topicFiltersText}]";
|
|
}
|
|
}
|
|
}
|