SendMQTTMessage
Structure
SendMQTTMessage(sHost, sPort, sUser, sPassword, sClient, sTopic, bSSL, sMessage)
Parameters
| Parameter | Type | Description |
|---|---|---|
sHost | String | Host of the server to connect to. |
sPort | String | Port to send the message to. |
sUser | String | User to connect as |
sPassword | String | Password to connect as |
sClient | String | Client ID to use |
sTopic | String | Target Topic to send message to |
bSSL | Boolean | Whether to use SSL when connecting |
sMessage | String | The message to send. |
Return value
"Message Sent." or error message describing the problem sending.
Description
This function connects to a server using the MQTT protocol and attempts to send a message to it. It always uses a clean session with QoS level 2.
Example
SendMQTTMessage("localhost", "1883", "", "", "IndyClient", "DemoTarget", false, "Test message from IndySoft")