Generic MonoBehavior wrapping a MQTT client, using a double buffer to postpone message processing in the main thread.
More...
|
| virtual void | OnConnecting () |
| | Ovverride this method to take some actions before connection (e.g. More...
|
| |
| virtual void | OnConnected () |
| | Override this method to take some actions if the connection succeeded. More...
|
| |
| virtual void | OnConnectionFailed (string errorMessage) |
| | Override this method to take some actions if the connection failed. More...
|
| |
| virtual void | SubscribeTopics () |
| | Ovverride this method to subscribe to MQTT topics. More...
|
| |
| virtual void | UnsubscribeTopics () |
| | Ovverride this method to unsubscribe to MQTT topics (they should be the same you subscribed to with SubscribeTopics() ). More...
|
| |
| virtual void | OnApplicationQuit () |
| | Disconnect before the application quits. More...
|
| |
| virtual void | Awake () |
| | Initialize MQTT message queue Remember to call base.Awake() if you override this method. More...
|
| |
| virtual void | Start () |
| | Connect on startup if autoConnect is set to true. More...
|
| |
| virtual void | DecodeMessage (string topic, byte[] message) |
| | Override this method for each received message you need to process. More...
|
| |
| virtual void | OnDisconnected () |
| | Override this method to take some actions when disconnected. More...
|
| |
| virtual void | OnConnectionLost () |
| | Override this method to take some actions when the connection is closed. More...
|
| |
| virtual void | Update () |
| | Processing of income messages and events is postponed here in the main thread. More...
|
| |
| virtual void | ProcessMqttEvents () |
| |
Generic MonoBehavior wrapping a MQTT client, using a double buffer to postpone message processing in the main thread.
◆ Awake()
| virtual void M2MqttUnity.M2mqttUnityClient.Awake |
( |
| ) |
|
|
protectedvirtual |
Initialize MQTT message queue Remember to call base.Awake() if you override this method.
◆ Connect()
| virtual void M2MqttUnity.M2mqttUnityClient.Connect |
( |
| ) |
|
|
virtual |
Connect to the broker using current settings.
◆ DecodeMessage()
| virtual void M2MqttUnity.M2mqttUnityClient.DecodeMessage |
( |
string |
topic, |
|
|
byte [] |
message |
|
) |
| |
|
protectedvirtual |
Override this method for each received message you need to process.
◆ Disconnect()
| virtual void M2MqttUnity.M2mqttUnityClient.Disconnect |
( |
| ) |
|
|
virtual |
Disconnect from the broker, if connected.
◆ OnApplicationQuit()
| virtual void M2MqttUnity.M2mqttUnityClient.OnApplicationQuit |
( |
| ) |
|
|
protectedvirtual |
Disconnect before the application quits.
◆ OnConnected()
| virtual void M2MqttUnity.M2mqttUnityClient.OnConnected |
( |
| ) |
|
|
protectedvirtual |
Override this method to take some actions if the connection succeeded.
◆ OnConnecting()
| virtual void M2MqttUnity.M2mqttUnityClient.OnConnecting |
( |
| ) |
|
|
protectedvirtual |
Ovverride this method to take some actions before connection (e.g.
display a message)
◆ OnConnectionFailed()
| virtual void M2MqttUnity.M2mqttUnityClient.OnConnectionFailed |
( |
string |
errorMessage | ) |
|
|
protectedvirtual |
Override this method to take some actions if the connection failed.
◆ OnConnectionLost()
| virtual void M2MqttUnity.M2mqttUnityClient.OnConnectionLost |
( |
| ) |
|
|
protectedvirtual |
Override this method to take some actions when the connection is closed.
◆ OnDisconnected()
| virtual void M2MqttUnity.M2mqttUnityClient.OnDisconnected |
( |
| ) |
|
|
protectedvirtual |
Override this method to take some actions when disconnected.
◆ ProcessMqttEvents()
| virtual void M2MqttUnity.M2mqttUnityClient.ProcessMqttEvents |
( |
| ) |
|
|
protectedvirtual |
◆ Start()
| virtual void M2MqttUnity.M2mqttUnityClient.Start |
( |
| ) |
|
|
protectedvirtual |
Connect on startup if autoConnect is set to true.
◆ SubscribeTopics()
| virtual void M2MqttUnity.M2mqttUnityClient.SubscribeTopics |
( |
| ) |
|
|
protectedvirtual |
Ovverride this method to subscribe to MQTT topics.
◆ UnsubscribeTopics()
| virtual void M2MqttUnity.M2mqttUnityClient.UnsubscribeTopics |
( |
| ) |
|
|
protectedvirtual |
Ovverride this method to unsubscribe to MQTT topics (they should be the same you subscribed to with SubscribeTopics() ).
◆ Update()
| virtual void M2MqttUnity.M2mqttUnityClient.Update |
( |
| ) |
|
|
protectedvirtual |
Processing of income messages and events is postponed here in the main thread.
Remember to call ProcessMqttEvents() in Update() method if you override it.
◆ autoConnect
| bool M2MqttUnity.M2mqttUnityClient.autoConnect = false |
◆ brokerAddress
| string M2MqttUnity.M2mqttUnityClient.brokerAddress = "localhost" |
◆ brokerPort
| int M2MqttUnity.M2mqttUnityClient.brokerPort = 1883 |
◆ client
| MqttClient M2MqttUnity.M2mqttUnityClient.client |
|
protected |
◆ connectionDelay
| int M2MqttUnity.M2mqttUnityClient.connectionDelay = 500 |
◆ isEncrypted
| bool M2MqttUnity.M2mqttUnityClient.isEncrypted = false |
◆ timeoutOnConnection
| int M2MqttUnity.M2mqttUnityClient.timeoutOnConnection = MqttSettings.MQTT_CONNECT_TIMEOUT |
◆ ConnectionFailed
| Action M2MqttUnity.M2mqttUnityClient.ConnectionFailed |
Event fired when failing to connect
◆ ConnectionSucceeded
| Action M2MqttUnity.M2mqttUnityClient.ConnectionSucceeded |
Event fired when a connection is successfully estabilished
The documentation for this class was generated from the following file: