Class TrafficMonitor

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

public class TrafficMonitor extends Object implements Runnable
A tool for showing KNX network traffic & link status information.

Traffic monitor is a Runnable tool implementation allowing to monitor network traffic in a KNX network. It supports KNX network access using a KNXnet/IP, KNX IP, USB, FT1.2, or TP-UART connection.

When running this tool from the terminal, method main of this class is invoked; otherwise, use this class in the context appropriate to a Runnable. In console mode, KNX network traffic data as well as status information are written to System.out.

Note that communication will use default settings if not specified otherwise using command line options. Since these settings might be system dependent (for example, the local host) and not always predictable, a user may want to specify particular settings using the available options.

  • Constructor Details

    • TrafficMonitor

      public TrafficMonitor(String[] args)
      Creates a new instance using the supplied 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 the traffic monitor. The endpoint for KNX network access is either an IP host or port identifier for IP, USB, FT1.2 or TP-UART communication. Use the command line option --help (or -h) to show the usage of this tool.

      Command line options are treated case sensitive. Available options for communication:

      • --help -h show help message
      • --version show tool/library version and exit
      • --compact -c show incoming process communication data in compact format
      • --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)

      For common datapoint types (DPTs) the following name aliases can be used instead of the general DPT number string:

      • switch for DPT 1.001, with values off, on
      • bool for DPT 1.002, with values false, true
      • dimmer for DPT 3.007, with values decrease 0..7, increase 0..7
      • blinds for DPT 3.008, with values up 0..7, down 0..7
      • percent for DPT 5.001, with values 0..100
      • % for DPT 5.001, with values 0..100
      • angle for DPT 5.003, with values 0..360
      • ucount for DPT 5.010, with values 0..255
      • temp for DPT 9.001, with values -273..+670760
      • float or float2 for DPT 9.002
      • float4 for DPT 14.005
      • int for DPT 13.001
      • string for DPT 16.001
      Parameters:
      args - command line options for traffic monitoring
    • run

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

      public void quit()
      Quits traffic monitoring and closes the network link.
    • 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