mirror of
https://github.com/bkerler/mtkclient.git
synced 2024-11-14 19:25:05 -05:00
Update usblib.py
This commit is contained in:
parent
d1ca2d6554
commit
6127b1ecb4
1 changed files with 3 additions and 3 deletions
|
@ -424,15 +424,16 @@ class usb_class(DeviceClass):
|
|||
wMaxPacketSize = self.EP_IN.wMaxPacketSize
|
||||
extend = res.extend
|
||||
buffer = None
|
||||
buflen=min(resplen,wMaxPacketSize)
|
||||
if self.fast:
|
||||
buffer = self.buffer[:resplen]
|
||||
buffer = self.buffer[:buflen]
|
||||
while len(res) < resplen:
|
||||
try:
|
||||
if self.fast:
|
||||
rlen = epr(buffer, timeout)
|
||||
extend(buffer[:rlen])
|
||||
else:
|
||||
extend(epr(resplen))
|
||||
extend(epr(buflen))
|
||||
except usb.core.USBError as e:
|
||||
error = str(e.strerror)
|
||||
if "timed out" in error:
|
||||
|
@ -454,7 +455,6 @@ class usb_class(DeviceClass):
|
|||
self.verify_data(res[:resplen], "RX:")
|
||||
return res[:resplen]
|
||||
|
||||
|
||||
def usbxmlread(self, maxtimeout=100):
|
||||
res = bytearray()
|
||||
timeout = 0
|
||||
|
|
Loading…
Reference in a new issue