jankolkmeier / xbee-api

Node.js and Chrome communicate with XBee/ZigBee devices in API mode
MIT License
105 stars 51 forks source link

Fix ND frame command #42

Closed niciqy closed 8 years ago

niciqy commented 8 years ago

I tested it on 2 XBee with 802.15.4 function and found the below bug:

In a coordinator & end point network, when a coordinator sends out a AT Command (0x08) frame with ND Command, all connected end point, including itself will respond. When the coordinator respond to it's own frame, it will not include remote16 or remote64 as data. The code will throw a Buffer Boundary as it expects all responding packet to include remote data.

XBee with 802.15.4 function set (end point) will not respond with information such as remoteParent16, deviceType, etc. Hence, I wrap a check to prevent Buffer Boundary error.

jankolkmeier commented 8 years ago

Thank you for the detailed explanation and the fix! Very much appreciated!