Document metadata

Application name

CSK_Module_MQTTClient

Version

2.1.1

Date

2025-04-11

Author

SICK AG

Crowns

CSK_Module_MQTTClient

Short description

This is an automatically generated CROWN (description not necessary).

CSK_MQTTClient

Short description

Module to provide MQTTClient functionality. Please check the MQTTClient API docu of the device regarding further background information…​
Typically the features of this module are used like this (check also main script of this module):

1) Setup
At least set MQTT Broker IP ("setBrokerIP") and used port ("setMQTTPort"). Check also further "set"-functions if required.

2) Connect
Connect to the broker via "connectMQTT".

3) Subscriptions
Subscribe to MQTT topics by using "addSubscription" (via script) or "addSubscriptionViaUI" (via UI) to use preset values (check "presetSubscription…​"-functions)
It is possible to forward incoming messages of the configured topics via the event "CSK_MQTTClient.OnReceive" of this module by setting "setForwardReceivedMessages".
It is also possible to get the MQTTClient handle via "getMQTTHandle" to use this instance in other modules / apps.

4) Publish
It is possible to publish MQTT messages via "publish" (via script) or "publishViaUI (via UI) to use preset values (check "presetPublish…​"-functions)
Additionally it is possible to configure the module to listen / wait for specific events of other modules/apps and to forward their content to predefined topics with predefined QoS/Retain.
This can be used e.g. to listen to "OtherModule.OnNewResult"-events and to forward the results via MQTT (data will be forwarded to data type 'string').
To do so make use of "addPublishEvent" (via script) or the "presetPublish"-functions (incl. "presetPublishEvent") and "addPublishEventViaUI".

5) WillMessage
Configure a WillMessage via "setWillMessageConfig" (via script) or "setWillMessageViaUI (via UI) to use the preset values of the "presetPublish"-functions and activate it via "setWillMessageActivation".
Additionally you can set via 'setDisconnectWithWillMessage' if the WillMessage should be sent when disconnecting from MQTT broker normally.

Overview

Functions

CSK_MQTTClient.addPublishEvent()
Short description

Function to add an event to listen to and forward content (as string) if notified with configured MQTT publish message.

Parameters
Name Type Multiplicity Description

event

STRING

1

Name of event to register (event with one parameter expected).

topic

STRING

1

Data content of the event will be publsihed to this MQTT topic.

qos

ENUM
CSK_MQTTClient.QOS

1

QoS of publish message.

retain

ENUM
CSK_MQTTClient.Retain

1

Retain option of the publish.

Sample (auto-generated)
CSK_MQTTClient.addPublishEvent(event, topic, qos, retain)
CSK_MQTTClient.addPublishEventViaUI()
Short description

Function to add a preset event with preset configuration (topic, QoS, Retain) to listen to and to forward content (as string) via MQTT publish.

Sample (auto-generated)
CSK_MQTTClient.addPublishEventViaUI()
CSK_MQTTClient.addSubscription()
Short description

Function to add a MQTT topic to subscribe to.

Parameters
Name Type Multiplicity Description

topicFilter

STRING

1

Topic to subscribe to.

qos

ENUM
CSK_MQTTClient.QOS

1

Quality of service level. Default is QOS0.

Sample (auto-generated)
CSK_MQTTClient.addSubscription(topicFilter, qos)
CSK_MQTTClient.addSubscriptionViaUI()
Short description

Function to subscribe to preset topic with QoS.

Sample (auto-generated)
CSK_MQTTClient.addSubscriptionViaUI()
CSK_MQTTClient.clearFlowConfigRelevantConfiguration()
Short description

Function to clear FlowConfig relevant configurations.

Sample (auto-generated)
CSK_MQTTClient.clearFlowConfigRelevantConfiguration()
CSK_MQTTClient.connectMQTT()
Short description

Function to connect to MQTT broker.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.connectMQTT(status)
CSK_MQTTClient.getMQTTHandle()
Short description

Function to get MQTT Client handle (e.g. to register directly on the "OnRecieve" events in other modules).

Return values
Name Type Multiplicity Description

handle

HANDLE
MQTTClient

1

Handle of the MQTT Client.

Sample (auto-generated)
handle = CSK_MQTTClient.getMQTTHandle()
CSK_MQTTClient.getParameters()
Short description

Function to get all parameters of the client in JSON format.

Return values
Name Type Multiplicity Description

jsonParameters

STRING

1

JSON string with all parameters.

Sample (auto-generated)
jsonParameters = CSK_MQTTClient.getParameters()
CSK_MQTTClient.getStatusModuleActive()
Short description

Function to get status if module is active.

Return values
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
status = CSK_MQTTClient.getStatusModuleActive()
CSK_MQTTClient.loadParameters()
Short description

Load parameters for this module from the CSK_PersistentData module if possible and use them.

Return values
Name Type Multiplicity Description

success

BOOL

1

Success to load parameters.

Sample (auto-generated)
success = CSK_MQTTClient.loadParameters()
CSK_MQTTClient.pageCalled()
Short description

Function to register "OnResume" of the module UI (only as helper function).

Return values
Name Type Multiplicity Description

empty

STRING

1

Empty string (only needed to simplify binding).

Sample (auto-generated)
empty = CSK_MQTTClient.pageCalled()
CSK_MQTTClient.presetPublishData()
Short description

Function to preset the data to publish (see "publishViaUI").

Parameters
Name Type Multiplicity Description

data

STRING

1

Data

Sample (auto-generated)
CSK_MQTTClient.presetPublishData(data)
CSK_MQTTClient.presetPublishEvent()
Short description

Function to preset eventname to register to and to forward its content via MQTT publish (see "addPublishEventViaUI").

Parameters
Name Type Multiplicity Description

name

STRING

1

Name of event

Sample (auto-generated)
CSK_MQTTClient.presetPublishEvent(name)
CSK_MQTTClient.presetPublishQOS()
Short description

Function to preset the QoS of the preset data to publish (see "addPublishEventViaUI" or "publishViaUI").

Parameters
Name Type Multiplicity Description

qos

ENUM
CSK_MQTTClient.QOS

1

QoS

Sample (auto-generated)
CSK_MQTTClient.presetPublishQOS(qos)
CSK_MQTTClient.presetPublishRetain()
Short description

Function to preset the retain flag of the data to publish (see "addPublishEventViaUI" or "publishViaUI").

Parameters
Name Type Multiplicity Description

status

ENUM
CSK_MQTTClient.Retain

1

Status

Sample (auto-generated)
CSK_MQTTClient.presetPublishRetain(status)
CSK_MQTTClient.presetPublishTopic()
Short description

Function to preset a topic to publish to (see "addPublishEventViaUI" or "publishViaUI").

Parameters
Name Type Multiplicity Description

topic

STRING

1

Topic

Sample (auto-generated)
CSK_MQTTClient.presetPublishTopic(topic)
CSK_MQTTClient.presetSubscriptionQOS()
Short description

Function to preset QoS of topic to subscribe (see "addSubscriptionViaUI").

Parameters
Name Type Multiplicity Description

qos

ENUM
CSK_MQTTClient.QOS

1

QoS

Sample (auto-generated)
CSK_MQTTClient.presetSubscriptionQOS(qos)
CSK_MQTTClient.presetSubscriptionTopic()
Short description

Function to preset topic to subscribe (see "addSubscriptionViaUI").

Parameters
Name Type Multiplicity Description

topic

STRING

1

Topic

Sample (auto-generated)
CSK_MQTTClient.presetSubscriptionTopic(topic)
CSK_MQTTClient.publish()
Short description

Function to publish a message on a topic to an MQTT server.

Parameters
Name Type Multiplicity Description

topic

STRING

1

The topic under which to publish the message.

data

BINARY

1

The message payload to publish.

qos

ENUM
CSK_MQTTClient.QOS

?

The quality of service level. Default is QOS0.

retain

ENUM
CSK_MQTTClient.Retain

?

Retaining a message means that the server stores the message and sends it to future subscribers of this topic. Default is NO_RETAIN.

Sample (auto-generated)
CSK_MQTTClient.publish(topic, data, qos, retain)
CSK_MQTTClient.publishViaUI()
Short description

Function to publish data with preset configuration (see "preset" functions).

Sample (auto-generated)
CSK_MQTTClient.publishViaUI()
CSK_MQTTClient.removePublishEvent()
Short description

Function to remove and deregister of event to not forward content as MQTT publish (anymore).

Parameters
Name Type Multiplicity Description

event

STRING

1

Name of event

Sample (auto-generated)
CSK_MQTTClient.removePublishEvent(event)
CSK_MQTTClient.removePublishEventViaUI()
Short description

Function to remove preselected event via UI (see "selectPublishEvent").

Sample (auto-generated)
CSK_MQTTClient.removePublishEventViaUI()
CSK_MQTTClient.resetModule()
Short description

Function to reset main configuration of module.

Sample (auto-generated)
CSK_MQTTClient.resetModule()
CSK_MQTTClient.selectPublishEvent()
Short description

Function to select event of list to publish via UI.

Parameters
Name Type Multiplicity Description

selection

STRING

1

Selection

Sample (auto-generated)
CSK_MQTTClient.selectPublishEvent(selection)
CSK_MQTTClient.selectSubscriptionViaUI()
Short description

Function to select subscription via UI.

Parameters
Name Type Multiplicity Description

selection

STRING

1

Selection

Sample (auto-generated)
CSK_MQTTClient.selectSubscriptionViaUI(selection)
CSK_MQTTClient.sendParameters()
Short description

Send parameters to CSK_PersistentData module if possible to save them.

Parameters
Name Type Multiplicity Description

noDataSave

BOOL

?

[Optional] Set to TRUE if the data should NOT be saved immediately after sending.

Sample (auto-generated)
CSK_MQTTClient.sendParameters(noDataSave)
CSK_MQTTClient.setBirthMessageActivation()
Short description

Function to set activation of BirthMessage.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.setBirthMessageActivation(status)
CSK_MQTTClient.setBirthMessageConfigViaUI()
Short description

Function to set config of BirthMessage via UI with preset configuration (check "presetPublish…​"-functions).

Sample (auto-generated)
CSK_MQTTClient.setBirthMessageConfigViaUI()
CSK_MQTTClient.setBrokerIP()
Short description

Function to set the IP of the MQTT broker.

Parameters
Name Type Multiplicity Description

ip

STRING

1

IP

Sample (auto-generated)
CSK_MQTTClient.setBrokerIP(ip)
CSK_MQTTClient.setCABundlePath()
Short description

Function to set path to CA bundle if it is activated.

Parameters
Name Type Multiplicity Description

path

STRING

1

Path

Sample (auto-generated)
CSK_MQTTClient.setCABundlePath(path)
CSK_MQTTClient.setCleanSession()
Short description

Function to set clean session mode.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status (default is true)

Sample (auto-generated)
CSK_MQTTClient.setCleanSession(status)
CSK_MQTTClient.setClientCertificateKeyPassword()
Short description

Function to set optional passphrase for client certification private key.

Parameters
Name Type Multiplicity Description

password

STRING

1

Password (Per default empty to not use passphrase)

Sample (auto-generated)
CSK_MQTTClient.setClientCertificateKeyPassword(password)
CSK_MQTTClient.setClientCertificateKeyPath()
Short description

Function to set path to client private key in PEM/DER format (if client authentification is used).

Parameters
Name Type Multiplicity Description

path

STRING

1

Path

Sample (auto-generated)
CSK_MQTTClient.setClientCertificateKeyPath(path)
CSK_MQTTClient.setClientCertificatePath()
Short description

Function to set path to client certificate file im PEM/DER/PKCS#12 format (if client authentification is used).

Parameters
Name Type Multiplicity Description

path

STRING

1

Path

Sample (auto-generated)
CSK_MQTTClient.setClientCertificatePath(path)
CSK_MQTTClient.setClientID()
Short description

Function to set the client identifier to be used by this MQTTClient instance.

Parameters
Name Type Multiplicity Description

id

STRING

1

Client ID

Sample (auto-generated)
CSK_MQTTClient.setClientID(id)
CSK_MQTTClient.setConnectionTimeout()
Short description

Function to set the timeout to wait initially until the client gets connected.

Parameters
Name Type Multiplicity Description

time

INT

1

Timeout in [ms]

Sample (auto-generated)
CSK_MQTTClient.setConnectionTimeout(time)
CSK_MQTTClient.setDisconnectWithWillMessage()
Short description

Function to set if WillMessage should be sent when disconnecting from MQTT broker normally.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.setDisconnectWithWillMessage(status)
CSK_MQTTClient.setFlowConfigPriority()
Short description

Function to configure if FlowConfig should have priority for FlowConfig relevant configuration.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.setFlowConfigPriority(status)
CSK_MQTTClient.setForwardReceivedMessages()
Short description

Function to set if received messages of subscribed topics should be forwarded via "OnReceive"-event.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.setForwardReceivedMessages(status)
CSK_MQTTClient.setHostnameVerification()
Short description

Function to set hostname verification.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.setHostnameVerification(status)
CSK_MQTTClient.setInterface()
Short description

Function to set interface to use for MQTT connection.

Parameters
Name Type Multiplicity Description

interface

STRING

1

Interface

Sample (auto-generated)
CSK_MQTTClient.setInterface(interface)
CSK_MQTTClient.setKeepAliveInterval()
Short description

Function to set keep alive interval.

Parameters
Name Type Multiplicity Description

time

INT

1

Seconds after which a PING message should be sent if no other messages have been exchanged in that time. Disable keep alive mechanism with 0.

Sample (auto-generated)
CSK_MQTTClient.setKeepAliveInterval(time)
CSK_MQTTClient.setLoadOnReboot()
Short description

Configure if this module should load its saved parameters at app/device boot up.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Set status

Sample (auto-generated)
CSK_MQTTClient.setLoadOnReboot(status)
CSK_MQTTClient.setLogAllMessages()
Short description

Function to set if all messages regarding send/received data should be logged in UI.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.setLogAllMessages(status)
CSK_MQTTClient.setMQTTPort()
Short description

Function to set MQTT port.

Parameters
Name Type Multiplicity Description

port

INT

1

Port

Sample (auto-generated)
CSK_MQTTClient.setMQTTPort(port)
CSK_MQTTClient.setParameterName()
Short description

Function to set the name of the parameters if saved/loaded via the CSK_PersistentData module.

Parameters
Name Type Multiplicity Description

name

STRING

1

Name of the parameter

Sample (auto-generated)
CSK_MQTTClient.setParameterName(name)
CSK_MQTTClient.setPassword()
Short description

Function to set password if credentials should be used (see "setUseCredentials").

Parameters
Name Type Multiplicity Description

password

STRING

1

Password

Sample (auto-generated)
CSK_MQTTClient.setPassword(password)
CSK_MQTTClient.setPeerVerification()
Short description

Function to set peer verification.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status (default is true)

Sample (auto-generated)
CSK_MQTTClient.setPeerVerification(status)
CSK_MQTTClient.setTLSVersion()
Short description

Function to select if and what TLS version to use.

Parameters
Name Type Multiplicity Description

version

ENUM
CSK_MQTTClient.TLSVersion

1

TLS version

Sample (auto-generated)
CSK_MQTTClient.setTLSVersion(version)
CSK_MQTTClient.setTopicPrefix()
Short description

Function to set prefix for all topics.

Parameters
Name Type Multiplicity Description

prefix

STRING

1

Prefix to use for all topics.

Sample (auto-generated)
CSK_MQTTClient.setTopicPrefix(prefix)
CSK_MQTTClient.setUseCABundle()
Short description

Function to set if CA bundle should be used.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.setUseCABundle(status)
CSK_MQTTClient.setUseClientCertificate()
Short description

Function to set if client certificate should be used.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.setUseClientCertificate(status)
CSK_MQTTClient.setUseCredentials()
Short description

Function to set if credentials should be used for MQTT connection.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.setUseCredentials(status)
CSK_MQTTClient.setUsername()
Short description

Function to set username if credentials should be used (see "setUseCredentials").

Parameters
Name Type Multiplicity Description

username

STRING

1

Username

Sample (auto-generated)
CSK_MQTTClient.setUsername(username)
CSK_MQTTClient.setWillMessageActivation()
Short description

Function to set activation of WillMessage.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MQTTClient.setWillMessageActivation(status)
CSK_MQTTClient.setWillMessageConfig()
Short description

Function to set config of WillMessage.

Parameters
Name Type Multiplicity Description

topic

STRING

1

Topic under which to publish the message.

data

STRING

1

The message payload to publish.

qos

ENUM
CSK_MQTTClient.QOS

1

Quality of Service level. Default is QOS0.

retain

ENUM
CSK_MQTTClient.Retain

1

Retaining a message means that the server stores the message and sends it to future subscribers of this topic. Default is NO_RETAIN.

Sample (auto-generated)
CSK_MQTTClient.setWillMessageConfig(topic, data, qos, retain)
CSK_MQTTClient.setWillMessageConfigViaUI()
Short description

Function to set config of WillMessage via UI with preset configuration (check "presetPublish…​"-functions).

Sample (auto-generated)
CSK_MQTTClient.setWillMessageConfigViaUI()
CSK_MQTTClient.unsubscribe()
Short description

Function to unsubscribe from a MQTT topic.

Parameters
Name Type Multiplicity Description

topic

STRING

1

Topic

Sample (auto-generated)
CSK_MQTTClient.unsubscribe(topic)
CSK_MQTTClient.unsubscribeViaUI()
Short description

Function to unsubscribe from preselected topic via UI (see "selectSubscriptionViaUI").

Sample (auto-generated)
CSK_MQTTClient.unsubscribeViaUI()

Events

CSK_MQTTClient.OnDataLoadedOnReboot
Short description

Event to call if module tried to load parameters and should be ready.

Sample (auto-generated)
function handleOnDataLoadedOnReboot()
  -- Do something
end

Script.register("CSK_MQTTClient.OnDataLoadedOnReboot", "handleOnDataLoadedOnReboot")
CSK_MQTTClient.OnNewBrokerIP
Short description

Notify current broker IP.

Callback arguments
Name Type Multiplicity Description

ip

STRING

1

IP

Sample (auto-generated)
function handleOnNewBrokerIP(ip)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewBrokerIP", "handleOnNewBrokerIP")
CSK_MQTTClient.OnNewConnectionStatus
Short description

Event notified with the connection status.

Callback arguments
Name Type Multiplicity Description

status

STRING

1

Connection status message.

Sample (auto-generated)
function handleOnNewConnectionStatus(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewConnectionStatus", "handleOnNewConnectionStatus")
CSK_MQTTClient.OnNewLog
Short description

Notify latest log messages (max. 200).

Callback arguments
Name Type Multiplicity Description

logs

STRING

1

Logs

Sample (auto-generated)
function handleOnNewLog(logs)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewLog", "handleOnNewLog")
CSK_MQTTClient.OnNewMQTTPort
Short description

Notify current MQTT port.

Callback arguments
Name Type Multiplicity Description

port

INT

1

Port

Sample (auto-generated)
function handleOnNewMQTTPort(port)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewMQTTPort", "handleOnNewMQTTPort")
CSK_MQTTClient.OnNewParameterName
Short description

Notify name of persistent data parameter.

Callback arguments
Name Type Multiplicity Description

name

STRING

1

Parameter name

Sample (auto-generated)
function handleOnNewParameterName(name)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewParameterName", "handleOnNewParameterName")
CSK_MQTTClient.OnNewStatusActivateConnection
Short description

Notify if connection to MQTT Broker should be activated.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusActivateConnection(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusActivateConnection", "handleOnNewStatusActivateConnection")
CSK_MQTTClient.OnNewStatusBirthMessageActive
Short description

Notify if BirthMessage is used.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusBirthMessageActive(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusBirthMessageActive", "handleOnNewStatusBirthMessageActive")
CSK_MQTTClient.OnNewStatusBirthMessageConfig
Short description

Notify BirthMessage config.

Callback arguments
Name Type Multiplicity Description

config

STRING

1

Config as text

Sample (auto-generated)
function handleOnNewStatusBirthMessageConfig(config)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusBirthMessageConfig", "handleOnNewStatusBirthMessageConfig")
CSK_MQTTClient.OnNewStatusCABundleActive
Short description

Notify status to use CA bundle.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusCABundleActive(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusCABundleActive", "handleOnNewStatusCABundleActive")
CSK_MQTTClient.OnNewStatusCABundlePath
Short description

Notify path to CA bundle.

Callback arguments
Name Type Multiplicity Description

path

STRING

1

Path

Sample (auto-generated)
function handleOnNewStatusCABundlePath(path)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusCABundlePath", "handleOnNewStatusCABundlePath")
CSK_MQTTClient.OnNewStatusCleanSession
Short description

Notify Clean Session flag.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusCleanSession(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusCleanSession", "handleOnNewStatusCleanSession")
CSK_MQTTClient.OnNewStatusClientCertificateActive
Short description

Notify status to use client certificate.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusClientCertificateActive(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusClientCertificateActive", "handleOnNewStatusClientCertificateActive")
CSK_MQTTClient.OnNewstatusClientCertificateKeyPath
Short description

Notify path to client certificate key.

Callback arguments
Name Type Multiplicity Description

path

STRING

1

Path

Sample (auto-generated)
function handleOnNewstatusClientCertificateKeyPath(path)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewstatusClientCertificateKeyPath", "handleOnNewstatusClientCertificateKeyPath")
CSK_MQTTClient.OnNewStatusClientCertificatePath
Short description

Notify path to client certificate.

Callback arguments
Name Type Multiplicity Description

path

STRING

1

Path

Sample (auto-generated)
function handleOnNewStatusClientCertificatePath(path)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusClientCertificatePath", "handleOnNewStatusClientCertificatePath")
CSK_MQTTClient.OnNewStatusClientID
Short description

Notify Client ID to use.

Callback arguments
Name Type Multiplicity Description

id

STRING

1

Client ID

Sample (auto-generated)
function handleOnNewStatusClientID(id)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusClientID", "handleOnNewStatusClientID")
CSK_MQTTClient.OnNewStatusConnectionTimeout
Short description

Notify timeout to wait initially until the client gets connected.

Callback arguments
Name Type Multiplicity Description

time

INT

1

Time [ms]

Sample (auto-generated)
function handleOnNewStatusConnectionTimeout(time)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusConnectionTimeout", "handleOnNewStatusConnectionTimeout")
CSK_MQTTClient.OnNewStatusCSKStyle
Short description

Notify UI style to use for CSK modules.

Callback arguments
Name Type Multiplicity Description

theme

STRING

1

UI style

Sample (auto-generated)
function handleOnNewStatusCSKStyle(theme)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusCSKStyle", "handleOnNewStatusCSKStyle")
CSK_MQTTClient.OnNewStatusCurrentlyConnected
Short description

Notify status of current connection.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusCurrentlyConnected(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusCurrentlyConnected", "handleOnNewStatusCurrentlyConnected")
CSK_MQTTClient.OnNewStatusDisconnectWithWillMessage
Short description

Notify status if WillMessage should be send before disconnecting.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusDisconnectWithWillMessage(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusDisconnectWithWillMessage", "handleOnNewStatusDisconnectWithWillMessage")
CSK_MQTTClient.OnNewStatusFlowConfigPriority
Short description

Notify if FlowConfig should have priority for FlowConfig relevant configurations.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusFlowConfigPriority(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusFlowConfigPriority", "handleOnNewStatusFlowConfigPriority")
CSK_MQTTClient.OnNewStatusForwardReceivedMsg
Short description

Notify if received messages should be forwarded via "OnReceive"-event.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusForwardReceivedMsg(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusForwardReceivedMsg", "handleOnNewStatusForwardReceivedMsg")
CSK_MQTTClient.OnNewStatusHostnameVerification
Short description

Notify status of hostname verification.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusHostnameVerification(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusHostnameVerification", "handleOnNewStatusHostnameVerification")
CSK_MQTTClient.OnNewStatusInterface
Short description

Notify currently configured interface.

Callback arguments
Name Type Multiplicity Description

interface

STRING

1

Interface

Sample (auto-generated)
function handleOnNewStatusInterface(interface)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusInterface", "handleOnNewStatusInterface")
CSK_MQTTClient.OnNewStatusInterfaceList
Short description

Notify available interfaces.

Callback arguments
Name Type Multiplicity Description

interfaceList

STRING

1

List of interfaces

Sample (auto-generated)
function handleOnNewStatusInterfaceList(interfaceList)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusInterfaceList", "handleOnNewStatusInterfaceList")
CSK_MQTTClient.OnNewStatusKeepAliveInterval
Short description

Notify keep alive interval.

Callback arguments
Name Type Multiplicity Description

time

INT

1

Interval time [s]

Sample (auto-generated)
function handleOnNewStatusKeepAliveInterval(time)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusKeepAliveInterval", "handleOnNewStatusKeepAliveInterval")
CSK_MQTTClient.OnNewStatusLoadParameterOnReboot
Short description

Notify status if parameters should be loaded on app/device boot up.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusLoadParameterOnReboot(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusLoadParameterOnReboot", "handleOnNewStatusLoadParameterOnReboot")
CSK_MQTTClient.OnNewStatusLogAllMessages
Short description

Notify if all messages regarding received / send data should be logged in UI.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusLogAllMessages(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusLogAllMessages", "handleOnNewStatusLogAllMessages")
CSK_MQTTClient.OnNewStatusModuleIsActive
Short description

Notify if module can be used on device.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusModuleIsActive(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusModuleIsActive", "handleOnNewStatusModuleIsActive")
CSK_MQTTClient.OnNewStatusModuleVersion
Short description

Notify version of module.

Callback arguments
Name Type Multiplicity Description

version

STRING

1

Version

Sample (auto-generated)
function handleOnNewStatusModuleVersion(version)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusModuleVersion", "handleOnNewStatusModuleVersion")
CSK_MQTTClient.OnNewStatusPeerVerification
Short description

Notify peer verification status.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusPeerVerification(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusPeerVerification", "handleOnNewStatusPeerVerification")
CSK_MQTTClient.OnNewStatusPublishData
Short description

Notify preset data to publish via "publishViaUI".

Callback arguments
Name Type Multiplicity Description

data

STRING

1

Data

Sample (auto-generated)
function handleOnNewStatusPublishData(data)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusPublishData", "handleOnNewStatusPublishData")
CSK_MQTTClient.OnNewStatusPublishEventList
Short description

Notify list of events to publish content via MQTT.

Callback arguments
Name Type Multiplicity Description

list

STRING

1

List

Sample (auto-generated)
function handleOnNewStatusPublishEventList(list)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusPublishEventList", "handleOnNewStatusPublishEventList")
CSK_MQTTClient.OnNewStatusPublishEventName
Short description

Notify preset eventname to publish its content via MQTT.

Callback arguments
Name Type Multiplicity Description

name

STRING

1

Name of event

Sample (auto-generated)
function handleOnNewStatusPublishEventName(name)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusPublishEventName", "handleOnNewStatusPublishEventName")
CSK_MQTTClient.OnNewStatusPublishQOS
Short description

Notify preset QoS of publish via "publishViaUI".

Callback arguments
Name Type Multiplicity Description

qos

STRING

1

QoS

Sample (auto-generated)
function handleOnNewStatusPublishQOS(qos)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusPublishQOS", "handleOnNewStatusPublishQOS")
CSK_MQTTClient.OnNewStatusPublishRetain
Short description

Notify preset retain status of message to publish via "publishViaUI".

Callback arguments
Name Type Multiplicity Description

status

STRING

1

Status

Sample (auto-generated)
function handleOnNewStatusPublishRetain(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusPublishRetain", "handleOnNewStatusPublishRetain")
CSK_MQTTClient.OnNewStatusPublishTopic
Short description

Notify topic to publish via "publishViaUI".

Callback arguments
Name Type Multiplicity Description

topic

STRING

1

Topic

Sample (auto-generated)
function handleOnNewStatusPublishTopic(topic)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusPublishTopic", "handleOnNewStatusPublishTopic")
CSK_MQTTClient.OnNewStatusSubscriptionList
Short description

Notify list of configured subscriptions.

Callback arguments
Name Type Multiplicity Description

list

STRING

1

List

Sample (auto-generated)
function handleOnNewStatusSubscriptionList(list)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusSubscriptionList", "handleOnNewStatusSubscriptionList")
CSK_MQTTClient.OnNewStatusSubscriptionQOS
Short description

Notify QoS of currently selected subscription topic.

Callback arguments
Name Type Multiplicity Description

qos

STRING

1

QoS

Sample (auto-generated)
function handleOnNewStatusSubscriptionQOS(qos)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusSubscriptionQOS", "handleOnNewStatusSubscriptionQOS")
CSK_MQTTClient.OnNewStatusSubscriptionTopic
Short description

Notify currently selected subscription topic.

Callback arguments
Name Type Multiplicity Description

topic

STRING

1

Topic

Sample (auto-generated)
function handleOnNewStatusSubscriptionTopic(topic)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusSubscriptionTopic", "handleOnNewStatusSubscriptionTopic")
CSK_MQTTClient.OnNewStatusTLS
Short description

Notify TLS version to use.

Callback arguments
Name Type Multiplicity Description

version

STRING

1

TLS Version

Sample (auto-generated)
function handleOnNewStatusTLS(version)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusTLS", "handleOnNewStatusTLS")
CSK_MQTTClient.OnNewStatusTopicPrefix
Short description

Notify prefix to use for all topics.

Callback arguments
Name Type Multiplicity Description

prefix

STRING

1

Prefix for all topics.

Sample (auto-generated)
function handleOnNewStatusTopicPrefix(prefix)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusTopicPrefix", "handleOnNewStatusTopicPrefix")
CSK_MQTTClient.OnNewStatusUseCredentials
Short description

Notify if credentials should be used.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusUseCredentials(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusUseCredentials", "handleOnNewStatusUseCredentials")
CSK_MQTTClient.OnNewStatusUsername
Short description

Notify username to use for this MQTTClient instance.

Callback arguments
Name Type Multiplicity Description

username

STRING

1

Username

Sample (auto-generated)
function handleOnNewStatusUsername(username)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusUsername", "handleOnNewStatusUsername")
CSK_MQTTClient.OnNewStatusWillMessageActive
Short description

Notify if WillMessage is used.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusWillMessageActive(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusWillMessageActive", "handleOnNewStatusWillMessageActive")
CSK_MQTTClient.OnNewStatusWillMessageConfig
Short description

Notify WillMessage config.

Callback arguments
Name Type Multiplicity Description

config

STRING

1

Config as text

Sample (auto-generated)
function handleOnNewStatusWillMessageConfig(config)
  -- Do something
end

Script.register("CSK_MQTTClient.OnNewStatusWillMessageConfig", "handleOnNewStatusWillMessageConfig")
CSK_MQTTClient.OnPersistentDataModuleAvailable
Short description

Notify status if features of CSK_PersistentData module are available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnPersistentDataModuleAvailable(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnPersistentDataModuleAvailable", "handleOnPersistentDataModuleAvailable")
CSK_MQTTClient.OnReceive
Short description

Event to forward received MQTT messages.

Callback arguments
Name Type Multiplicity Description

topic

STRING

1

The topic the message was posted to.

data

BINARY

1

The payload data that was received.

qos

ENUM
CSK_MQTTClient.QOS

?

The quality of service level.

retain

ENUM
CSK_MQTTClient.Retain

?

The message retain flag.

Sample (auto-generated)
function handleOnReceive(topic, data, qos, retain)
  -- Do something
end

Script.register("CSK_MQTTClient.OnReceive", "handleOnReceive")
CSK_MQTTClient.OnReceiveFullString
Short description

Notify received MQTT messages as string with all relevant infos seperated by ';'..

Callback arguments
Name Type Multiplicity Description

msg

STRING

1

Topic + Message + QoS + Retain

Sample (auto-generated)
function handleOnReceiveFullString(msg)
  -- Do something
end

Script.register("CSK_MQTTClient.OnReceiveFullString", "handleOnReceiveFullString")
CSK_MQTTClient.OnUserLevelAdminActive
Short description

Status of Admin userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelAdminActive(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnUserLevelAdminActive", "handleOnUserLevelAdminActive")
CSK_MQTTClient.OnUserLevelMaintenanceActive
Short description

Status of Maintenance userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelMaintenanceActive(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnUserLevelMaintenanceActive", "handleOnUserLevelMaintenanceActive")
CSK_MQTTClient.OnUserLevelOperatorActive
Short description

Status of Operator userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelOperatorActive(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnUserLevelOperatorActive", "handleOnUserLevelOperatorActive")
CSK_MQTTClient.OnUserLevelServiceActive
Short description

Status of Service userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelServiceActive(status)
  -- Do something
end

Script.register("CSK_MQTTClient.OnUserLevelServiceActive", "handleOnUserLevelServiceActive")

MQTTClient_FC

Short description

Crown to provide CSK_FlowConfig relevant features.

Overview

MQTTClient_FC.OnReceive

Short description

Provide received MQTT content.

Functions

MQTTClient_FC.OnReceive.create()
Short description

Internally used CSK_FlowConfig create function.

Return values
Name Type Multiplicity Description

handle

HANDLE

1

Handle to internally used FlowConfig instance.

Sample (auto-generated)
handle = MQTTClient_FC.OnReceive.create()
MQTTClient_FC.OnReceive.register()
Short description

Internally used CSK_FlowConfig register function.

Parameters
Name Type Multiplicity Description

handle

HANDLE

1

Handle to internally used FlowConfig instance.

eventname

STRING

1

Internal parameter (not used).

callback

STRING

1

Internally used callback function.

Return values
Name Type Multiplicity Description

success

BOOL

1

Success of register process.

Sample (auto-generated)
success = MQTTClient_FC.OnReceive.register(handle, eventname, callback)

Events

MQTTClient_FC.OnReceive.OnReceive
Short description

Provide received MQTT content.

Callback arguments
Name Type Multiplicity Description

handle

HANDLE

1

Handle to internally used FlowConfig instance.

OnReceive

STRING

1

'CSK_MQTTClient.OnReceiveFullString' Parameter: 1: Topic + Message + QoS + Retain of received message (STRING).

Sample (auto-generated)
function handleOnReceive(handle, OnReceive)
  -- Do something
end

Script.register("MQTTClient_FC.OnReceive.OnReceive", "handleOnReceive")

MQTTClient_FC.Publish

Short description

Set source of incoming data to publish via MQTTClient.

Overview

Functions

MQTTClient_FC.Publish.create()
Short description

Internally used CSK_FlowConfig create function.

Parameters
Name Type Multiplicity Description

Topic

STRING

1

Topic

QoS

ENUM
CSK_MQTTClient.QOS

1

Quality of Service level.

Retain

ENUM
CSK_MQTTClient.Retain

1

Retain

Return values
Name Type Multiplicity Description

handle

HANDLE

1

Handle to internally used FlowConfig instance.

Sample (auto-generated)
handle = MQTTClient_FC.Publish.create(Topic, QoS, Retain)
MQTTClient_FC.Publish.publish()
Short description

Set source of incoming data to publish via MQTTClient.

Parameters
Name Type Multiplicity Description

handle

HANDLE

1

Handle to internally used FlowConfig instance.

data1

STRING

?

Source1 of data to publish. Parameter: 1: Data content (STRING)

data2

STRING

?

Source2 of data to publish. Parameter: 1: Data content (STRING)

data3

STRING

?

Source3 of data to publish. Parameter: 1: Data content (STRING)

data4

STRING

?

Source4 of data to publish. Parameter: 1: Data content (STRING)

Sample (auto-generated)
MQTTClient_FC.Publish.publish(handle, data1, data2, data3, data4)

Enumerations

CSK_MQTTClient.QOS

Quality of MQTT topic service level.

Items
Value Name Description
QOS0

QOS0

Quality of Service level 0.

QOS2

QOS2

Quality of Service level 2.

QOS1

QOS1

Quality of Service level 1.

CSK_MQTTClient.Retain

MQTT message retain type.

Items
Value Name Description
NO_RETAIN

NO_RETAIN

Do not retain message.

RETAIN

RETAIN

Retain message.

CSK_MQTTClient.TLSVersion

Items
Value Name Description
NO_TLS

NO_TLS

Deactivate TLS.

TLS_V10

TLS_V10

TLS protocol version 1.0

TLS_V11

TLS_V11

TLS protocol version 1.1

TLS_V12

TLS_V12

TLS protocol version 1.2