Class ScanDevices

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

public class ScanDevices extends Object implements Runnable
A tool to list existing (and responsive) KNX devices on a KNX network, or checking whether a specific KNX individual address is currently assigned to a KNX device.

ScanDevices is a Runnable tool implementation allowing a user to scan for KNX devices in a KNX network. It provides a list of existing KNX devices in the scanned area or area.line of the network.
Alternatively, ScanDevices allows to check whether a specific KNX individual address is currently assigned to a device, i.e, occupied in the KNX network.
This tool shows the necessary interaction with the Calimero 2 API for management procedures. The main part of this tool implementation interacts with the type ManagementProcedures in the library.
When running this tool from the terminal, the main- method of this class is invoked, otherwise execute it like a Runnable.

To cancel a running scanning procedure from the terminal, use a user interrupt for termination, for example, ^C.
When executed in a terminal, the device list, as well as errors and problems during the scan are written to System.out.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new ScanDevices.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String... args)
    Entry point for running ScanDevices.
    protected void
    onCompletion(Exception thrown, boolean canceled)
    Called by this tool on completion.
    protected void
    onDeviceFound(tuwien.auto.calimero.IndividualAddress device)
    Called on receiving a device response during the scan.
    protected void
    onDeviceFound(tuwien.auto.calimero.IndividualAddress device, tuwien.auto.calimero.DeviceDescriptor.DD0 dd0)
     
    void
    run()
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ScanDevices

      public ScanDevices(String[] args)
      Constructs a new ScanDevices.

      Parameters:
      args - tool arguments
  • Method Details

    • main

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

      Syntax: ScanDevices [options] <host|port> <area[.line[.device]]>

      The area and line are expected as numbers in the range [0..0x0F]; the (optional) device address part is in the range [0..0x0FF]. Accepted are decimal, hexadecimal (0x), or octal (0) representations.
      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 port  local UDP port (default system assigned)
      • --port -p port  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, defaults to broadcast domain)
      • --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
    • onDeviceFound

      protected void onDeviceFound(tuwien.auto.calimero.IndividualAddress device)
      Called on receiving a device response during the scan.
      Parameters:
      device - device address of the responding device
    • onDeviceFound

      protected void onDeviceFound(tuwien.auto.calimero.IndividualAddress device, tuwien.auto.calimero.DeviceDescriptor.DD0 dd0)
    • 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