+
+ def setup2str(self,SUD):
+ """Converts the header of a setup packet to a string."""
+ return "bmRequestType=0x%02x, bRequest=0x%02x, wValue=0x%04x, wIndex=0x%04x, wLength=0x%04x" % (
+ ord(SUD[0]), ord(SUD[1]),
+ ord(SUD[2])+(ord(SUD[3])<<8),
+ ord(SUD[4])+(ord(SUD[5])<<8),
+ ord(SUD[6])+(ord(SUD[7])<<8)
+ );
+