zsmartsystems / com.zsmartsystems.zigbee

ZigBee Cluster Library Java framework supporting multiple dongles
Eclipse Public License 1.0
143 stars 88 forks source link

XBee driver not handling timeouts gracefully? #1257

Closed darrencocco closed 3 years ago

darrencocco commented 3 years ago

Using Digi XU-Z11 with OpenHab one of the requests to getZigBeeChannel fails due to 500ms timeout which then throws a NullPointerException in com.zsmartsystems.zigbbee.dongle.xbee.ZigBeeDongleXBee

I believe this line is the cause of it: https://github.com/zsmartsystems/com.zsmartsystems.zigbee/blob/master/com.zsmartsystems.zigbee.dongle.xbee/src/main/java/com/zsmartsystems/zigbee/dongle/xbee/ZigBeeDongleXBee.java#L466

Because when the frameHandler fails it simply returns null which it is then trying call the method getChannel on.

Is throwing a runtime exception here expected behaviour?

darrencocco commented 3 years ago

FYI if this is definitely not expected behaviour I can whip up a patch.

cdjackson commented 3 years ago

Please feel free to propose a solution that you believe is better :). I've not analysed this myself yet so can't confirm if it should work this way, but it doesn't initially sound like the best option, so if you have a better solution, then submitting it would be appreciated.

cdjackson commented 3 years ago

@darrencocco just an FYI - I'm planning to update the library version used in OH in the next week or so. If you are looking at this issue please let me know your timeframe so I can keep it in mind.

darrencocco commented 3 years ago

@cdjackson I am working on this currently hopefully will have some progress in the next 2 days.

cdjackson commented 3 years ago

Closed by #1263