Document metadata
Application name |
CSK_Module_MQTTClient |
---|---|
Version |
2.1.1 |
Date |
2025-04-11 |
Author |
SICK AG |
Crowns
- C
- M
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
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 |
1 |
QoS of publish message. |
retain |
1 |
Retain option of the publish. |
Sample (auto-generated)
CSK_MQTTClient.addPublishEvent(event, topic, qos, retain)
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()
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 |
1 |
Quality of service level. Default is QOS0. |
Sample (auto-generated)
CSK_MQTTClient.addSubscription(topicFilter, qos)
addSubscriptionViaUI()
Short description
Function to subscribe to preset topic with QoS.
Sample (auto-generated)
CSK_MQTTClient.addSubscriptionViaUI()
clearFlowConfigRelevantConfiguration()
Short description
Function to clear FlowConfig relevant configurations.
Sample (auto-generated)
CSK_MQTTClient.clearFlowConfigRelevantConfiguration()
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)
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 |
1 |
Handle of the MQTT Client. |
Sample (auto-generated)
handle = CSK_MQTTClient.getMQTTHandle()
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()
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()
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()
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()
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)
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)
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 |
1 |
QoS |
Sample (auto-generated)
CSK_MQTTClient.presetPublishQOS(qos)
presetPublishRetain()
Short description
Function to preset the retain flag of the data to publish (see "addPublishEventViaUI" or "publishViaUI").
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
1 |
Status |
Sample (auto-generated)
CSK_MQTTClient.presetPublishRetain(status)
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)
presetSubscriptionQOS()
Short description
Function to preset QoS of topic to subscribe (see "addSubscriptionViaUI").
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
qos |
ENUM |
1 |
QoS |
Sample (auto-generated)
CSK_MQTTClient.presetSubscriptionQOS(qos)
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)
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 |
? |
The quality of service level. Default is QOS0. |
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)
publishViaUI()
Short description
Function to publish data with preset configuration (see "preset" functions).
Sample (auto-generated)
CSK_MQTTClient.publishViaUI()
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)
removePublishEventViaUI()
Short description
Function to remove preselected event via UI (see "selectPublishEvent").
Sample (auto-generated)
CSK_MQTTClient.removePublishEventViaUI()
resetModule()
Short description
Function to reset main configuration of module.
Sample (auto-generated)
CSK_MQTTClient.resetModule()
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)
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)
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)
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)
setBirthMessageConfigViaUI()
Short description
Function to set config of BirthMessage via UI with preset configuration (check "presetPublish…"-functions).
Sample (auto-generated)
CSK_MQTTClient.setBirthMessageConfigViaUI()
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
setHostnameVerification()
Short description
Function to set hostname verification.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
CSK_MQTTClient.setHostnameVerification(status)
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)
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)
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)
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)
setMQTTPort()
Short description
Function to set MQTT port.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
port |
INT |
1 |
Port |
Sample (auto-generated)
CSK_MQTTClient.setMQTTPort(port)
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)
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)
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)
setTLSVersion()
Short description
Function to select if and what TLS version to use.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
version |
1 |
TLS version |
Sample (auto-generated)
CSK_MQTTClient.setTLSVersion(version)
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)
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)
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)
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)
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)
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)
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 |
1 |
Quality of Service level. Default is QOS0. |
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)
setWillMessageConfigViaUI()
Short description
Function to set config of WillMessage via UI with preset configuration (check "presetPublish…"-functions).
Sample (auto-generated)
CSK_MQTTClient.setWillMessageConfigViaUI()
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)
unsubscribeViaUI()
Short description
Function to unsubscribe from preselected topic via UI (see "selectSubscriptionViaUI").
Sample (auto-generated)
CSK_MQTTClient.unsubscribeViaUI()
Events
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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 |
? |
The quality of service level. |
retain |
? |
The message retain flag. |
Sample (auto-generated)
function handleOnReceive(topic, data, qos, retain)
-- Do something
end
Script.register("CSK_MQTTClient.OnReceive", "handleOnReceive")
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")
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")
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")
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")
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.
Overview
Functions
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()
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
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.
Functions
create()
Short description
Internally used CSK_FlowConfig create function.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
Topic |
STRING |
1 |
Topic |
QoS |
ENUM |
1 |
Quality of Service level. |
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)
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.
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.
Value | Name | Description |
---|---|---|
NO_RETAIN |
NO_RETAIN |
Do not retain message. |
RETAIN |
RETAIN |
Retain message. |
CSK_MQTTClient.TLSVersion
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 |