fix panda serial write

This commit is contained in:
George Hotz
2018-01-19 11:04:21 -08:00
parent af74aa9f5a
commit 21f8195d4e

View File

@@ -425,7 +425,10 @@ class Panda(object):
return b''.join(ret)
def serial_write(self, port_number, ln):
return self._handle.bulkWrite(2, struct.pack("B", port_number) + ln)
ret = 0
for i in range(0, len(ln), 0x20):
ret += self._handle.bulkWrite(2, struct.pack("B", port_number) + ln[i:i+0x20])
return ret
def serial_clear(self, port_number):
"""Clears all messages (tx and rx) from the specified internal uart