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.
 
 
 
 

51 lines
1.7 KiB

  1. using MQTTnet.Client.Connecting;
  2. using MQTTnet.Client.Disconnecting;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. using MQTTnet.Client;
  8. namespace MQTTnet.Extensions.ManagedClient
  9. {
  10. public interface IManagedMqttClient : IApplicationMessageReceiver, IApplicationMessagePublisher, IDisposable
  11. {
  12. /// <summary>
  13. /// Gets the internally used MQTT client.
  14. /// This property should be used with caution because manipulating the internal client might break the managed client.
  15. /// </summary>
  16. IMqttClient InternalClient { get; }
  17. bool IsStarted { get; }
  18. bool IsConnected { get; }
  19. int PendingApplicationMessagesCount { get; }
  20. IManagedMqttClientOptions Options { get; }
  21. IMqttClientConnectedHandler ConnectedHandler { get; set; }
  22. IMqttClientDisconnectedHandler DisconnectedHandler { get; set; }
  23. IApplicationMessageProcessedHandler ApplicationMessageProcessedHandler { get; set; }
  24. IApplicationMessageSkippedHandler ApplicationMessageSkippedHandler { get; set; }
  25. IConnectingFailedHandler ConnectingFailedHandler { get; set; }
  26. ISynchronizingSubscriptionsFailedHandler SynchronizingSubscriptionsFailedHandler { get; set; }
  27. Task StartAsync(IManagedMqttClientOptions options);
  28. Task StopAsync();
  29. Task PingAsync(CancellationToken cancellationToken);
  30. Task SubscribeAsync(IEnumerable<MqttTopicFilter> topicFilters);
  31. Task UnsubscribeAsync(IEnumerable<string> topics);
  32. Task PublishAsync(ManagedMqttApplicationMessage applicationMessages);
  33. }
  34. }