From: travisutk Date: Sat, 25 Aug 2012 19:35:56 +0000 (+0000) Subject: Fixed all the bugs that crept into Facedancer HID emulation. X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=074e3d443c3d008cb9b1be3c30034b7e1774c574 Fixed all the bugs that crept into Facedancer HID emulation. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1240 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/client/GoodFETMAXUSB.py b/client/GoodFETMAXUSB.py index 00c2e0f..d38bfa7 100644 --- a/client/GoodFETMAXUSB.py +++ b/client/GoodFETMAXUSB.py @@ -611,13 +611,19 @@ class GoodFETMAXUSBDevice(GoodFETMAXUSB): elif desctype==GD_STRING: desclen=ord(self.strDesc[ord(SUD[wValueL])][0]); ddata=self.strDesc[ord(SUD[wValueL])]; - + elif desctype==GD_HID: + #Don't know how to do this yet. + pass; + elif desctype==GD_REPORT: + desclen=self.CD[25]; + ddata=self.RepD; #TODO Configuration, String, Hid, and Report if desclen>0: - sendlen=min(reqlen,desclen); - self.writebytes(rEP0FIFO,ddata); - #self.wregAS(rEP0BC,sendlen); + #Reduce desclen if asked for fewer bytes. + desclen=min(reqlen,desclen); + #Send those bytes. + self.writebytes(rEP0FIFO,ddata[0:desclen]); self.wregAS(rEP0BC,desclen); else: print "Stalling in send_descriptor() for lack of handler for %02x." % desctype;