Skip to content

Commit 6ca1683

Browse files
committed
fix #101: avoid reading the 16-bit address when the protocol is SX
It also fixes the node discovery of remote SX devices. Signed-off-by: Ruben Moral <Ruben.Moral@digi.com>
1 parent beb31ce commit 6ca1683

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

library/src/main/java/com/digi/xbee/api/AbstractXBeeDevice.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,11 @@ public void readDeviceInfo() throws TimeoutException, XBeeException {
477477
// Get the 16-bit address. This must be done after obtaining the protocol because
478478
// DigiMesh and Point-to-Multipoint protocols don't have 16-bit addresses.
479479
XBeeProtocol protocol = getXBeeProtocol();
480-
if (protocol != XBeeProtocol.DIGI_MESH
481-
&& protocol != XBeeProtocol.DIGI_POINT
482-
&& protocol != XBeeProtocol.XBEE_WIFI
483-
&& protocol != XBeeProtocol.CELLULAR
484-
&& protocol != XBeeProtocol.UNKNOWN) {
480+
if (protocol == XBeeProtocol.ZIGBEE
481+
|| protocol == XBeeProtocol.RAW_802_15_4
482+
|| protocol == XBeeProtocol.XTEND
483+
|| protocol == XBeeProtocol.SMART_ENERGY
484+
|| protocol == XBeeProtocol.ZNET) {
485485
response = getParameter("MY");
486486
xbee16BitAddress = new XBee16BitAddress(response);
487487
}

library/src/main/java/com/digi/xbee/api/NodeDiscovery.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ private RemoteXBeeDevice parseDiscoveryAPIData(byte[] data, XBeeDevice localDevi
482482
// TODO [XLR_DM] The next version of the XLR will add DigiMesh support.
483483
// For the moment only point-to-multipoint is supported in this kind of devices.
484484
case XLR_DM:
485+
case SX:
485486
// Read node identifier.
486487
id = ByteUtils.readString(inputStream);
487488
// Read parent address.

0 commit comments

Comments
 (0)