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

IsoTpMessage: param for single frame flow control #1079

Merged
merged 7 commits into from
Oct 5, 2022
Merged
Changes from 1 commit
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
8 changes: 6 additions & 2 deletions python/uds.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ def _isotp_rx_next(self, rx_data: bytes) -> None:
print(f"ISO-TP: RX - first frame - {hex(self._can_client.rx_addr)} idx={self.rx_idx} done={self.rx_done}")
if self.debug:
print(f"ISO-TP: TX - flow control continue - {hex(self._can_client.tx_addr)}")
# send flow control message (send all bytes) with a separation time of 10 ms
msg = b"\x30\x00\x0a".ljust(self.max_len, b"\x00")
# send flow control message (send one frame at a time)
msg = b"\x30\x01\x00".ljust(self.max_len, b"\x00")
self._can_client.send([msg])
return

Expand All @@ -472,6 +472,10 @@ def _isotp_rx_next(self, rx_data: bytes) -> None:
self.rx_dat += rx_data[1:1 + rx_size]
if self.rx_len == len(self.rx_dat):
self.rx_done = True
else:
# notify ECU to send next frame
msg = b"\x30\x01\x00".ljust(self.max_len, b"\x00")
self._can_client.send([msg])
if self.debug:
print(f"ISO-TP: RX - consecutive frame - {hex(self._can_client.rx_addr)} idx={self.rx_idx} done={self.rx_done}")
return
Expand Down