harp00 / python-xbee

Automatically exported from code.google.com/p/python-xbee
MIT License
0 stars 0 forks source link

Implement threading support #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be nice if the XBee module allowed one to set a callback function 
which would be called from a separate thread whenever a new packet arrived.

Example:

def callback(data):
    print data

# By providing a callback, a new thread would be spawned which
# would listen for data and call the given function
xbee = XBee(ser, callback=callback)

Original issue reported on code.google.com by pmalms...@gmail.com on 6 Jul 2010 at 3:29

GoogleCodeExporter commented 8 years ago
This has been implemented as of version 1.8.0

Note: Be sure to call xbee.halt() before closing its associated serial port. 
Otherwise, serial port errors may result due to being accessed in an improper 
state.

Original comment by pmalms...@gmail.com on 9 Jul 2010 at 5:05