in example read from xbee devices is:
device = XBeeDevice(PORT, BAUD_RATE)
try:
device.open()
def data_receive_callback(xbee_message):
print("From %s >> %s" % (xbee_message.remote_device.get_64bit_addr(),
xbee_message.data.decode()))
device.add_data_received_callback(data_receive_callback)
print("Waiting for data...\n")
input()
finally:
if device is not None and device.is_open():
device.close()
finally:
if device is not None and device.is_open():
device.close()
I need to run this in a separate thread, what to use instead of input ()?