Class IPConfig

java.lang.Object
tuwien.auto.calimero.tools.IPConfig
All Implemented Interfaces:
Runnable

public class IPConfig extends Object implements Runnable
A tool for Calimero to read/set the IP configuration of a KNXnet/IP server using KNX properties.

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 Details

    • IPConfig

      protected IPConfig(String[] args)
      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

      public static void main(String... args)
      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 -h show help message
      • --version show tool/library version and exit
      • --local -l local device management (default)
      • --remote -r KNX addr  remote property service
      • --localhost id  local IP/host name
      • --localport number  local UDP port (default system assigned)
      • --port -p number  UDP port on host (default 3671)
      • --nat -n enable Network Address Translation
      • --ft12 -f use FT1.2 serial communication
      • --usb -u use KNX USB communication
      • --tpuart use TP-UART communication
      For remote property service these options are available:
      • --medium -m id  KNX medium [tp1|p110|knxip|rf] (defaults to tp1)
      • --domain address  domain address on open KNX medium (PL or RF)
      • --knx-address -k KNX address  KNX device address of local endpoint
      • --connect -c connection oriented mode
      • --authorize -a key  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:
      • ip address  set the configured fixed IP address
      • subnet address  set the configured IP subnet mask
      • gateway address  set the configured IP address of the default gateway
      • multicast address  set the routing multicast address
      • manual set manual IP assignment for the current IP address to enabled
      • bootp set Bootstrap Protocol IP assignment for the current IP address to enabled
      • dhcp set DHCP IP assignment for the current IP address to enabled
      • auto set automatic IP assignment for the current IP address to enabled
      The --knx-address option 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()
      Specified by:
      run in interface Runnable
    • onConfigurationReceived

      protected void onConfigurationReceived(List<String[]> config)
      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

      protected void onCompletion(Exception thrown, boolean canceled)
      Called by this tool on completion.
      Parameters:
      thrown - the thrown exception if operation completed due to an raised exception, null otherwise
      canceled - whether the operation got canceled before its planned end