Package tuwien.auto.calimero.tools
Class BaosClient
java.lang.Object
tuwien.auto.calimero.tools.BaosClient
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionBaosClient(String[] args) Creates a new BaosClient instance using the supplied options. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecuteBaosCommand(String cmd) static voidEntry point for running BaosClient.static Stringmanufacturer(int mf) protected voidonBaosEvent(tuwien.auto.calimero.baos.BaosService svc) Called by this tool on receiving a BAOS communication event.protected voidonCompletion(Exception thrown, boolean canceled) Called by this tool on completion.voidquit()Quits BAOS communication and closes the network link.voidrun()voidstart()Starts communication with the BAOS device.
-
Constructor Details
-
BaosClient
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. Seemain(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 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 -hshow help message--versionshow tool/library version and exit--ft12 -fuse FT1.2 serial communication--usb -uuse KNX USB communication--tcpuse TCP/IP communication (default)--udpuse UDP/IP communication--localhostid local IP/host name--localportnumber local UDP port (default system assigned)--port -pnumber UDP port on host (default 12004)--nat -nenable Network Address Translation
- 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"
switchfor DPT 1.001, with valuesoff,onboolfor DPT 1.002, with valuesfalse,truedimmerfor DPT 3.007, with valuesdecrease 0..7,increase 0..7blindsfor DPT 3.008, with valuesup 0..7,down 0..7percentfor DPT 5.001, with values0..100%for DPT 5.001, with values0..100anglefor DPT 5.003, with values0..360ucountfor DPT 5.010, with values0..255tempfor DPT 9.001, with values-273..+670760floatorfloat2for DPT 9.002float4for DPT 14.005intfor DPT 13.001stringfor DPT 16.001
- Parameters:
args- command line options for BAOS communication
-
run
public void run() -
start
Starts communication with the BAOS device. This method immediately returns when the communication link is established. Callquit()to quit communication.- Throws:
tuwien.auto.calimero.KNXException- on problems creating network linkInterruptedException- on interrupted thread
-
quit
public void quit()Quits BAOS communication and closes the network link. -
manufacturer
-
executeBaosCommand
protected void executeBaosCommand(String cmd) throws tuwien.auto.calimero.KNXException, InterruptedException - Throws:
tuwien.auto.calimero.KNXExceptionInterruptedException
-
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
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
-