Skip to content

Commit

Permalink
support tx flow control for chunked messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjhogan committed Oct 15, 2019
1 parent b1c3712 commit 932745f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/uds.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def _isotp_thread(self, debug):
self.panda.can_clear(self.bus)
# clear rx buffer
self.panda.can_clear(0xFFFF)
time.sleep(1)

while True:
messages = self.panda.can_recv()
for rx_addr, rx_ts, rx_data, rx_bus in messages:
Expand Down Expand Up @@ -349,7 +349,8 @@ def _isotp_thread(self, debug):
self.panda.can_send(self.tx_addr, msg, self.bus)
if delay_ts > 0:
time.sleep(delay_ts / delay_div)
tx_frame["done"] = True
if end >= tx_frame["size"]:
tx_frame["done"] = True

if not self.tx_queue.empty():
req = self.tx_queue.get(block=False)
Expand Down

0 comments on commit 932745f

Please sign in to comment.