Class BaosClient

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

public class BaosClient extends Object implements Runnable
A tool for Calimero providing KNX BAOS (Bus Access and Object Server) communication. It supports access to a BAOS capable device using a KNXnet/IP, USB, or FT1.2 connection.
  • Constructor Details

    • BaosClient

      public BaosClient(String[] args)
      Creates a new BaosClient instance using the supplied options. Mandatory arguments are either an IP host, USB, or FT1.2 port identifier, depending on the type of connection to the KNX network. 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 BaosClient. The endpoint for KNX network access is either an IP host or port identifier for IP, USB, or FT1.2. 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
      • --ft12 -f use FT1.2 serial communication
      • --usb -u use KNX USB communication
      • --tcp use TCP/IP communication (default)
      • --udp use UDP/IP communication
      • --localhost id  local IP/host name
      • --localport number  local UDP port (default system assigned)
      • --port -p number  UDP port on host (default 12004)
      • --nat -n enable Network Address Translation
      Available commands for BAOS communication:
      • get {property|value|timer|history|description}: get a property, value, timer, history, or description
      • set {property|value|timer|history}: set a property, value, timer, or history"
      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 BAOS communication
    • run

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

      public void start() throws tuwien.auto.calimero.KNXException, InterruptedException
      Starts communication with the BAOS device. This method immediately returns when the communication link is established. Call quit() to quit communication.
      Throws:
      tuwien.auto.calimero.KNXException - on problems creating network link
      InterruptedException - on interrupted thread
    • quit

      public void quit()
      Quits BAOS communication and closes the network link.
    • manufacturer

      public static String manufacturer(int mf)
    • executeBaosCommand

      protected void executeBaosCommand(String cmd) throws tuwien.auto.calimero.KNXException, InterruptedException
      Throws:
      tuwien.auto.calimero.KNXException
      InterruptedException
    • onBaosEvent

      protected void onBaosEvent(tuwien.auto.calimero.baos.BaosService svc)
      Called by this tool on receiving a BAOS communication event.
      Parameters:
      svc - the baos service
    • 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