Class Property

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

public class Property extends Object implements Runnable
A tool for Calimero showing features of the PropertyClient used for KNX property access.

Property is a Runnable tool implementation to set or get a KNX property from an Interface Object Server (IOS), get its KNX property description, or scan the KNX descriptions available. It supports network access using a KNXnet/IP, KNX IP, USB, FT1.2, or TP-UART connection.
The tool implementation mainly interacts with PropertyClient, which offers high-level access to KNX property information. It also shows creation of the PropertyAdapter, necessary for a property client to work. All queried property values, as well as occurring problems are written to System.out.

When starting this tool from the console, the main-method of this class is invoked, otherwise use it in the context appropriate to Runnable. Take a look at the command line options to configure the tool with the appropriate communication settings.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Map<String,Object>
    Contains tool options after parsing command line.
    protected tuwien.auto.calimero.mgmt.PropertyClient
    The used property client.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Property(String[] args)
    Constructs a new Property object.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected tuwien.auto.calimero.link.KNXNetworkLink
     
    static void
    main(String... args)
    Entry point for running the Property tool from the console.
    protected void
    onCompletion(Exception thrown, boolean canceled)
    Called by this tool on completion.
    protected void
    onDescription(tuwien.auto.calimero.mgmt.Description d)
    Invoked on receiving a property description.
    protected void
    onPropertyValue(int idx, int pid, String value, List<byte[]> raw)
    Invoked on receiving a property value.
    void
    run()
     
    protected void
    Runs a single command.

    Methods inherited from class java.lang.Object

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

    • options

      protected final Map<String,Object> options
      Contains tool options after parsing command line.
    • pc

      protected tuwien.auto.calimero.mgmt.PropertyClient pc
      The used property client.
  • Constructor Details

    • Property

      public Property(String[] args)
      Constructs a new Property object.

      Parameters:
      args - options for the property tool, see main(String[])
      Throws:
      tuwien.auto.calimero.KNXIllegalArgumentException - on missing or wrong formatted option value
  • Method Details

    • main

      public static void main(String... args)
      Entry point for running the Property tool from the console.

      A communication device, host, or port identifier has to be supplied to specify the endpoint for 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 are:

      • --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
      • --definitions -d file  use property definition file
      • --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 local device management these options are available:
      • --emulatewriteenable -e check write-enable of a property
      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 the KNX device
      Use one of the following commands for property access, with object-idx being the interface object index, and pid the KNX property identifier:
      • get object-idx pid [start-idx elements] get the property value(s)
      • set object-idx pid [start-idx] string-value set the property string-formatted value
      • set object-idx pid start-idx elements [\"0x\"|\"0\"|\"b\"]data set the property data
      • desc object-idx pid get the property description of the property ID
      • desc object-idx "i" prop-idx get the property description of the property index
      • scan [object-idx] list interface object type descriptions (of the indexed interface object)
      • scan [object-idx] "all" list all property descriptions (of the indexed interface object)
      • ? show command help
      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 the property tool
    • run

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

      protected void runCommand(String... cmd) throws InterruptedException
      Runs a single command.
      Parameters:
      cmd - the command to execute together with its parameters
      Throws:
      InterruptedException - on thread interrupt
    • onDescription

      protected void onDescription(tuwien.auto.calimero.mgmt.Description d)
      Invoked on receiving a property description.
      Parameters:
      d - the KNX property description
    • onPropertyValue

      protected void onPropertyValue(int idx, int pid, String value, List<byte[]> raw)
      Invoked on receiving a property value.
      Parameters:
      idx - the object index
      pid - the property ID
      value - the property values
      raw - list with the raw property data, list size == property elements
    • 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
    • link

      protected tuwien.auto.calimero.link.KNXNetworkLink link()
      Returns:
      the network link used by this tool