What steps will reproduce the problem?
1. run the example at
http://code.google.com/p/xbee-api/source/browse/trunk/src/com/rapplogic/xbee/exa
mples/wpan/NodeDiscoverTest.java
2. Observe NullPointerException upon timeout expiration:
java.lang.NullPointerException
at com.rapplogic.xbee.api.XBeeResponse.toString(XBeeResponse.java:105)
at com.rapplogic.xbee.api.ErrorResponse.toString(ErrorResponse.java:63)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at net.sf.dz3.device.sensor.impl.xbee.XBeeDeviceFactory$1.processResponse(XBeeDeviceFactory.java:175)
at com.rapplogic.xbee.api.XBee.handlePacket(XBee.java:284)
at com.rapplogic.xbee.api.XBeePacketParser.newPacketNotification(XBeePacketParser.java:159)
at com.rapplogic.xbee.api.XBeePacketParser.run(XBeePacketParser.java:121)
at java.lang.Thread.run(Thread.java:619)
3.
What version of the product are you using? On what operating system?
Current SVN code, platform independent
Please provide any additional information below.
Patch below fixes the situation:
Index: src/com/rapplogic/xbee/api/XBeeResponse.java
===================================================================
--- src/com/rapplogic/xbee/api/XBeeResponse.java (revision 216)
+++ src/com/rapplogic/xbee/api/XBeeResponse.java (working copy)
@@ -102,7 +102,7 @@
public String toString() {
return "apiId=" + this.apiId +
- ",length=" + length.get16BitValue() +
+ ",length=" + (length == null ? "?" : length.get16BitValue()) +
",checksum=" + ByteUtils.toBase16(checksum) +
",error=" + this.error;
}
Original issue reported on code.google.com by vadim.tkachenko on 29 Jul 2010 at 4:13
Original issue reported on code.google.com by
vadim.tkachenko
on 29 Jul 2010 at 4:13