Document metadata

Application name

CSK_Module_DeviceNetworkConfig

Version

2.2.1

Date

2024-12-05

Author

SICK AG

Crowns

CSK_DeviceNetworkConfig

Short description

This module provides the possibility to setup the ethernet interfaces of the device.
See following descriptions of events/functions regarding further information.

Functions

CSK_DeviceNetworkConfig.addDNS()
Short description

Add a new nameserver IP.

Sample (auto-generated)
CSK_DeviceNetworkConfig.addDNS()
CSK_DeviceNetworkConfig.applyConfig()
Short description

Apply preset network configuration to device when button in UI is pressed.

Sample (auto-generated)
CSK_DeviceNetworkConfig.applyConfig()
CSK_DeviceNetworkConfig.applyEthernetConfig()
Short description

Applies new configuration of Ethernet interface.

Parameters
Name Type Multiplicity Description

interfaceName

STRING

1

Name of Ethernet interface to upload new configuration to, e.g. ETH1, ETH2 etc.

dhcpEnabled

BOOL

1

New DHCP state. If true, then IP, subnet mask and gateway must be nil.

ipAddress

STRING

1

New IP addres. Must be nil if DHCP is on.

subnetMask

STRING

1

New subnet mask. Must be nil if DHCP is on.

gateway

STRING

1

New default gateway. Must be nil if DHCP is on.

Sample (auto-generated)
CSK_DeviceNetworkConfig.applyEthernetConfig(interfaceName, dhcpEnabled, ipAddress, subnetMask, gateway)
CSK_DeviceNetworkConfig.getNetworkDescription()
Short description

Get current network description of device in JSON format.

Return values
Name Type Multiplicity Description

jsonInterfacesTable

STRING

?

Network description as JSON.

Sample (auto-generated)
jsonInterfacesTable = CSK_DeviceNetworkConfig.getNetworkDescription()
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.getParameters()
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.getStatusModuleActive()
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.loadParameters()
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.pageCalled()
CSK_DeviceNetworkConfig.ping()
Short description

Try to ping preset IP (see 'setPingIpAddress').

Sample (auto-generated)
CSK_DeviceNetworkConfig.ping()
CSK_DeviceNetworkConfig.refresh()
Short description

Get current configuration of Ethernet ports.

Sample (auto-generated)
CSK_DeviceNetworkConfig.refresh()
CSK_DeviceNetworkConfig.removeDNS()
Short description

Remove the selected nameserver IP.

Sample (auto-generated)
CSK_DeviceNetworkConfig.removeDNS()
CSK_DeviceNetworkConfig.selectDNSViaUI()
Short description

Select nameserver entry via table in UI.

Parameters
Name Type Multiplicity Description

selectedRow

STRING

1

The string with chosen row’s content in JSON format.

Sample (auto-generated)
CSK_DeviceNetworkConfig.selectDNSViaUI(selectedRow)
CSK_DeviceNetworkConfig.selectInterface()
Short description

Select ethernet interface via table in UI.

Parameters
Name Type Multiplicity Description

row_selected

STRING

1

The string with chosen row’s content in JSON format.

Sample (auto-generated)
CSK_DeviceNetworkConfig.selectInterface(row_selected)
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.sendParameters(noDataSave)
CSK_DeviceNetworkConfig.setDefaultGateway()
Short description

Preset default gateway to be configured via 'applyConfig'.

Parameters
Name Type Multiplicity Description

newDefaultGateway

STRING

1

Gateway

Sample (auto-generated)
CSK_DeviceNetworkConfig.setDefaultGateway(newDefaultGateway)
CSK_DeviceNetworkConfig.setDHCPState()
Short description

Preset DHCP status to be configured via 'applyConfig'.

Parameters
Name Type Multiplicity Description

newDHCPstate

BOOL

1

DHCP state (true to enable DHCP).

Sample (auto-generated)
CSK_DeviceNetworkConfig.setDHCPState(newDHCPstate)
CSK_DeviceNetworkConfig.setDNS()
Short description

Set IP address of the nameserver.

Parameters
Name Type Multiplicity Description

dns

STRING

1

Nameserver IP

Sample (auto-generated)
CSK_DeviceNetworkConfig.setDNS(dns)
CSK_DeviceNetworkConfig.setInterfaceIP()
Short description

Preset IP to be configured via 'applyConfig'.

Parameters
Name Type Multiplicity Description

newIP

STRING

1

IP

Sample (auto-generated)
CSK_DeviceNetworkConfig.setInterfaceIP(newIP)
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.setLoadOnReboot(status)
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.setParameterName(name)
CSK_DeviceNetworkConfig.setPingIPAddress()
Short description

Preset IP to ping (see 'ping' function).

Parameters
Name Type Multiplicity Description

ping_ip

STRING

1

IP

Sample (auto-generated)
CSK_DeviceNetworkConfig.setPingIPAddress(ping_ip)
CSK_DeviceNetworkConfig.setSubnetMask()
Short description

Preset subnet mask to be configured via 'applyConfig'.

Parameters
Name Type Multiplicity Description

newSubnetMask

STRING

1

Subnet mask

Sample (auto-generated)
CSK_DeviceNetworkConfig.setSubnetMask(newSubnetMask)

Events

CSK_DeviceNetworkConfig.OnApplyButtonDisabled
Short description

Notified to disable / enable 'Apply new config' button in UI.

Callback arguments
Name Type Multiplicity Description

isDisabled

BOOL

1

Status

Sample (auto-generated)
function handleOnApplyButtonDisabled(isDisabled)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnApplyButtonDisabled", "handleOnApplyButtonDisabled")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnDataLoadedOnReboot", "handleOnDataLoadedOnReboot")
CSK_DeviceNetworkConfig.OnDHCPDisabled
Short description

Notified to disable / enable 'DHCP' checkbox in UI.

Callback arguments
Name Type Multiplicity Description

isDisabled

BOOL

1

Status

Sample (auto-generated)
function handleOnDHCPDisabled(isDisabled)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnDHCPDisabled", "handleOnDHCPDisabled")
CSK_DeviceNetworkConfig.OnDNSIPError
Short description

Highlights the DNS 'IP' in UI if format of IP is not correct.

Callback arguments
Name Type Multiplicity Description

isError

BOOL

1

Status

Sample (auto-generated)
function handleOnDNSIPError(isError)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnDNSIPError", "handleOnDNSIPError")
CSK_DeviceNetworkConfig.OnGatewayDisabled
Short description

Notified to disable / enable 'Gateway' text field in UI.

Callback arguments
Name Type Multiplicity Description

isDisabled

BOOL

1

Status

Sample (auto-generated)
function handleOnGatewayDisabled(isDisabled)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnGatewayDisabled", "handleOnGatewayDisabled")
CSK_DeviceNetworkConfig.OnGatewayError
Short description

Highlights the 'Gateway field' in UI if format of gateway is not correct.

Callback arguments
Name Type Multiplicity Description

isError

BOOL

1

Status

Sample (auto-generated)
function handleOnGatewayError(isError)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnGatewayError", "handleOnGatewayError")
CSK_DeviceNetworkConfig.OnIPDisabled
Short description

Notified to disable / enable 'IP' text field in UI.

Callback arguments
Name Type Multiplicity Description

isDisabled

BOOL

1

Status

Sample (auto-generated)
function handleOnIPDisabled(isDisabled)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnIPDisabled", "handleOnIPDisabled")
CSK_DeviceNetworkConfig.OnIPError
Short description

Highlights the 'IP' in UI if format of IP is not correct.

Callback arguments
Name Type Multiplicity Description

isError

BOOL

1

Status

Sample (auto-generated)
function handleOnIPError(isError)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnIPError", "handleOnIPError")
CSK_DeviceNetworkConfig.OnNewDefaultGateway
Short description

Notify current 'Default Gateway'

Callback arguments
Name Type Multiplicity Description

DefaultGateway

STRING

1

Default Gateway.

Sample (auto-generated)
function handleOnNewDefaultGateway(DefaultGateway)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnNewDefaultGateway", "handleOnNewDefaultGateway")
CSK_DeviceNetworkConfig.OnNewDHCPStatus
Short description

Notify current DHCP status.

Callback arguments
Name Type Multiplicity Description

DHCPStatus

BOOL

1

Status

Sample (auto-generated)
function handleOnNewDHCPStatus(DHCPStatus)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnNewDHCPStatus", "handleOnNewDHCPStatus")
CSK_DeviceNetworkConfig.OnNewDNS
Short description

Notify a new nameserver.

Callback arguments
Name Type Multiplicity Description

dnsServerList

STRING

1

Name server list

Sample (auto-generated)
function handleOnNewDNS(dnsServerList)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnNewDNS", "handleOnNewDNS")
CSK_DeviceNetworkConfig.OnNewEthernetConfigStatus
Short description

Notify current configuration process status.

Callback arguments
Name Type Multiplicity Description

newEthernetConfigStatus

STRING

1

Status

Sample (auto-generated)
function handleOnNewEthernetConfigStatus(newEthernetConfigStatus)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnNewEthernetConfigStatus", "handleOnNewEthernetConfigStatus")
CSK_DeviceNetworkConfig.OnNewInterfaceChoice
Short description

Notify currently selected interface.

Callback arguments
Name Type Multiplicity Description

NewInterface

STRING

1

The selected interface.

Sample (auto-generated)
function handleOnNewInterfaceChoice(NewInterface)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnNewInterfaceChoice", "handleOnNewInterfaceChoice")
CSK_DeviceNetworkConfig.OnNewInterfaceTable
Short description

Notify interface table as JSON (e.g. for table in UI).

Callback arguments
Name Type Multiplicity Description

InterfaceTable

STRING

1

Table of interfaces as a JSON string.

Sample (auto-generated)
function handleOnNewInterfaceTable(InterfaceTable)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnNewInterfaceTable", "handleOnNewInterfaceTable")
CSK_DeviceNetworkConfig.OnNewIP
Short description

Notify current IP.

Callback arguments
Name Type Multiplicity Description

ip

STRING

1

IP

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

Script.register("CSK_DeviceNetworkConfig.OnNewIP", "handleOnNewIP")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnNewParameterName", "handleOnNewParameterName")
CSK_DeviceNetworkConfig.OnNewPingDetails
Short description

Notify details of executed ping command.

Callback arguments
Name Type Multiplicity Description

details

STRING

1

Ping details.

Sample (auto-generated)
function handleOnNewPingDetails(details)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnNewPingDetails", "handleOnNewPingDetails")
CSK_DeviceNetworkConfig.OnNewPingResult
Short description

Notify result of executed ping command.

Callback arguments
Name Type Multiplicity Description

result

BOOL

1

Result

Sample (auto-generated)
function handleOnNewPingResult(result)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnNewPingResult", "handleOnNewPingResult")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnNewStatusCSKStyle", "handleOnNewStatusCSKStyle")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnNewStatusLoadParameterOnReboot", "handleOnNewStatusLoadParameterOnReboot")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnNewStatusModuleIsActive", "handleOnNewStatusModuleIsActive")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnNewStatusModuleVersion", "handleOnNewStatusModuleVersion")
CSK_DeviceNetworkConfig.OnNewSubnetMask
Short description

Notify current subnet mask.

Callback arguments
Name Type Multiplicity Description

SubnetMask

STRING

1

Subnet mask.

Sample (auto-generated)
function handleOnNewSubnetMask(SubnetMask)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnNewSubnetMask", "handleOnNewSubnetMask")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnPersistentDataModuleAvailable", "handleOnPersistentDataModuleAvailable")
CSK_DeviceNetworkConfig.OnSubnetDisabled
Short description

Notified to disable / enable 'Subnet mask' text field in UI.

Callback arguments
Name Type Multiplicity Description

isDisabled

BOOL

1

Status

Sample (auto-generated)
function handleOnSubnetDisabled(isDisabled)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnSubnetDisabled", "handleOnSubnetDisabled")
CSK_DeviceNetworkConfig.OnSubnetError
Short description

Highlights the 'Subnet' field in UI if format is not correct.

Callback arguments
Name Type Multiplicity Description

isError

BOOL

1

Status

Sample (auto-generated)
function handleOnSubnetError(isError)
  -- Do something
end

Script.register("CSK_DeviceNetworkConfig.OnSubnetError", "handleOnSubnetError")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnUserLevelAdminActive", "handleOnUserLevelAdminActive")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnUserLevelMaintenanceActive", "handleOnUserLevelMaintenanceActive")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnUserLevelOperatorActive", "handleOnUserLevelOperatorActive")
CSK_DeviceNetworkConfig.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_DeviceNetworkConfig.OnUserLevelServiceActive", "handleOnUserLevelServiceActive")

CSK_Module_DeviceNetworkConfig

Short description

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

Overview