25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MqttApplicationMessageExtensions.cs 701 B

123456789101112131415161718192021222324
  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. }