update 0.1.9

This commit is contained in:
controllerzz
2026-06-17 20:44:18 +03:00
parent 32163c0001
commit 99451aceb8
12 changed files with 814 additions and 275 deletions
+9 -3
View File
@@ -28,6 +28,7 @@ class IsoTpChannel:
st_min_ms: int = 0
fc_timeout: float = 1.0
cf_timeout: float = 1.0
tx_gap_s = 0.001
async def send_pdu(self, data: bytes) -> None:
length = len(data)
@@ -88,7 +89,6 @@ class IsoTpChannel:
raise RuntimeError(f"ISO-TP: unsupported FlowStatus=0x{fs:02X}")
if bs == 0x00:
# 0 => "unlimited"
bs = 0
st_min = _st_min_to_seconds(st_min_raw)
@@ -139,14 +139,17 @@ class IsoTpChannel:
await self.can.send(msg)
seq_num = (seq_num + 1) & 0x0F
if seq_num == 0:
seq_num = 0x1
# if seq_num == 0:
# seq_num = 0x1
frames_in_block += 1
if st_min > 0:
await asyncio.sleep(st_min)
if self.tx_gap_s > 0:
await asyncio.sleep(self.tx_gap_s)
async def recv_pdu(self, timeout: float = 1.0) -> Optional[bytes]:
first = await self.can.recv(timeout=timeout)
@@ -221,6 +224,9 @@ class IsoTpChannel:
if st_min > 0:
await asyncio.sleep(st_min)
if tx_gap_s > 0:
await asyncio.sleep(tx_gap_s)
return bytes(payload[:total_length])