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.
Overview
Functions
addDNS()
Short description
Add a new nameserver IP.
Sample (auto-generated)
CSK_DeviceNetworkConfig.addDNS()
applyConfig()
Short description
Apply preset network configuration to device when button in UI is pressed.
Sample (auto-generated)
CSK_DeviceNetworkConfig.applyConfig()
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)
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()
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()
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()
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()
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()
ping()
Short description
Try to ping preset IP (see 'setPingIpAddress').
Sample (auto-generated)
CSK_DeviceNetworkConfig.ping()
refresh()
Short description
Get current configuration of Ethernet ports.
Sample (auto-generated)
CSK_DeviceNetworkConfig.refresh()
removeDNS()
Short description
Remove the selected nameserver IP.
Sample (auto-generated)
CSK_DeviceNetworkConfig.removeDNS()
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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).