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.
 
 
 
 

25 line
701 B

  1. using MQTTnet.Core.Packets;
  2. namespace MQTTnet.Core.Internal
  3. {
  4. internal static class MqttApplicationMessageExtensions
  5. {
  6. public static MqttPublishPacket ToPublishPacket(this MqttApplicationMessage applicationMessage)
  7. {
  8. if (applicationMessage == null)
  9. {
  10. return null;
  11. }
  12. return new MqttPublishPacket
  13. {
  14. Topic = applicationMessage.Topic,
  15. Payload = applicationMessage.Payload,
  16. QualityOfServiceLevel = applicationMessage.QualityOfServiceLevel,
  17. Retain = applicationMessage.Retain,
  18. Dup = false
  19. };
  20. }
  21. }
  22. }