Class MqttSetup
This is a helper class to encapsulate the needed properties for a proper mqtt setup.
Inheritance
Namespace: TeleScope.Connectors.Mqtt
Assembly: TeleScope.Connectors.Mqtt.dll
Syntax
public class MqttSetup : object
Constructors
| Improve this Doc View SourceMqttSetup()
Creates the default constructor with settings that connets to the public hiveMQ broker.
Declaration
public MqttSetup()
Properties
| Improve this Doc View SourceBroker
Gets or sets the broker for a MQTT connection.
Declaration
public string Broker { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ClientID
Gets or sets the client id for a MQTT connection.
Declaration
public string ClientID { get; set; }
Property Value
Type | Description |
---|---|
System.String |
LastWill
Message to be published by the client when he disconnects
Declaration
public string LastWill { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Name
Gets tha broker and port as string information.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Port
Gets or sets the port for a MQTT connection.
Declaration
public int Port { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
QualityOfService
Gets or sets the quality of service (QOS).
The QOS can have the values 0: AtMostOnce
, 1: AtLeastOnce
and 2: ExactlyOnce
.
Given values above or below the boundaries will be set to valid limits.
Declaration
public int QualityOfService { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Reconnection
Gets or sets the time in seconds to reconnect after a connection loss. If the value is set to the default of 0, no reconnection attempt will be done.
Declaration
public int Reconnection { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Topics
Gets or sets the list of topic strings.
Declaration
public List<string> Topics { get; set; }
Property Value
Type | Description |
---|---|
List<System.String> |
Methods
| Improve this Doc View SourceToString()
Returns a formatted string with important properties.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A fotmatted string. |