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.ConnectionStatus
protected final String
protected 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 int
protected tuwien.auto.calimero.link.KNXNetworkLink
protected static final int
protected final int
protected tuwien.auto.calimero.process.ProcessCommunicator
protected static final int
protected int
protected ScheduledFuture<?>
protected final boolean
protected final ScheduledExecutorService
-
Constructor Summary
ConstructorsConstructorDescriptionKNXConnection
(String gatewayAddress, String bindAddress, Integer gatewayPort, String messageSourceAddress, boolean routingMode, boolean natMode) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConnectionStatusConsumer
(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) void
addDatapointValueConsumer
(tuwien.auto.calimero.datapoint.StateDP datapoint, Consumer<Object> consumer) Add a consumer for the specifiedStateDP
.void
confirmation
(tuwien.auto.calimero.FrameEvent e) void
connect()
void
detached
(tuwien.auto.calimero.DetachEvent e) void
protected void
getGroupAddressValue
(tuwien.auto.calimero.GroupAddress groupAddress, tuwien.auto.calimero.Priority priority) void
groupReadRequest
(tuwien.auto.calimero.process.ProcessEvent e) void
groupReadResponse
(tuwien.auto.calimero.process.ProcessEvent e) void
groupWrite
(tuwien.auto.calimero.process.ProcessEvent e) A group address has changed on the KNX network so notify consumersvoid
indication
(tuwien.auto.calimero.FrameEvent e) void
linkClosed
(tuwien.auto.calimero.CloseEvent e) protected void
protected void
onConnectionStatusChanged
(org.openremote.model.asset.agent.ConnectionStatus connectionStatus) protected void
onGroupAddressUpdated
(tuwien.auto.calimero.GroupAddress groupAddress, byte[] value) void
removeConnectionStatusConsumer
(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) void
removeDatapointValueConsumer
(tuwien.auto.calimero.datapoint.StateDP datapoint) Remove a consumer for the specifiedStateDP
.protected void
void
sendCommand
(tuwien.auto.calimero.datapoint.Datapoint datapoint, Optional<Object> value) toString()
protected void
updateConsumer
(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
-
scheduledExecutorService
-
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:
groupWrite
in 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:
groupReadRequest
in interfacetuwien.auto.calimero.process.ProcessListener
-
groupReadResponse
public void groupReadResponse(tuwien.auto.calimero.process.ProcessEvent e) - Specified by:
groupReadResponse
in interfacetuwien.auto.calimero.process.ProcessListener
-
detached
public void detached(tuwien.auto.calimero.DetachEvent e) - Specified by:
detached
in interfacetuwien.auto.calimero.process.ProcessListener
-
indication
public void indication(tuwien.auto.calimero.FrameEvent e) - Specified by:
indication
in interfacetuwien.auto.calimero.link.LinkListener
-
linkClosed
public void linkClosed(tuwien.auto.calimero.CloseEvent e) - Specified by:
linkClosed
in interfacetuwien.auto.calimero.link.LinkListener
-
confirmation
public void confirmation(tuwien.auto.calimero.FrameEvent e) - Specified by:
confirmation
in 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
StateDP
must 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
-