Skip to content

Commit

Permalink
fix panda serial write
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Jan 19, 2018
1 parent af74aa9 commit 21f8195
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,10 @@ def serial_read(self, port_number):
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
Expand Down

0 comments on commit 21f8195

Please sign in to comment.