Notification when client subscribed an object
-
I am writing a gateway between a proprietary protocol and BACnet, where a large number of data points should be exposed as BACnet points. I need to know when any BACnet client subscribed an object for data delivery to start polling for values on the backend. Any idea where to hook?
-
I'm not overly familiar with the BACnet protocol but I have worked with this code some. Perhaps the class:
com.serotonin.bacnet4j.event.DeviceEventListener
-
The method
covNotificationReceived(...)
in
com.serotonin.bacnet4j.event.DeviceEventLiistener
is fired on the client side when a BACnet client receives a value change from a BACnet server. What I need is the opposite - I need an event on the server side when a client starts to poll for a BACnetObject property (in my case the PresentValue). The proper place for a hook could be
BACnetObject.addCovSubscription() BACnetObject.removeCovSubscription()
or
CovReportingMixin.addCovSubscription() CovReportingMixin.removeCovSubscription()
Both are not easy to implement via subclassing (Bacnet4J library does not allow me to add my own MixIn, for example) so I ended by changing the original source code.