mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-09-08 09:13:42 +08:00
Merge panda subtree
old-commit-hash: f2de9784f84aff39f03d8e090fc6f8ffbef21f34
This commit is contained in:
@@ -5,7 +5,7 @@ class PandaSerial(object):
|
||||
self.port = port
|
||||
self.panda.set_uart_parity(self.port, 0)
|
||||
self.panda.set_uart_baud(self.port, baud)
|
||||
self.buf = ""
|
||||
self.buf = b""
|
||||
|
||||
def read(self, l=1):
|
||||
tt = self.panda.serial_read(self.port)
|
||||
@@ -19,7 +19,10 @@ class PandaSerial(object):
|
||||
def write(self, dat):
|
||||
#print "W: ", dat.encode("hex")
|
||||
#print ' pigeon_send("' + ''.join(map(lambda x: "\\x%02X" % ord(x), dat)) + '");'
|
||||
return self.panda.serial_write(self.port, dat)
|
||||
if(isinstance(dat, bytes)):
|
||||
return self.panda.serial_write(self.port, dat)
|
||||
else:
|
||||
return self.panda.serial_write(self.port, str.encode(dat))
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user