def scan(self): print("Welcome. This will help you to scan for alienfx-controllers and their lightning zones.") afxcontroldevs=AlienFXProber.find_controllers(self.vendorid) # Get a list of all usb-devices with the given vendor-id for controller in afxcontroldevs: # Perform zone scanning for each controller found... zone = 1 # initial zone from which we start iterating vendorstring = "0x" + format(controller.idVendor, '04x') devicestring = "0x" + format(controller.idProduct, '04x') print("Found device \""+vendorstring + " / " + devicestring + "\". - Testing zones...") while zone <= self.maxzone: # Iterate all possible zone codes (have a look at reverse-engineering-knowledgebase.txt for possible codes...) print("Testing zone \"0x"+format(zone, '04x')+"\"") if self.scanzone(zone, "new", controller.idVendor, controller.idProduct): # Zone found print("Zone found :)") # Ask user for a name, store name and zonecode zonename = self.askzonename() self.zonesfound[zonename] = zone # Store name an zone code in Dictionary zone = zone*2 print("") print("These are your " + str(len(self.zonesfound.items())) + " zonecodes for the current controller (\"VID: "+vendorstring + " / DEV: " + devicestring + "\"):") for z in self.zonesfound.items(): print(z[0]+": 0x"+format(z[1], '04x')) # Print out each zone found print("") print("Current controller finished.") print("All controllers done. I hope i was helpful.")
def scan(self): print("Welcome. This will help you to scan for alienfx-controllers and their lightning zones.") afxcontroldevs=AlienFXProber.find_controllers(self.vendorid) # Get a list of all usb-devices with the given vendor-id for controller in afxcontroldevs: # Perform zone scanning for each controller found... zone = 1 # initial zone from which we start iterating vendorstring = "0x" + format(controller.idVendor, '04x') devicestring = "0x" + format(controller.idProduct, '04x') print("Found device \""+vendorstring + " / " + devicestring + "\". ") if self.askuser("Would you like to test a newer controller? Default=Y\r\n" "Note that choosing a wrong controller will result in packet-errors.\r\n" "In this case you might choose another one instead."): crev=2 # newer controller revision else: crev=1 # old controller revision print("- Testing zones...") while zone <= self.maxzone: # Iterate all possible zone codes (have a look at reverse-engineering-knowledgebase.txt for possible codes...) print("Testing zone \"0x"+format(zone, '04x')+"\"") if self.scanzone(zone, crev, controller.idVendor, controller.idProduct): # Zone found print("Zone found :)") # Ask user for a name, store name and zonecode zonename = self.askzonename() self.zonesfound[zonename] = zone # Store name an zone code in Dictionary zone = zone*2 print("") print("These are your " + str(len(self.zonesfound.items())) + " zonecodes for the current controller (\"VID: "+vendorstring + " / DEV: " + devicestring + "\"):") for z in self.zonesfound.items(): print(z[0]+": 0x"+format(z[1], '04x')) # Print out each zone found print("") print("Current controller finished.") print("All controllers done. I hope i was helpful.")
def scan(self): print( "Welcome. This will help you to scan for alienfx-controllers and their lightning zones." ) afxcontroldevs = AlienFXProber.find_controllers( self.vendorid ) # Get a list of all usb-devices with the given vendor-id for controller in afxcontroldevs: # Perform zone scanning for each controller found... zone = 1 # initial zone from which we start iterating vendorstring = "0x" + format(controller.idVendor, '04x') devicestring = "0x" + format(controller.idProduct, '04x') print("Found device \"" + vendorstring + " / " + devicestring + "\". - Testing zones...") while zone <= self.maxzone: # Iterate all possible zone codes (have a look at reverse-engineering-knowledgebase.txt for possible codes...) print("Testing zone \"0x" + format(zone, '04x') + "\"") if self.scanzone(zone, "new", controller.idVendor, controller.idProduct): # Zone found print("Zone found :)") # Ask user for a name, store name and zonecode zonename = self.askzonename() self.zonesfound[ zonename] = zone # Store name an zone code in Dictionary zone = zone * 2 print("These are your zonecodes for current controller (\"" + vendorstring + " / " + devicestring + "\"):") for z in self.zonesfound.items(): print(z[0] + ": 0x" + format(z[1], '04x')) # Print out each zone found print("") print("Current controller finished.") print("All controllers done. I hope i was helpful.")