Document metadata
+Application name |
+CSK_Module_DeviceNetworkConfig |
+
---|---|
Version |
+2.0.0 |
+
Date |
+2023-06-14 |
+
Author |
+SICK AG |
+
Crowns
+-
+
- C +
-
++ ++
+
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
+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()
+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()
+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)
+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)
+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)
+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")
+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")
+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")
+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")
+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")
+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")
+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).
+