Package net.solarnetwork.node.io.bacnet
Interface BacnetConnection
- All Superinterfaces:
AutoCloseable,Closeable
High level BACnet connection API.
- Version:
- 1.0
- Author:
- matt
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCovHandler(BacnetCovHandler handler) Add a handler to receive change-of-value property notifications.intcovSubscribe(Collection<BacnetDeviceObjectPropertyRef> refs, int maxDelay) Subscribe to unconfirmed change-of-value property notifications.voidcovUnsubscribe(int subscriptionId) Unsubscribe to unconfirmed change-of-value property notifications.booleanisClosed()Test ifCloseable.close()has been called.booleanTest if the connection has been established.voidopen()Open the connection, if it is not already open.Read property values.voidremoveCovHandler(BacnetCovHandler handler) Remove a handler previously registered withaddCovHandler(BacnetCovHandler).voidupdatePropertyValues(Map<BacnetDeviceObjectPropertyRef, ?> values) Write property values.
-
Method Details
-
open
Open the connection, if it is not already open.The connection must be opened before calling any of the other methods in this API. The
Closeable.close()method must be called when the connection is longer needed.- Throws:
IOException- if the connection cannot be opened
-
isEstablished
boolean isEstablished()Test if the connection has been established.- Returns:
- true if the connection has been established, false if the connection has never been opened or has been closed
-
isClosed
boolean isClosed()Test ifCloseable.close()has been called.This method does not necessarily verify if the physical connection has been terminated, it is merely an indication if
Closeable.close()has been invoked.- Returns:
- true if
Closeable.close()has been invoked on this connection
-
addCovHandler
Add a handler to receive change-of-value property notifications.The handler will be passed the subscription ID and any associated property updates.
- Parameters:
handler- the handler to add
-
removeCovHandler
Remove a handler previously registered withaddCovHandler(BacnetCovHandler).- Parameters:
handler- the handler to remove
-
covSubscribe
Subscribe to unconfirmed change-of-value property notifications.- Parameters:
refs- the device object properties to subscribe tomaxDelay- the maximum delay, in seconds, for changes to be published within- Returns:
- the unique subscription ID
-
covUnsubscribe
void covUnsubscribe(int subscriptionId) Unsubscribe to unconfirmed change-of-value property notifications.- Parameters:
subscriptionId- the subscription ID to unsubscribe from, as previously returned fromcovSubscribe(Collection, int)
-
propertyValues
Read property values.- Parameters:
refs- the property values to read- Returns:
- the values
-
updatePropertyValues
Write property values.- Parameters:
values- the property values to write
-