Class IPConfig
- All Implemented Interfaces:
Runnable
IPConfig is a Runnable tool implementation for reading and writing the IP configuration
in the KNXnet/IP Parameter Object. It supports network access using a KNXnet/IP, KNX IP, USB,
FT1.2, or TP-UART connection. IPConfig shows the necessary interaction with the core library API
for this particular task.
To run IPConfig, invoke main(String[]), or create a new instance using
IPConfig(String[]) and invoke run() on that instance.
All configuration output, as well as occurring problems are written to either
System.out (console mode), or the log writer supplied by the user. See the tool
options for a list of communication settings.
The main part of this tool interacts with the Calimero 2 PropertyClient interface, which
offers high level access to KNX property information. It shows creation of the
PropertyAdapter, necessary for a property client to work.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidEntry point for running IPConfig.protected voidonCompletion(Exception thrown, boolean canceled) Called by this tool on completion.protected voidonConfigurationReceived(List<String[]> config) Supplies information about a received IP configuration.voidrun()
-
Constructor Details
-
IPConfig
Creates a new IPConfig instance using the supplied options.See
main(String[])for a list of options.- Parameters:
args- list with options
-
-
Method Details
-
main
Entry point for running IPConfig.An IP host or port identifier has to be supplied to specify the endpoint for the KNX network access.
To show the usage message of this tool on the console, supply the command line option --help (or -h).
Command line options are treated case sensitive. Available options:--help -hshow help message--versionshow tool/library version and exit--local -llocal device management (default)--remote -rKNX addr remote property service--localhostid local IP/host name--localportnumber local UDP port (default system assigned)--port -pnumber UDP port on host (default 3671)--nat -nenable Network Address Translation--ft12 -fuse FT1.2 serial communication--usb -uuse KNX USB communication--tpuartuse TP-UART communication
--medium -mid KNX medium [tp1|p110|knxip|rf] (defaults to tp1)--domainaddress domain address on open KNX medium (PL or RF)--knx-address -kKNX address KNX device address of local endpoint--connect -cconnection oriented mode--authorize -akey authorize key to access KNX device
In any case, the tool reads out the IP configuration of the connected endpoint and writes it to standard output.
Supply one or more of the following commands to change the IP configuration:ipaddress set the configured fixed IP addresssubnetaddress set the configured IP subnet maskgatewayaddress set the configured IP address of the default gatewaymulticastaddress set the routing multicast addressmanualset manual IP assignment for the current IP address to enabledbootpset Bootstrap Protocol IP assignment for the current IP address to enableddhcpset DHCP IP assignment for the current IP address to enabledautoset automatic IP assignment for the current IP address to enabled
--knx-addressoption is only necessary if an access protocol is selected that directly communicates with the KNX network, i.e., KNX IP or TP-UART. The selected KNX individual address shall be unique in a network, and the subnetwork address (area and line) should be set to match the network configuration.- Parameters:
args- command line options to run the tool
-
run
public void run() -
onConfigurationReceived
Supplies information about a received IP configuration.This default implementation writes information to standard output.
- Parameters:
config- a list with configuration entries, an entry is of type String[3], with [0] being the property identifier (PID), [1] being a short descriptive name of the configuration property, [2] being the value
-
onCompletion
Called by this tool on completion.- Parameters:
thrown- the thrown exception if operation completed due to an raised exception,nullotherwisecanceled- whether the operation got canceled before its planned end
-