Class Property
- All Implemented Interfaces:
Runnable
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected tuwien.auto.calimero.link.KNXNetworkLinklink()static voidEntry point for running the Property tool from the console.protected voidonCompletion(Exception thrown, boolean canceled) Called by this tool on completion.protected voidonDescription(tuwien.auto.calimero.mgmt.Description d) Invoked on receiving a property description.protected voidonPropertyValue(int idx, int pid, String value, List<byte[]> raw) Invoked on receiving a property value.voidrun()protected voidrunCommand(String... cmd) Runs a single command.
-
Field Details
-
options
Contains tool options after parsing command line. -
pc
protected tuwien.auto.calimero.mgmt.PropertyClient pcThe used property client.
-
-
Constructor Details
-
Property
Constructs a new Property object.- Parameters:
args- options for the property tool, seemain(String[])- Throws:
tuwien.auto.calimero.KNXIllegalArgumentException- on missing or wrong formatted option value
-
-
Method Details
-
main
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 -hshow help message--versionshow tool/library version and exit--local -llocal device management (default)--remote -rKNX addr remote property service--definitions -dfile use property definition file--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
--emulatewriteenable -echeck write-enable of a property
--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--connect -cconnection oriented mode--authorize -akey authorize key to access the KNX device
get object-idx pid [start-idx elements]get the property value(s)set object-idx pid [start-idx] string-valueset the property string-formatted valueset object-idx pid start-idx elements [\"0x\"|\"0\"|\"b\"]dataset the property datadesc object-idx pidget the property description of the property IDdesc object-idx "i" prop-idxget the property description of the property indexscan [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
--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 the property tool
-
run
public void run() -
runCommand
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
Invoked on receiving a property value.- Parameters:
idx- the object indexpid- the property IDvalue- the property valuesraw- list with the raw property data,list size == property elements
-
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
-
link
protected tuwien.auto.calimero.link.KNXNetworkLink link()- Returns:
- the network link used by this tool
-