From: Romain A. <r.a...@gm...> - 2010-01-22 09:34:50
|
Hi, there's a mistake in the 1.0 API doc, Under the "let's get it started" chapter: the 16th line is ep = uti.find_descriptor( and should be ep = ep = usb.util.find_descriptor( ---------------------------------------------- import usb.core import usb.util # find our device dev = usb.core.find(idVendor=0xfffe, idProduct=0x0001) # was it found? if dev is None: raise ValueError('Device not found') # set the active configuration. With no arguments, the first # configuration will be the active one dev.set_configuration() # get an endpoint instance ep = uti.find_descriptor( dev.get_interface_altsetting(), # first interface # match the first OUT endpoint custom_match = \ lambda e: \ usb.util.endpoint_direction(e.bEndpointAddress) == \ usb.util.ENDPOINT_OUT ) assert ep is not None # write the data ep.write('test') ---------------------------------------------- Cheers, Romain |