Class KNXConnection
java.lang.Object
org.openremote.agent.protocol.knx.KNXConnection
- All Implemented Interfaces:
EventListener,tuwien.auto.calimero.link.LinkListener,tuwien.auto.calimero.link.NetworkLinkListener,tuwien.auto.calimero.process.ProcessListener
public class KNXConnection
extends Object
implements tuwien.auto.calimero.link.NetworkLinkListener, tuwien.auto.calimero.process.ProcessListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.openremote.model.asset.agent.ConnectionStatusprotected final ScheduledExecutorServiceprotected final Stringprotected final Map<tuwien.auto.calimero.GroupAddress,List<org.openremote.model.util.Pair<tuwien.auto.calimero.datapoint.StateDP, Consumer<Object>>>> protected final Map<tuwien.auto.calimero.GroupAddress,byte[]> protected static final intprotected tuwien.auto.calimero.link.KNXNetworkLinkprotected static final intprotected final intprotected tuwien.auto.calimero.process.ProcessCommunicatorprotected static final intprotected intprotected ScheduledFuture<?>protected final boolean -
Constructor Summary
ConstructorsConstructorDescriptionKNXConnection(String gatewayAddress, String bindAddress, Integer gatewayPort, String messageSourceAddress, boolean routingMode, boolean natMode) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnectionStatusConsumer(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) voidaddDatapointValueConsumer(tuwien.auto.calimero.datapoint.StateDP datapoint, Consumer<Object> consumer) Add a consumer for the specifiedStateDP.voidconfirmation(tuwien.auto.calimero.FrameEvent e) voidconnect()voiddetached(tuwien.auto.calimero.DetachEvent e) voidprotected voidgetGroupAddressValue(tuwien.auto.calimero.GroupAddress groupAddress, tuwien.auto.calimero.Priority priority) voidgroupReadRequest(tuwien.auto.calimero.process.ProcessEvent e) voidgroupReadResponse(tuwien.auto.calimero.process.ProcessEvent e) voidgroupWrite(tuwien.auto.calimero.process.ProcessEvent e) A group address has changed on the KNX network so notify consumersvoidindication(tuwien.auto.calimero.FrameEvent e) voidlinkClosed(tuwien.auto.calimero.CloseEvent e) protected voidprotected voidonConnectionStatusChanged(org.openremote.model.asset.agent.ConnectionStatus connectionStatus) protected voidonGroupAddressUpdated(tuwien.auto.calimero.GroupAddress groupAddress, byte[] value) voidremoveConnectionStatusConsumer(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) voidremoveDatapointValueConsumer(tuwien.auto.calimero.datapoint.StateDP datapoint) Remove a consumer for the specifiedStateDP.protected voidvoidsendCommand(tuwien.auto.calimero.datapoint.Datapoint datapoint, Optional<Object> value) toString()protected voidupdateConsumer(byte[] data, tuwien.auto.calimero.datapoint.StateDP datapoint, Consumer<Object> consumer)
-
Field Details
-
connectionStatus
protected org.openremote.model.asset.agent.ConnectionStatus connectionStatus -
INITIAL_RECONNECT_DELAY_MILLIS
protected static final int INITIAL_RECONNECT_DELAY_MILLIS- See Also:
-
MAX_RECONNECT_DELAY_MILLIS
protected static final int MAX_RECONNECT_DELAY_MILLIS- See Also:
-
RECONNECT_BACKOFF_MULTIPLIER
protected static final int RECONNECT_BACKOFF_MULTIPLIER- See Also:
-
reconnectTask
-
reconnectDelayMilliseconds
protected int reconnectDelayMilliseconds -
connectionStatusConsumers
-
executorService
-
gatewayAddress
-
port
protected final int port- See Also:
-
routingMode
protected final boolean routingMode -
knxLink
protected tuwien.auto.calimero.link.KNXNetworkLink knxLink -
processCommunicator
protected tuwien.auto.calimero.process.ProcessCommunicator processCommunicator -
groupAddressStateMap
-
groupAddressConsumerMap
-
-
Constructor Details
-
KNXConnection
-
-
Method Details
-
connect
public void connect() -
disconnect
public void disconnect() -
addConnectionStatusConsumer
public void addConnectionStatusConsumer(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) -
removeConnectionStatusConsumer
public void removeConnectionStatusConsumer(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) -
onConnectionStatusChanged
protected void onConnectionStatusChanged(org.openremote.model.asset.agent.ConnectionStatus connectionStatus) -
sendCommand
-
groupWrite
public void groupWrite(tuwien.auto.calimero.process.ProcessEvent e) A group address has changed on the KNX network so notify consumers- Specified by:
groupWritein interfacetuwien.auto.calimero.process.ProcessListener
-
onGroupAddressUpdated
protected void onGroupAddressUpdated(tuwien.auto.calimero.GroupAddress groupAddress, byte[] value) -
groupReadRequest
public void groupReadRequest(tuwien.auto.calimero.process.ProcessEvent e) - Specified by:
groupReadRequestin interfacetuwien.auto.calimero.process.ProcessListener
-
groupReadResponse
public void groupReadResponse(tuwien.auto.calimero.process.ProcessEvent e) - Specified by:
groupReadResponsein interfacetuwien.auto.calimero.process.ProcessListener
-
detached
public void detached(tuwien.auto.calimero.DetachEvent e) - Specified by:
detachedin interfacetuwien.auto.calimero.process.ProcessListener
-
indication
public void indication(tuwien.auto.calimero.FrameEvent e) - Specified by:
indicationin interfacetuwien.auto.calimero.link.LinkListener
-
linkClosed
public void linkClosed(tuwien.auto.calimero.CloseEvent e) - Specified by:
linkClosedin interfacetuwien.auto.calimero.link.LinkListener
-
confirmation
public void confirmation(tuwien.auto.calimero.FrameEvent e) - Specified by:
confirmationin interfacetuwien.auto.calimero.link.NetworkLinkListener
-
onConnectionError
protected void onConnectionError() -
addDatapointValueConsumer
public void addDatapointValueConsumer(tuwien.auto.calimero.datapoint.StateDP datapoint, Consumer<Object> consumer) Add a consumer for the specifiedStateDP. -
removeDatapointValueConsumer
public void removeDatapointValueConsumer(tuwien.auto.calimero.datapoint.StateDP datapoint) Remove a consumer for the specifiedStateDP.NOTE: The
StateDPmust be the same instance as supplied at registration. -
getGroupAddressValue
protected void getGroupAddressValue(tuwien.auto.calimero.GroupAddress groupAddress, tuwien.auto.calimero.Priority priority) -
updateConsumer
-
scheduleReconnect
protected void scheduleReconnect() -
toString
-