X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFET.py;h=583f1b12bb6149421d524af2d994448a847194a1;hp=a2f316091481ccf000ea168ea24c76827313d22b;hb=e12a1ab7338cb974193113dce8c2413c0fd1bc78;hpb=ac805b54c0afd67a51949367b311a855b4aacf90 diff --git a/client/GoodFET.py b/client/GoodFET.py index a2f3160..583f1b1 100755 --- a/client/GoodFET.py +++ b/client/GoodFET.py @@ -8,6 +8,8 @@ import sys, time, string, cStringIO, struct, glob, serial, os; import sqlite3; +fmt = ("B", ">16)&0xFF]); @@ -159,10 +164,12 @@ class GoodFET: print "Rx: ( 0x%02x, 0x%02x, 0x%04x )" % ( self.app, self.verb, self.count ) #Debugging string; print, but wait. - if self.app==0xFF and self.verb==0xFF: - print "# DEBUG %s" % self.serialport.read(self.count); + if self.app==0xFF: + if self.verb==0xFF: + 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] sys.stdout.flush(); - return [] else: self.data=self.serialport.read(self.count); return self.data;