DT MQTT is the UE’s MQTT client plug -in. You can use t…
目录(Contents)
1. Node Description
Create Mqtt Client
![[Unreal Engine] DT MQTT plug -in detailed description [Unreal Engine] DT MQTT plug -in detailed description](https://dt.cq.cn/wp-content/uploads/2023/07/image-6.png)
Create an MQTT client object. The returned object needs to be promoted to a variable, and it will be operated with this object in the future.
Connect
![[Unreal Engine] DT MQTT plug -in detailed description [Unreal Engine] DT MQTT plug -in detailed description](https://dt.cq.cn/wp-content/uploads/2023/07/image-7.png)
* Connects to an MQTT server using the provided connect options.
* Param Url : the address of the server to connect to, specified as a URI.
* Param ClientId : a client identifier that is unique on the server being connected to
* Param UserName : The user name for connecting to the MQTT broker.
* Param Password : The password for connecting to the MQTT broker.
Subscribe
![[Unreal Engine] DT MQTT plug -in detailed description [Unreal Engine] DT MQTT plug -in detailed description](https://dt.cq.cn/wp-content/uploads/2023/07/image-8.png)
* Subscribe to a topic, which may include wildcards.
* Param TopicFilter : the topic to subscribe to, which can include wildcards.
* Param QoS : The quality of service for the subscription
Un Subscribe
![[Unreal Engine] DT MQTT plug -in detailed description [Unreal Engine] DT MQTT plug -in detailed description](https://dt.cq.cn/wp-content/uploads/2023/07/image-16.png)
* Requests the server unsubscribe the client from a topic.
* Param TopicFilter : the topic to unsubscribe from. It must match a topicFilter specified on an earlier subscribe.
Publish
![[Unreal Engine] DT MQTT plug -in detailed description [Unreal Engine] DT MQTT plug -in detailed description](https://dt.cq.cn/wp-content/uploads/2023/07/image-21.png)
* Publishes a message to a topic on the server
* Param Topic : The topic to deliver the message to
* Param Message : sent message
* Param QoS : the Quality of Service to deliver the message at. Valid values are 0, 1 or 2.
* Param Retained : whether or not this message should be retained by the server.
Disconnect
![[Unreal Engine] DT MQTT plug -in detailed description [Unreal Engine] DT MQTT plug -in detailed description](https://dt.cq.cn/wp-content/uploads/2023/07/image-17.png)
Disconnects from the server.
Bind Connected Delegate
![[Unreal Engine] DT MQTT plug -in detailed description [Unreal Engine] DT MQTT plug -in detailed description](https://dt.cq.cn/wp-content/uploads/2023/07/image-18.png)
This method is called when the client is connected.
Bind Connection Lost Delegate
![[Unreal Engine] DT MQTT plug -in detailed description [Unreal Engine] DT MQTT plug -in detailed description](https://dt.cq.cn/wp-content/uploads/2023/07/image-19.png)
This method is called when the connection to the server is lost.
Bind Message Delegate
![[Unreal Engine] DT MQTT plug -in detailed description [Unreal Engine] DT MQTT plug -in detailed description](https://dt.cq.cn/wp-content/uploads/2023/07/image-20.png)
This method is called when a message arrives from the server.