From 932745f62b4f1a8e92079d128786f3a106c262ac Mon Sep 17 00:00:00 2001 From: Greg Hogan Date: Thu, 20 Dec 2018 11:10:31 -0800 Subject: [PATCH] support tx flow control for chunked messages --- python/uds.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/uds.py b/python/uds.py index 647ba82..9f0a8ae 100644 --- a/python/uds.py +++ b/python/uds.py @@ -293,7 +293,7 @@ class UdsClient(): 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: @@ -349,7 +349,8 @@ class UdsClient(): 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)