mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
Fix bulk transfer dropping messages sometimes (#729)
* fix max messages per bulk transfer * retry on partial send * need 2x the packet size for some reason * improve bulk write test
This commit is contained in:
@@ -533,7 +533,13 @@ class Panda(object):
|
||||
for s in snds:
|
||||
self._handle.bulkWrite(3, s)
|
||||
else:
|
||||
self._handle.bulkWrite(3, b''.join(snds), timeout=timeout)
|
||||
dat = b''.join(snds)
|
||||
while True:
|
||||
bs = self._handle.bulkWrite(3, dat, timeout=timeout)
|
||||
dat = dat[bs:]
|
||||
if len(dat) == 0:
|
||||
break
|
||||
print("CAN: PARTIAL SEND MANY, RETRYING")
|
||||
break
|
||||
except (usb1.USBErrorIO, usb1.USBErrorOverflow):
|
||||
print("CAN: BAD SEND MANY, RETRYING")
|
||||
|
||||
Reference in New Issue
Block a user