Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iso-tp: return if updated #1610

Merged
merged 1 commit into from
Aug 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions python/uds.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,18 @@ def recv(self, timeout=None) -> Tuple[Optional[bytes], bool]:
timeout = self.timeout

start_time = time.monotonic()
rx_in_progress = False
updated = False
try:
while True:
for msg in self._can_client.recv():
frame_type = self._isotp_rx_next(msg)
self._isotp_rx_next(msg)
start_time = time.monotonic()
rx_in_progress = frame_type == ISOTP_FRAME_TYPE.CONSECUTIVE
updated = True
if self.tx_done and self.rx_done:
return self.rx_dat, False
return self.rx_dat, updated
# no timeout indicates non-blocking
if timeout == 0:
return None, rx_in_progress
return None, updated
if time.monotonic() - start_time > timeout:
raise MessageTimeoutError("timeout waiting for response")
finally:
Expand Down
Loading