from scanwin32 import winScan;
scan=winScan();
for order,comport,desc,hwid in sorted(scan.comports()):
- if hwid.index('FTDI')==0:
- port=comport;
- #print "Using FTDI port %s" % port
-
+ try:
+ if hwid.index('FTDI')==0:
+ port=comport;
+ #print "Using FTDI port %s" % port
+ except:
+ #Do nothing.
+ a=1;
self.serialport = serial.Serial(
port,
print "# DEBUG %s" % self.serialport.read(self.count)
elif self.verb==0xFE:
print "# DEBUG 0x%x" % struct.unpack(fmt[self.count-1], self.serialport.read(self.count))[0]
+ elif self.verb==0xFD:
+ #Do nothing, just wait so there's no timeout.
+ print "# NOP.";
+
sys.stdout.flush();
else:
self.data=self.serialport.read(self.count);