SetLWT

The set Last Will and Testament (SetLWT) method is used to store a message in the MQTT broker which is published from the broker to connected clients in the event a client disconnects ungracefully. For example if a client’s wi-fi connection drops unexpectedly, or the client’s goes dead, the MQTT broker will detect the client is no longer connected and broadcast the dead client’s Last Will and Testament to all connected clients.

Group:  MQTT Object

Syntax:  oMQTT.SetLWT(Topic, Payload)

Topic            (String) The subject of the message/information that a client subscribes to

Payload        (String) The text (message) that is associated with the topic

Example:

Dim WithEvents moClient As MQTT

moClient.SetLWT("LWT Topic", "This client is no longer on line.")

 

Versions Supported:      RFgen 5.1.1.35 and 5.2.3 and newer.