This repository has been archived by the owner on Dec 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathIFsMqtt.cs
84 lines (70 loc) · 2.84 KB
/
IFsMqtt.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
namespace FSMosquitoClient
{
using System;
using System.Threading.Tasks;
public interface IFsMqtt : IDisposable
{
/// <summary>
/// Event that is raised when an MQTT Connection is successfully established.
/// </summary>
public event EventHandler MqttConnectionOpened;
/// <summary>
/// Event that is raised when an MQTT Connection is closed. Usually due to server shutdown/issues.
/// </summary>
public event EventHandler MqttConnectionClosed;
/// <summary>
/// Event that is raised when a MQTT Message is recieved.
/// </summary>
public event EventHandler MqttMessageRecieved;
/// <summary>
/// Event that is raised when a MQTT Message is transmitted.
/// </summary>
public event EventHandler MqttMessageTransmitted;
/// <summary>
/// Event that is raised when an ApplicationMessage is recieved on a ATC Notification related topic.
/// </summary>
public event EventHandler<AtcNotification> AtcNotificationReceived;
/// <summary>
/// Event that is raised when a SimConnect Topic Subscription request is received.
/// </summary>
public event EventHandler<(string, SimConnectTopic[])> SubscribeRequestReceived;
/// <summary>
/// Event that is raised when a SimConnect Set SimVar value request is recieved.
/// </summary>
public event EventHandler<(string datumName, uint? objectId, object value)> SetSimVarValueRequestReceived;
/// <summary>
/// Gets a value that indicates if the current instance is connected to MQTT
/// </summary>
bool IsConnected { get; }
/// <summary>
/// Gets a value that indicates if the current instance has been disposed
/// </summary>
bool IsDisposed { get; }
/// <summary>
/// Gets the url of the Mqtt Broker that the implementation is using
/// </summary>
string MqttBrokerUrl { get; }
/// <summary>
/// Start receiving messages from MQTT
/// </summary>
Task Connect();
/// <summary>
/// Stops receiving messages from MQTT
/// </summary>
Task Disconnect();
/// <summary>
/// Publishes the specified simconnect status
/// </summary>
/// <param name="simConnectStatus"></param>
/// <returns></returns>
Task PublishSimConnectStatus(string simConnectStatus);
/// <summary>
/// Publishes the specified topic value to the MQTT broker
/// </summary>
/// <param name="topic"></param>
/// <param name="objectId"></param>
/// <param name="value"></param>
/// <returns></returns>
Task PublishTopicValue(SimConnectTopic topic, uint objectId, object value);
}
}