Closed jamesleesaunders closed 8 years ago
Also consider whether it is necessary to 'break' (therefore hang the callback thread) if the library receives a packet type it does not recognise - should it rather just throw a warning (or something else more 'thread safe')? In the following section of code in base.py:
def run(self): """ run: None -> None
This method overrides threading.Thread.run() and is automatically
called when an instance is created with threading enabled.
"""
while True:
try:
self._callback(self.wait_read_frame())
except ThreadQuitException:
# Expected termintation of thread due to self.halt()
break
except Exception as e:
# Unexpected thread quit.
if self._error_callback:
self._error_callback(e)
# break <---- is this necessary / appropriate?
Also see blog post here: http://axotron.se/blog/problems-with-python-xbee-2-2-3-package/
Jim
Closing this PR as superseded by PR #16
Adds support for API Route Record Indicator packets (Type a1). Solves issue #14. Currently if a Route Record Indicator packet is received by an XBee then the Python XBee library would crash with error: "Unrecognized response packet with id byte \xa1"
Adding packet type to dictionary.