Skip to main content

GetMQTTMessage

Structure

GetMQTTMessage(sHost, sPort, sUser, sPassword, sClient, sTopic, bSSL, iTimeout)

Parameters

ParameterTypeDescription
sHostStringHost of the server to connect to.
sPortStringPort to send the message to.
sUserStringUser to connect as
sPasswordStringPassword to connect as
sClientStringClient ID to use
sTopicStringTarget Topic to send message to
bSSLBooleanWhether to use SSL when connecting
iTimeoutIntegerNumber of seconds to wait before timing out

Return value

The message found, or an error message describing the problem sending.

Description

This function connects to a server using the MQTT protocol and attempts to get a message from it. It always uses a clean session with QoS level 2.

Example

GetMQTTMessage("localhost", "1883", "", "", "IndyClient", "DemoTarget", false, 1)