Class KNXProtocol
java.lang.Object
org.openremote.agent.protocol.AbstractProtocol<KNXAgent,KNXAgentLink>
org.openremote.agent.protocol.knx.KNXProtocol
- All Implemented Interfaces:
org.openremote.model.asset.agent.Protocol<KNXAgent>,org.openremote.model.protocol.ProtocolAssetImport
public class KNXProtocol
extends AbstractProtocol<KNXAgent,KNXAgentLink>
implements org.openremote.model.protocol.ProtocolAssetImport
This protocol is used to connect to a KNX bus via an IP interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<org.openremote.model.attribute.AttributeRef,tuwien.auto.calimero.datapoint.Datapoint> protected final Map<org.openremote.model.attribute.AttributeRef,tuwien.auto.calimero.datapoint.StateDP> protected KNXConnectionstatic final StringFields inherited from class org.openremote.agent.protocol.AbstractProtocol
agent, assetService, datapointService, dynamicAttributes, executorService, linkedAttributes, messageBrokerContext, predictedDatapointService, producerTemplate, timerServiceFields inherited from interface org.openremote.model.asset.agent.Protocol
ACTUATOR_TOPIC, ACTUATOR_TOPIC_TARGET_PROTOCOL, DYNAMIC_TIME_PLACEHOLDER_REGEXP, DYNAMIC_VALUE_PLACEHOLDER, DYNAMIC_VALUE_PLACEHOLDER_REGEXP, SENSOR_QUEUE, SENSOR_QUEUE_SOURCE_PROTOCOL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddActionDatapoint(org.openremote.model.attribute.AttributeRef attributeRef, String groupAddress, String dpt) protected voidaddStatusDatapoint(org.openremote.model.attribute.AttributeRef attributeRef, String groupAddress, String dpt) protected voidcreateAsset(tuwien.auto.calimero.datapoint.StateDP datapoint, boolean isStatusGA, Map<String, org.openremote.model.asset.Asset<?>> createdAssets) protected voiddoLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, KNXAgentLink agentLink) Link anAttributeto its linkedAgent.protected voiddoLinkedAttributeWrite(org.openremote.model.attribute.Attribute<?> attribute, KNXAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) An Attribute event (write) has been requested for an attribute linked to this protocol.protected voiddoStart(org.openremote.model.Container container) Start this protocol instanceprotected voiddoStop(org.openremote.model.Container container) Stop this protocol instanceprotected voiddoUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, KNXAgentLink agentLink) Unlink anAttributefrom its linkedAgent.Get a URI that describes this specific protocol instanceGet the name for this protocolprotected voidhandleKNXValueChange(org.openremote.model.attribute.AttributeRef attributeRef, Object value) protected voidremoveActionDatapoint(org.openremote.model.attribute.AttributeRef attributeRef) protected voidremoveStatusDatapoint(org.openremote.model.attribute.AttributeRef attributeRef) startAssetImport(byte[] fileData, Consumer<org.openremote.model.asset.AssetTreeNode[]> assetConsumer) Start the process asynchronously; the implementation can make as many calls as it desires to the assetConsumer with the found assets; when the implementation has finished then the returned future will becomeFuture.isDone().Methods inherited from class org.openremote.agent.protocol.AbstractProtocol
getAgent, getLinkedAttributes, linkAttribute, processLinkedAttributeWrite, sendAttributeEvent, sendAttributeEvent, setConnectionStatus, start, stop, toString, unlinkAttribute, updateAgentAttribute, updateLinkedAttribute, updateLinkedAttributeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openremote.model.asset.agent.Protocol
prefixLogMessage
-
Field Details
-
PROTOCOL_DISPLAY_NAME
- See Also:
-
connection
-
attributeActionMap
protected final Map<org.openremote.model.attribute.AttributeRef,tuwien.auto.calimero.datapoint.Datapoint> attributeActionMap -
attributeStatusMap
protected final Map<org.openremote.model.attribute.AttributeRef,tuwien.auto.calimero.datapoint.StateDP> attributeStatusMap
-
-
Constructor Details
-
KNXProtocol
-
-
Method Details
-
getProtocolName
Description copied from interface:org.openremote.model.asset.agent.ProtocolGet the name for this protocol- Specified by:
getProtocolNamein interfaceorg.openremote.model.asset.agent.Protocol<KNXAgent>
-
doStart
Description copied from class:AbstractProtocolStart this protocol instance- Specified by:
doStartin classAbstractProtocol<KNXAgent,KNXAgentLink> - Throws:
Exception
-
doStop
Description copied from class:AbstractProtocolStop this protocol instance- Specified by:
doStopin classAbstractProtocol<KNXAgent,KNXAgentLink> - Throws:
Exception
-
doLinkAttribute
protected void doLinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, KNXAgentLink agentLink) throws RuntimeException Description copied from class:AbstractProtocolLink anAttributeto its linkedAgent.- Specified by:
doLinkAttributein classAbstractProtocol<KNXAgent,KNXAgentLink> - Throws:
RuntimeException
-
doUnlinkAttribute
protected void doUnlinkAttribute(String assetId, org.openremote.model.attribute.Attribute<?> attribute, KNXAgentLink agentLink) Description copied from class:AbstractProtocolUnlink anAttributefrom its linkedAgent.- Specified by:
doUnlinkAttributein classAbstractProtocol<KNXAgent,KNXAgentLink>
-
doLinkedAttributeWrite
protected void doLinkedAttributeWrite(org.openremote.model.attribute.Attribute<?> attribute, KNXAgentLink agentLink, org.openremote.model.attribute.AttributeEvent event, Object processedValue) Description copied from class:AbstractProtocolAn Attribute event (write) has been requested for an attribute linked to this protocol. The processedValue is the resulting value after applying standard outbound value processing (seeProtocolUtil.doOutboundValueProcessing(java.lang.String, org.openremote.model.attribute.Attribute<?>, org.openremote.model.asset.agent.AgentLink<?>, java.lang.Object, boolean)). Protocol implementations should generally use the processedValue but may also choose to use the original value for some purpose if required.- Specified by:
doLinkedAttributeWritein classAbstractProtocol<KNXAgent,KNXAgentLink>
-
addActionDatapoint
protected void addActionDatapoint(org.openremote.model.attribute.AttributeRef attributeRef, String groupAddress, String dpt) throws tuwien.auto.calimero.KNXFormatException - Throws:
tuwien.auto.calimero.KNXFormatException
-
removeActionDatapoint
protected void removeActionDatapoint(org.openremote.model.attribute.AttributeRef attributeRef) -
addStatusDatapoint
protected void addStatusDatapoint(org.openremote.model.attribute.AttributeRef attributeRef, String groupAddress, String dpt) throws tuwien.auto.calimero.KNXFormatException - Throws:
tuwien.auto.calimero.KNXFormatException
-
handleKNXValueChange
protected void handleKNXValueChange(org.openremote.model.attribute.AttributeRef attributeRef, Object value) -
removeStatusDatapoint
protected void removeStatusDatapoint(org.openremote.model.attribute.AttributeRef attributeRef) -
getProtocolInstanceUri
Description copied from interface:org.openremote.model.asset.agent.ProtocolGet a URI that describes this specific protocol instance- Specified by:
getProtocolInstanceUriin interfaceorg.openremote.model.asset.agent.Protocol<KNXAgent>
-
startAssetImport
public Future<Void> startAssetImport(byte[] fileData, Consumer<org.openremote.model.asset.AssetTreeNode[]> assetConsumer) Description copied from interface:org.openremote.model.protocol.ProtocolAssetImportStart the process asynchronously; the implementation can make as many calls as it desires to the assetConsumer with the found assets; when the implementation has finished then the returned future will becomeFuture.isDone(). The callee can also cancel the future at any time. If for some reason the process cannot be started or encounters an error then this method should log more details before completing the future.- Specified by:
startAssetImportin interfaceorg.openremote.model.protocol.ProtocolAssetImport
-
createAsset
-