[zb4osgi Dev] Attribute subscription - why not attribute specific?

Stefano 'Kismet' Lenzi kismet.sl at gmail.com
Wed Dec 3 17:40:56 CET 2014


Hi Philipp,

please look at my inline comment...

On Wed, Dec 3, 2014 at 9:37 AM, Philipp Buluschek <
philipp.buluschek at adhoco.com> wrote:

>  Hi Stefano
>
> What you propose is basically what happens today, only that today you can
> also get notified when the attribute is not present at all.
> In both cases, the listener still has to iterate over all transmitted
> attributes/values to check if and where its expected value is present.
>

Exactly


>
> Why not simply have a listener interface like:
>
>   public interface ReportListener {
>       public void  receivedReport(Object newAttributeValue);
>   }
>
> and let the dispatcher or better the ClusterFilter do the job of selecting
> which Subscription and listener gets which event.
>

I understand your point, the idea was that at the ZCL library was providing
an interface that was very near to the ZCL library, thus the ReportListener
mimic the behavior of a ZigBee Device on that receive an Attribute Report
Command, for an high-level interface the one others listener (i.e.
OnOffListener, and so on) from zigbee.ha.driver should be used.


>
> Are there use-cases you know of, where getting notified of several
> (unrelated) values of one cluster in one call has benefits? If one is
> specifically interested in getting updates for two attributes, one can
> register the same listener in two attribute subscriptions...
>

As far as I know there no real use case that blocks us from changing the
API as you mentioned, but let me ask to others also before changing such
API... On the other hand we may define a new interface for such kind of
reporting...


>
> Regards Philipp
>

Ciao,
Stefano


>
>
>
>
> On 02.12.2014 18:53, Stefano Lenzi wrote:
>
> Hi Philipp,
>
> I think that the current behavior is just a bug. In fact, the ZigBee
> device may send a Report Attribute message containing multiple attributes
> for optimizing the network overhead, but the ReportListener (as it is
> defined) is linked to a specific subscription which is linked to a single
> attribute, thus the callback should happen only when the attribute
> reporting not only is coming from the right Device/Cluster, but also from
> the Attribute that the developer decided to subscribe to.
>
> So, I think that it is reasnoable to recieve notification containing
> several attributes as long as at least the one of the attributes is the ont
> that the developer is subscribed for.
>
> Do you agree?
>
> Ciao,
> Stefano
>
> Il 02/12/2014 17:14, Philipp Buluschek ha scritto:
>
> Hi Stefano, hi all
>
> When subscribing for attribute reports ( Attribute.getSubscription()
> etc.), the actual reports/events which are sent to the listeners contain
> all reported attributes, not just the ones you subscribed to.
>
> For example: you subscribe with listener 1 to get attribute 1 reports ,
> and (unrelated) with listener 2 to get attribute 2 reports. Now if both
> attributes are part of the same cluster, any report will be calling both
> listeners.
> If a report message from Att1 comes in, it gets reported to both listener
> 1 and 2. Listener 2 is not interested in reports from attribute 1 and must
> ignore this call, as it is not relevant for it.
>
> I would have expected Listener 1 to get only reports from Att1 and the
> same for 2.
>
> Why was it chosen to do it like this? Or is this unintended? (in which
> case I can file a bug)
>
> NB: relevant code is in
> SubscriptionBase.ReportListenerNotifier.handleCluster(ZigBeeDevice,
> Cluster)
>
> Regards Philipp
>
>
>
> _______________________________________________
> Dev mailing list
> Dev at zb4osgi.aaloa.org
> http://zb4osgi.aaloa.org/mailman/listinfo/dev
>
>
>
>
>
> _______________________________________________
> Dev mailing listDev at zb4osgi.aaloa.orghttp://zb4osgi.aaloa.org/mailman/listinfo/dev
>
>
> --
> ________________________________________
>
>  Philipp Buluschek, Dr.-Ing.
>  Adhoco AG
>  Althardstr. 70
>  CH-8105 Regensdorf
>
>  Phone:  +41 52 264 5081
>  Mobile: +41 79 800 8218
> ________________________________________
>
>
> _______________________________________________
> Dev mailing list
> Dev at zb4osgi.aaloa.org
> http://zb4osgi.aaloa.org/mailman/listinfo/dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://zb4osgi.aaloa.org/pipermail/dev/attachments/20141203/31252184/attachment.html>


More information about the Dev mailing list