3 #GoodFET MAXIM MAX3421 Host
12 from GoodFETMAXUSB import GoodFETMAXUSBHost;
15 """The libraries upon which this program depends will soon be deprecated in
16 favor of the USB*.py libraries. The new libraries do not yet support host
17 mode, but an example will be written and documented when they do."""
21 print "Usage: %s verb [objects]\n" % sys.argv[0];
22 print "%s info" % sys.argv[0];
23 print "%s allstrings" % sys.argv[0];
27 #Initialize FET and set baud rate
28 client=GoodFETMAXUSBHost();
35 client.usbverbose=False;
37 if(sys.argv[1]=="info"):
40 if(sys.argv[1]=="allstrings"):
41 print "This will try to print all strings from the target device.";
42 client.detect_device();
44 client.enumerate_device();
45 for foo in range(1,255):
46 print "Grabbing string at index=%i" % foo;
47 string=client.getDescriptorString(foo);
49 print "Strings[%i]=%s" % (foo,string);