Mqtt Class
Namespace: GHIElectronics.TinyCLR.Networking.Mqtt · Assembly: GHIElectronics.TinyCLR.Networking.Mqtt
MQTT client. Construct with an MqttClientSetting, call Connect with an MqttConnectionSetting, subscribe to topics, and publish messages. Asynchronous events deliver inbound traffic.
public class Mqtt
Constructors
Mqtt(MqttClientSetting setting)
public Mqtt(MqttClientSetting setting)
No description available.
| Parameter | Type | Description |
|---|---|---|
setting | MqttClientSetting |
Properties
IsConnected
public bool IsConnected { get; set; }
No description available.
ClientId
public string ClientId { get; }
No description available.
ClientSetting
public MqttClientSetting ClientSetting { get; }
No description available.
ConnectionSetting
public MqttConnectionSetting ConnectionSetting { get; set; }
No description available.
Methods
Connect(MqttConnectionSetting setting)
public ConnectReturnCode Connect(MqttConnectionSetting setting)
No description available.
| Parameter | Type | Description |
|---|---|---|
setting | MqttConnectionSetting |
Returns ConnectReturnCode
Disconnect()
public void Disconnect()
No description available.
Subscribe(string[] topics, QoSLevel[] qosLevels, ushort packetId)
public void Subscribe(string[] topics, QoSLevel[] qosLevels, ushort packetId)
No description available.
| Parameter | Type | Description |
|---|---|---|
topics | string[] | |
qosLevels | QoSLevel[] | |
packetId | ushort |
Unsubscribe(string[] topics, ushort packetId)
public void Unsubscribe(string[] topics, ushort packetId)
No description available.
| Parameter | Type | Description |
|---|---|---|
topics | string[] | |
packetId | ushort |
Publish(string topic, byte[] data, QoSLevel qosLevel, bool retain, ushort packetId)
public void Publish(string topic, byte[] data, QoSLevel qosLevel, bool retain, ushort packetId)
No description available.
| Parameter | Type | Description |
|---|---|---|
topic | string | |
data | byte[] | |
qosLevel | QoSLevel | |
retain | bool | |
packetId | ushort |
Events
PublishReceivedChanged
public event PublishReceivedEventHandler PublishReceivedChanged
No description available.
PublishedChanged
public event PublishedEventHandler PublishedChanged
No description available.
SubscribedChanged
public event SubscribedEventHandler SubscribedChanged
No description available.
UnsubscribedChanged
public event UnsubscribedEventHandler UnsubscribedChanged
No description available.
ConnectedChanged
public event ConnectedEventHandler ConnectedChanged
No description available.