Class: MASPluginMQTTConstants

MASPluginMQTTConstants(host, port, enableTLS, sslCACert)

The Class definition of a generic MQTT message structure.

Constructor

new MASPluginMQTTConstants(host, port, enableTLS, sslCACert)

Parameters:
Name Type Description
host string Hostname of the MQTT broker.
port number Port on which the MQTT broker is listening.
enableTLS boolean Enable TLS support for the connection.
sslCACert string Base64 encoded certificate, if the MQTT broker requires client certificate.
Source:

Methods

setCleanSession(mCleanSession)

Sets the clean session property of the client.
Parameters:
Name Type Description
mCleanSession boolean specifies whether to clean the previous session
Source:

setConnectionTimeOut(timeOutSeconds)

Sets the connection timeout for the MQTT client.
Parameters:
Name Type Description
timeOutSeconds number Timeout in seconds.
Source:

setKeepAlive(keepAliveSeconds)

Sets the keep alive property of the client session.
Parameters:
Name Type Description
keepAliveSeconds number keepAlive in seconds.
Source:

setUserCredentials(userName, password)

Sets the credentials if the broker connection requires authentication.
Parameters:
Name Type Description
userName string Broker Account username
password string Broker Account password
Source:

setWillToTopic(payload, toTopic, willQoS, retain)

Sets the will of the MQTT message.
Parameters:
Name Type Description
payload string The final message that broker sends to all the connected clients before it dies due to abrupt reasons.
toTopic string Name of the Last Will topic.
willQoS number Quality of service for the Last Will.
retain boolean Whether to retain the message if sending fails or not.
Source: