Issue #262 has been updated by Stefano Lenzi.

Category set to zigbee.zcl.library
Status changed from New to In Progress
Assignee set to Stefano Lenzi
Priority changed from Normal to High
Target version set to org.aaloa.zb4osgi.zigbee.zcl.library-1.X

Dear Philipp,

I could not find the code that you wrote on inside ZB4O nevertheless, it seems 
that all the call to the method 
ByteArrayOutputStreamSerializer.append_long(long) has never been used as far as 
I know, while it was used many time other method, so I think that the problem 
may be limited to the specified method. 

I will look further at it, but please can you point me to the file that 
contains the code that you posted?


----------------------------------------
Task #262: Check byte-order writing
http://zb4o.aaloa.org/redmine/issues/262#change-680

Author: Philipp  Buluschek
Status: In Progress
Priority: High
Assignee: Stefano Lenzi
Category: zigbee.zcl.library
Target version: org.aaloa.zb4osgi.zigbee.zcl.library-1.X


I implemented the writing of ZigBee data type IEEE_Address (see 
ZigBeeType.IEEEAddress) in ByteArrayOutputStreamSerializer. The original 
Java-data type was String, but I changed it to Long as it is much more adapted 
(as it's also what is returned from SimpleDriver.getIEEEAddress() ).

Writing the IEEE Address (as a long) in ByteArrayOutputStreamSerializer, I 
supposed the code should look like:
@
case IEEEAddress:
  final Long l = (Long) data;
  append_long(l.longValue());
  break;@

But noticed that, the IEEE address gets written byte-order reversed over the 
air. In particular, the ZigBee Spec (1.2.1.3) says that the least significant 
byte must be sent first. But the implementation of Integers.writeLong() does 
the reverse (writes msb first to the buffer). For my case, I simply added a 
implementation of the reversed writing - so not a problem.

But I now wonder - all other data types (larger than 1 byte) are written in the 
same manner as long in Integers.writeXXX(). Should they all be reversed?






-- 
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