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.
 
 
 
 

29 lines
842 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. using MQTTnet.Packets;
  6. using MQTTnet.Serializer;
  7. namespace MQTTnet.Adapter
  8. {
  9. public interface IMqttChannelAdapter : IDisposable
  10. {
  11. string Endpoint { get; }
  12. IMqttPacketSerializer PacketSerializer { get; }
  13. event EventHandler ReadingPacketStarted;
  14. event EventHandler ReadingPacketCompleted;
  15. Task ConnectAsync(TimeSpan timeout, CancellationToken cancellationToken);
  16. Task DisconnectAsync(TimeSpan timeout, CancellationToken cancellationToken);
  17. Task SendPacketsAsync(TimeSpan timeout, IEnumerable<MqttBasePacket> packets, CancellationToken cancellationToken);
  18. Task<MqttBasePacket> ReceivePacketAsync(TimeSpan timeout, CancellationToken cancellationToken);
  19. }
  20. }