Class Memory
- All Implemented Interfaces:
Runnable
Runnable tool implementation allowing a user to read or write memory in 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/write memory locations.
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 read memory as well as errors and problems during execution are written to
System.out.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final recordstatic final record -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Memory.Commandstatic voidEntry point for running Memory.protected voidonCompletion(Exception thrown, boolean canceled) Called by this tool on completion.protected voidonMemoryRead(int address, byte[] data) Invoked on each successfully memory read.voidrun()
-
Field Details
-
Done
-
-
Constructor Details
-
Memory
Creates a new Memory instance using the supplied options.Mandatory arguments are the connection options depending on the type of connection to the KNX network, the KNX device address ("area.line.device"), and the read or write command. 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 Memory.Syntax: Memory [options] <host|port> <KNX device address> read|write <addr> [bytes|data]
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--decdata is interpreted in unsigned decimal format
--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.Supported commands:
read(orr) addr [bytes] read number of bytes (default 1) starting at memory addresswrite(orw) addr data write data to memory starting at address
- Parameters:
args- command line options for running the device info tool
-
run
public void run() -
fetchCommand
-
onMemoryRead
protected void onMemoryRead(int address, byte[] data) Invoked on each successfully memory read.- Parameters:
data- memory data
-
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
-