Issue #264 has been updated by Stefano Lenzi.

Category set to zigbee.basedriver
Status changed from New to In Progress
Assignee set to Stefano Lenzi
Target version set to org.aaloa.zb4osgi.zigbee.basedriver-1.X

Thank you for finding this glitch, I'm afraid that this "signed/unsigned" may 
be present in other part of the code.

Regarding your question I have to look back at the code...
----------------------------------------
Bug #264: Confusion between signed and unsigned 16bit short address
http://zb4o.aaloa.org/redmine/issues/264#change-672

Author: Philipp  Buluschek
Status: In Progress
Priority: High
Assignee: Stefano Lenzi
Category: zigbee.basedriver
Target version: org.aaloa.zb4osgi.zigbee.basedriver-1.X
Has a patch: Yes
Has license agreement signed: No


In ZigBeeDeviceImpl there is a check for the correct short address before 
notifying listeners

public void notify(AF_INCOMING_MSG msg) {
  ...
  if (msg.getSrcAddr() != node.getNetworkAddress())

Here the left value is a short and thus is in [-32768 .. 32767], the right 
value is an int, which comes from ZToolAddress16 in which 
DoubleByte.get16BitValue() gets called. This is implemented as 
  public int get16BitValue() {
    return (this.msb << 8) + this.lsb;
  }

which will return an unsigned value in [0..65535].

As far as I can tell, this comparison will simply discard all AF messages for 
devices with a short address above 32767 (0x7FF) instead of notifying the 
cluster listeners.


Possible fix: 
  if ((msg.getSrcAddr() & 0xFFFF) != node.getNetworkAddress())
or
  if (msg.getSrcAddr() != (short)node.getNetworkAddress())


PS: In this same method ( ZigBeeDeviceImpl.notify(AF_INCOMING_MSG msg) ) why 
are the consumers notified in any case, but the listeners only if the network 
addresses match?



-- 
DO NOT ANSWER TO THIS E-MAIL ADDRESS, NO ONE WILL READ IT. PLEASE WRITE TO 
[email protected]
ZigBee 4 OSGi - Redmine E-Mail Notificatioon
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://zb4o.aaloa.org/redmine
_______________________________________________
Dev mailing list
[email protected]
http://zb4osgi.aaloa.org/mailman/listinfo/dev

Reply via email to