new maxusb library
[goodfet] / client / goodfet.maxusbhost
index 4cfaece..feba1e1 100755 (executable)
@@ -7,9 +7,16 @@ import sys;
 import binascii;
 import array;
 import time;
+import warnings
 
 from GoodFETMAXUSB import GoodFETMAXUSBHost;
 
+warnings.warn(
+"""The libraries upon which this program depends will soon be deprecated in
+favor of the USB*.py libraries.  The new libraries do not yet support host
+mode, but an example will be written and documented when they do."""
+)
+
 if(len(sys.argv)==1):
     print "Usage: %s verb [objects]\n" % sys.argv[0];
     print "%s info" % sys.argv[0];
@@ -25,6 +32,7 @@ client.serInit()
 client.MAXUSBsetup();
 
 client.hostinit();
+client.usbverbose=False;
 
 if(sys.argv[1]=="info"):
     client.hostrun();
@@ -34,8 +42,9 @@ if(sys.argv[1]=="allstrings"):
     client.detect_device();
     time.sleep(0.2);
     client.enumerate_device();
-    for foo in range(1,40):
+    for foo in range(1,255):
         print "Grabbing string at index=%i" % foo;
         string=client.getDescriptorString(foo);
-        print "Strings[%i]=%s" % (foo,string);
+        if string!=None:
+            print "Strings[%i]=%s" % (foo,string);
         sys.stdout.flush();