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 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

      protected ScheduledFuture<?> reconnectTask
    • reconnectDelayMilliseconds

      protected int reconnectDelayMilliseconds
    • connectionStatusConsumers

      protected final List<Consumer<org.openremote.model.asset.agent.ConnectionStatus>> connectionStatusConsumers
    • scheduledExecutorService

      protected final ScheduledExecutorService scheduledExecutorService
    • gatewayAddress

      protected final String gatewayAddress
    • port

      protected final int port
      See Also:
    • routingMode

      protected final boolean routingMode
    • processCommunicator

      protected tuwien.auto.calimero.process.ProcessCommunicator processCommunicator
    • groupAddressStateMap

      protected final Map<tuwien.auto.calimero.GroupAddress,byte[]> groupAddressStateMap
    • groupAddressConsumerMap

      protected final Map<tuwien.auto.calimero.GroupAddress,List<org.openremote.model.util.Pair<tuwien.auto.calimero.datapoint.StateDP,Consumer<Object>>>> groupAddressConsumerMap
  • Constructor Details

    • KNXConnection

      public KNXConnection(String gatewayAddress, String bindAddress, Integer gatewayPort, String messageSourceAddress, boolean routingMode, boolean natMode)
  • 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

      public void sendCommand(tuwien.auto.calimero.datapoint.Datapoint datapoint, Optional<Object> value)
    • 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 interface tuwien.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 interface tuwien.auto.calimero.process.ProcessListener
    • groupReadResponse

      public void groupReadResponse(tuwien.auto.calimero.process.ProcessEvent e)
      Specified by:
      groupReadResponse in interface tuwien.auto.calimero.process.ProcessListener
    • detached

      public void detached(tuwien.auto.calimero.DetachEvent e)
      Specified by:
      detached in interface tuwien.auto.calimero.process.ProcessListener
    • indication

      public void indication(tuwien.auto.calimero.FrameEvent e)
      Specified by:
      indication in interface tuwien.auto.calimero.link.LinkListener
    • linkClosed

      public void linkClosed(tuwien.auto.calimero.CloseEvent e)
      Specified by:
      linkClosed in interface tuwien.auto.calimero.link.LinkListener
    • confirmation

      public void confirmation(tuwien.auto.calimero.FrameEvent e)
      Specified by:
      confirmation in interface tuwien.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 specified StateDP.
    • removeDatapointValueConsumer

      public void removeDatapointValueConsumer(tuwien.auto.calimero.datapoint.StateDP datapoint)
      Remove a consumer for the specified StateDP.

      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

      protected void updateConsumer(byte[] data, tuwien.auto.calimero.datapoint.StateDP datapoint, Consumer<Object> consumer)
    • scheduleReconnect

      protected void scheduleReconnect()
    • toString

      public String toString()
      Overrides:
      toString in class Object