![]() |
Helper Class Reference
1.1
HomeGenie - Automation Programs' Engine SDK
|
MQTT client helper. Class instance accessor: MqttClient More...
Public Member Functions | |
| MqttClientHelper | Service (string server) |
| Sets the MQTT server to use. More... | |
| MqttClientHelper | Connect (string clientId) |
| Connects to the MQTT server using the default port (1883) and the specified client identifier. More... | |
| MqttClientHelper | Connect (int port, string clientId) |
| Connects to the MQTT server using the specified port and client identifier. More... | |
| MqttClientHelper | Connect (int port, string clientId, Action callback) |
| Connects to the MQTT server using the specified port and client identifier and a callback function in case of lost connection. More... | |
| MqttClientHelper | Disconnect () |
| Disconnects from the MQTT server. More... | |
| MqttClientHelper | Subscribe (string topic, Action< string, string > callback) |
| Subscribe the specified topic. More... | |
| MqttClientHelper | Publish (string topic, string message) |
| Publish a message to the specified topic. More... | |
| MqttClientHelper | Publish (string topic, byte[] message) |
| Publish a message to the specified topic. More... | |
| MqttClientHelper | WithCredentials (string user, string pass) |
| Use provided credentials when connecting. More... | |
MQTT client helper. Class instance accessor: MqttClient
| MqttClientHelper Service | ( | string | server | ) |
Sets the MQTT server to use.
| server | MQTT server address. |
| MqttClientHelper Connect | ( | string | clientId | ) |
Connects to the MQTT server using the default port (1883) and the specified client identifier.
| clientId | The client identifier. |
| MqttClientHelper Connect | ( | int | port, |
| string | clientId | ||
| ) |
Connects to the MQTT server using the specified port and client identifier.
| port | MQTT server port. |
| clientId | The client identifier. |
| MqttClientHelper Connect | ( | int | port, |
| string | clientId, | ||
| Action | callback | ||
| ) |
Connects to the MQTT server using the specified port and client identifier and a callback function in case of lost connection.
| port | MQTT server port. |
| clientId | The client identifier. |
| callback | The name of callback function, like RefreshConnection |
Action RefreshConnection = () => {...}
| MqttClientHelper Disconnect | ( | ) |
Disconnects from the MQTT server.
| MqttClientHelper Subscribe | ( | string | topic, |
| Action< string, string > | callback | ||
| ) |
Subscribe the specified topic.
| topic | Topic name. |
| callback | Callback for receiving the subscribed topic messages. |
| MqttClientHelper Publish | ( | string | topic, |
| string | message | ||
| ) |
Publish a message to the specified topic.
| topic | Topic name. |
| message | Message text. |
| MqttClientHelper Publish | ( | string | topic, |
| byte[] | message | ||
| ) |
Publish a message to the specified topic.
| topic | Topic name. |
| message | Message text as byte array. |
| MqttClientHelper WithCredentials | ( | string | user, |
| string | pass | ||
| ) |
1.8.11