mirror of https://github.com/commaai/panda.git
zero pad messages before sending
This commit is contained in:
parent
1ddc9735d1
commit
01ef1fae36
|
@ -134,6 +134,7 @@ def _isotp_thread(panda, bus, tx_addr, tx_queue, rx_queue):
|
||||||
req = tx_queue.get(block=False)
|
req = tx_queue.get(block=False)
|
||||||
# reset rx rx_frame
|
# reset rx rx_frame
|
||||||
rx_frame = {"size": 0, "data": "", "sent": True}
|
rx_frame = {"size": 0, "data": "", "sent": True}
|
||||||
|
req = req.ljust(8, "\x00")
|
||||||
if (DEBUG): print "S:", hex(tx_addr), req.encode("hex")
|
if (DEBUG): print "S:", hex(tx_addr), req.encode("hex")
|
||||||
panda.can_send(tx_addr, req, bus)
|
panda.can_send(tx_addr, req, bus)
|
||||||
else:
|
else:
|
||||||
|
@ -643,7 +644,7 @@ if __name__ == "__main__":
|
||||||
from python import Panda
|
from python import Panda
|
||||||
panda = Panda()
|
panda = Panda()
|
||||||
bus = 0
|
bus = 0
|
||||||
tx_addr = 0x18daf130 # EPS
|
tx_addr = 0x18da30f1 # EPS
|
||||||
tx_queue = Queue()
|
tx_queue = Queue()
|
||||||
rx_queue = Queue()
|
rx_queue = Queue()
|
||||||
can_reader_t = threading.Thread(target=_isotp_thread, args=(panda, bus, tx_addr, tx_queue, rx_queue))
|
can_reader_t = threading.Thread(target=_isotp_thread, args=(panda, bus, tx_addr, tx_queue, rx_queue))
|
||||||
|
|
Loading…
Reference in New Issue