prefix = "/dev/tty." # Not tested else: print ("Your OS ('{}') is not supported, sorry!".format(os.name)) exit(1) # This is done before any other action on Motelist, # to ensure that motelist is empty on manual scan, because # if there are already registred mote on that port, # motelist will ignore it. ports = manualyScanForMotes(prefix) readKey() # This actually updates motelist with all connected motes, # but found motes are not overwriten, because they already exist in the list. print "Printing motelist with manualy found motes\n" Motelist.printMotelist() readKey() # Clear stored motelist, to automatically detect conected motes. print "\nClearing motelist from manually found motes." Motelist.motes = list() readKey() # Automatically detect and print all connected motes. print "\nRunning automatic mote detection and printing motelist\n" Motelist.printMotelist() readKey() # Try to manually add previously found motes, should fail! print "\nTrying to add back previously manualy found motes(this should FAIL)" for port in ports:
prefix = "/dev/tty." # Not tested else: print("Your OS ('{}') is not supported, sorry!".format(os.name)) exit(1) # This is done before any other action on Motelist, # to ensure that motelist is empty on manual scan, because # if there are already registred mote on that port, # motelist will ignore it. ports = manualyScanForMotes(prefix) readKey() # This actually updates motelist with all connected motes, # but found motes are not overwriten, because they already exist in the list. print "Printing motelist with manualy found motes\n" Motelist.printMotelist() readKey() # Clear stored motelist, to automatically detect conected motes. print "\nClearing motelist from manually found motes." Motelist.motes = list() readKey() # Automatically detect and print all connected motes. print "\nRunning automatic mote detection and printing motelist\n" Motelist.printMotelist() readKey() # Try to manually add previously found motes, should fail! print "\nTrying to add back previously manualy found motes(this should FAIL)" for port in ports: