Document metadata

Application name

CSK_Template_LiveConnectDemo

Version

1.0.0

Date

2024-01-05

Author

SICK AG

Crowns

CSK_LiveConnectDemo

Short description

CSK Template to show how CSK modules can be used to establish a LiveConnect connection e.g. to push sensor data to the SICK AssetHub.
Please have a look into the online documentation (https://github.com/SICKAppSpaceCodingStarterKit/CSK_Template_LiveConnectDemo).

This template provides an UI with a step by step setup to configure the LiveConnect connection.
As soon as a connection is established you can make use of the 'addHTTPProfile' / 'addMQTTProfile' functions to add profiles.

Functions

CSK_LiveConnectDemo.addHTTPProfileViaUI()
Short description

Function to add a HTTP profile with predefined part-/serialNumber (see 'setPartNumber' / 'setSerialNumber').

Sample (auto-generated)
CSK_LiveConnectDemo.addHTTPProfileViaUI()
CSK_LiveConnectDemo.addMQTTProfileViaUI()
Short description

Function to add a MQTT profile with predefined part-/serialNumber (see 'setPartNumber' / 'setSerialNumber').

Sample (auto-generated)
CSK_LiveConnectDemo.addMQTTProfileViaUI()
CSK_LiveConnectDemo.addNewHTTPProfile()
Short description

Function to add HTTP profile.

Parameters
Name Type Multiplicity Description

partNumber

STRING

1

Part number.

serialNumber

STRING

1

Serial number.

Sample (auto-generated)
CSK_LiveConnectDemo.addNewHTTPProfile(partNumber, serialNumber)
CSK_LiveConnectDemo.addNewMQTTProfile()
Short description

Function to add MQTT profile.

Parameters
Name Type Multiplicity Description

partNumber

STRING

1

Part number.

serialNumber

STRING

1

Serial number.

Sample (auto-generated)
CSK_LiveConnectDemo.addNewMQTTProfile(partNumber, serialNumber)
CSK_LiveConnectDemo.loadParameters()
Short description

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

Sample (auto-generated)
CSK_LiveConnectDemo.loadParameters()
CSK_LiveConnectDemo.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_LiveConnectDemo.pageCalled()
CSK_LiveConnectDemo.sendParameters()
Short description

Send parameters to CSK_PersistentData module if possible to save them.

Sample (auto-generated)
CSK_LiveConnectDemo.sendParameters()
CSK_LiveConnectDemo.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

Status

Sample (auto-generated)
CSK_LiveConnectDemo.setLoadOnReboot(status)
CSK_LiveConnectDemo.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_LiveConnectDemo.setParameterName(name)
CSK_LiveConnectDemo.setPartNumber()
Short description

Function to preset part number of profile to add.

Parameters
Name Type Multiplicity Description

partNumber

STRING

1

Part number.

Sample (auto-generated)
CSK_LiveConnectDemo.setPartNumber(partNumber)
CSK_LiveConnectDemo.setSerialNumber()
Short description

Function to preset serial number of profile to add.

Parameters
Name Type Multiplicity Description

serialNumber

STRING

1

Serial number.

Sample (auto-generated)
CSK_LiveConnectDemo.setSerialNumber(serialNumber)

Events

CSK_LiveConnectDemo.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_LiveConnectDemo.OnDataLoadedOnReboot", "handleOnDataLoadedOnReboot")
CSK_LiveConnectDemo.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_LiveConnectDemo.OnNewParameterName", "handleOnNewParameterName")
CSK_LiveConnectDemo.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_LiveConnectDemo.OnNewStatusLoadParameterOnReboot", "handleOnNewStatusLoadParameterOnReboot")
CSK_LiveConnectDemo.OnNewStatusPartNumber
Short description

Notify part number of profile to add.

Callback arguments
Name Type Multiplicity Description

partNumber

STRING

1

Part number.

Sample (auto-generated)
function handleOnNewStatusPartNumber(partNumber)
  -- Do something
end

Script.register("CSK_LiveConnectDemo.OnNewStatusPartNumber", "handleOnNewStatusPartNumber")
CSK_LiveConnectDemo.OnNewStatusSerialNumber
Short description

Notify serial number of profile to add.

Callback arguments
Name Type Multiplicity Description

serialNumber

STRING

1

Serial number.

Sample (auto-generated)
function handleOnNewStatusSerialNumber(serialNumber)
  -- Do something
end

Script.register("CSK_LiveConnectDemo.OnNewStatusSerialNumber", "handleOnNewStatusSerialNumber")
CSK_LiveConnectDemo.OnPersistentDataModuleAvailable
Short description

Notify status if features of CSK_PersistendData 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_LiveConnectDemo.OnPersistentDataModuleAvailable", "handleOnPersistentDataModuleAvailable")
CSK_LiveConnectDemo.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_LiveConnectDemo.OnUserLevelAdminActive", "handleOnUserLevelAdminActive")
CSK_LiveConnectDemo.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_LiveConnectDemo.OnUserLevelMaintenanceActive", "handleOnUserLevelMaintenanceActive")
CSK_LiveConnectDemo.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_LiveConnectDemo.OnUserLevelOperatorActive", "handleOnUserLevelOperatorActive")
CSK_LiveConnectDemo.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_LiveConnectDemo.OnUserLevelServiceActive", "handleOnUserLevelServiceActive")

CSK_Template_LiveConnectDemo

Short description

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