Class ScanDevices
- All Implemented Interfaces:
Runnable
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voidEntry point for running ScanDevices.protected voidonCompletion(Exception thrown, boolean canceled) Called by this tool on completion.protected voidonDeviceFound(tuwien.auto.calimero.IndividualAddress device) Called on receiving a device response during the scan.protected voidonDeviceFound(tuwien.auto.calimero.IndividualAddress device, tuwien.auto.calimero.DeviceDescriptor.DD0 dd0) voidrun()
-
Constructor Details
-
ScanDevices
Constructs a new ScanDevices.- Parameters:
args- tool arguments
-
-
Method Details
-
main
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 -hshow help message--versionshow tool/library version and exit--localhostid local IP/host name--localportport local UDP port (default system assigned)--port -pport 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, defaults to broadcast domain)--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() -
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
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
-