Class DeviceInfo

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

public class DeviceInfo extends Object implements Runnable
A tool for Calimero showing device information of a device in a KNX network.

DeviceInfo is a Runnable tool implementation allowing a user to read information about a KNX device.

This tool supports KNX network access using a KNXnet/IP, KNX IP, USB, FT1.2, or TP-UART connection. It uses the ManagementClient functionality of the library to read KNX device description, properties, and memory locations. It collects and shows device information similar to the ETS.

When running this tool from the console, the main- method of this class is invoked, otherwise use this class in the context appropriate to a Runnable.
In console mode, the KNX device information, as well as errors and problems during its execution are written to System.out.

  • Constructor Details

    • DeviceInfo

      public DeviceInfo(String[] args)
      Creates a new DeviceInfo instance using the supplied options.

      Mandatory arguments are the connection options depending on the type of connection to the KNX network, and the KNX device individual address ("area.line.device"). See main(String[]) for the list of options.

      Parameters:
      args - list with options
      Throws:
      tuwien.auto.calimero.KNXIllegalArgumentException - on unknown/invalid options
  • Method Details

    • main

      public static void main(String... args)
      Entry point for running DeviceInfo.

      Syntax: DeviceInfo [options] <host|port> [<KNX device address>]

      Running the tool without a KNX device address will read the device info of the local KNX interface (KNXnet/IP and USB only).
      To show usage message of the tool on the console, supply the command line option --help (or -h). Command line options are treated case-sensitive. Available options for connecting to the KNX device in question:

      • no arguments: only show short description and version info
      • --help -h show help message
      • --version show tool/library version and exit
      • --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
      • --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
      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 for running the device info tool
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • onDeviceInformation

      protected void onDeviceInformation(DeviceInfo.Parameter parameter, String value, byte[] raw)
      Invoked after successfully reading a KNX device parameter. If a device parameter is not available or accessible in the KNX device, this method won't be called.
      Parameters:
      parameter - the parameter read from the device
      value - formatted value of that parameter
      raw - raw value of that parameter
    • onDeviceInformation

      protected void onDeviceInformation(DeviceInfo.Item item)
      Invoked on each successfully read device parameter of a KNX device.
      Parameters:
      item - device parameter and 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 a raised exception, null otherwise
      canceled - whether the operation got canceled before its planned end