You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
840 B

  1. using System.Collections.Generic;
  2. using System.Linq;
  3. namespace MQTTnet.Packets
  4. {
  5. public sealed class MqttSubscribePacket : MqttBasePacket, IMqttPacketWithIdentifier
  6. {
  7. public ushort PacketIdentifier { get; set; }
  8. public List<MqttTopicFilter> TopicFilters { get; set; } = new List<MqttTopicFilter>();
  9. /// <summary>
  10. /// Added in MQTT V5.
  11. /// </summary>
  12. public MqttSubscribePacketProperties Properties { get; set; } = new MqttSubscribePacketProperties();
  13. public override string ToString()
  14. {
  15. var topicFiltersText = string.Join(",", TopicFilters.Select(f => f.Topic + "@" + f.QualityOfServiceLevel));
  16. return string.Concat("Subscribe: [PacketIdentifier=", PacketIdentifier, "] [TopicFilters=", topicFiltersText, "]");
  17. }
  18. }
  19. }