From 736c2cbf7b3abfe4008c45c26b0f40168fd1c504 Mon Sep 17 00:00:00 2001 From: Robbe Date: Mon, 7 Oct 2019 14:26:44 -0700 Subject: [PATCH] Fixed sending of bytes over PandaSerial --- python/serial.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/serial.py b/python/serial.py index 0e1a3de..72ab3de 100644 --- a/python/serial.py +++ b/python/serial.py @@ -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, str.encode(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