X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFET.py;h=518cf47cc89385eb549ee64e15142a8afebdb433;hp=468b0915dd22020bd77971327000269005d6b6fb;hb=64ef261d7416ef8cb3ec6cdf7130fc4d8afad8cd;hpb=dbcedaa279472080a2585e959a3146f3c5859556 diff --git a/client/GoodFET.py b/client/GoodFET.py index 468b091..518cf47 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]); @@ -158,10 +161,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;