Skip to content

Commit

Permalink
Fixed sending of bytes over PandaSerial
Browse files Browse the repository at this point in the history
  • Loading branch information
robbederks committed Oct 7, 2019
1 parent 0894b28 commit 736c2cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def read(self, l=1):
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
Expand Down

0 comments on commit 736c2cb

Please sign in to comment.