Class DeviceInfo
- All Implemented Interfaces:
Runnable
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumcEMI server parameters.static enumCommon device info parameters.static enumstatic final classstatic enumKNX IP device parameters.static interfaceDevice parameter that can be queried by a client.static enumRF medium parameters.static enum -
Constructor Summary
ConstructorsConstructorDescriptionDeviceInfo(String[] args) Creates a new DeviceInfo instance using the supplied options. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidEntry point for running DeviceInfo.protected voidonCompletion(Exception thrown, boolean canceled) Called by this tool on completion.protected voidInvoked on each successfully read device parameter of a KNX device.protected voidonDeviceInformation(DeviceInfo.Parameter parameter, String value, byte[] raw) Invoked after successfully reading a KNX device parameter.voidrun()
-
Constructor Details
-
DeviceInfo
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
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 -hshow help message--versionshow tool/library version and exit--localhostid local IP/host name--localportnumber local UDP port (default system assigned)--port -pnumber UDP port on host (default 3671)--nat -nenable Network Address Translation--ft12 -fuse FT1.2 serial communication--usb -uuse KNX USB communication--tpuartuse TP-UART communication--medium -mid KNX medium [tp1|p110|knxip|rf] (defaults to tp1)--domainaddress domain address on open KNX medium (PL or RF)--knx-address -kKNX address KNX device address of local endpoint
--knx-addressoption 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() -
onDeviceInformation
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 devicevalue- formatted value of that parameterraw- raw value of that parameter
-
onDeviceInformation
Invoked on each successfully read device parameter of a KNX device.- Parameters:
item- device parameter and value
-
onCompletion
Called by this tool on completion.- Parameters:
thrown- the thrown exception if operation completed due to a raised exception,nullotherwisecanceled- whether the operation got canceled before its planned end
-