I am currently writing a program to interact with my XBee3. I am following the XBee Python library documentation and have a good application up and running so far. I have however come across one problem. I get the following error:
xnet.set_discovery_options({DiscoveryOptions.APPEND_DD, DiscoveryOptions.APPEND_RSSI})
NameError: name ‘DiscoveryOptions’ is not defined
I can scan the network successfully without this line but for some reason I can’t add the discovery option information. Any ideas?
Here is my code block:
def scanner(d):
xnet = d.get_network()
#xnet.set_discovery_options({DiscoveryOptions.APPEND_DD, DiscoveryOptions.APPEND_RSSI})
xnet.set_discovery_timeout(25.5)
xnet.start_discovery_process()
while xnet.is_discovery_running():
time.sleep(30)
# Get a list of the devices added to the network.
device_list = xnet.get_devices()
print(device_list)