1
0

further digging and basic emulator

This commit is contained in:
Aiden
2026-05-25 17:42:58 +10:00
parent 07f48c76e0
commit b264037e82
11 changed files with 1628 additions and 3 deletions

View File

@@ -18,8 +18,8 @@ CHECKSUM_SEED = getattr(_protocol_trace, "CHECKSUM_SEED", 0x5A)
FRAME_LENGTH = getattr(_protocol_trace, "FRAME_LENGTH", 6)
CAPTURE_LINE_RE = re.compile(
r"^\s*(?P<time>\d{1,2}:\d{2}:\d{2}(?:\.\d{1,6})?)\s+"
r"(?P<direction>RX|TX)\s+"
r"(?P<count>\d+)\s+bytes?\s+"
r"(?P<direction>RX|TX|FRAME)\s+"
r"(?P<count>\d+)(?:\s+bytes?)?\s+"
r"(?P<byte_text>.*?)\s*$",
re.IGNORECASE,
)
@@ -80,7 +80,8 @@ def parse_capture_text(text: str) -> list[CaptureChunk]:
if not match:
continue
byte_values = tuple(int(token, 16) for token in HEX_BYTE_RE.findall(match.group("byte_text")))
analyzer_direction = match.group("direction").lower()
raw_direction = match.group("direction").lower()
analyzer_direction = "rx" if raw_direction == "frame" else raw_direction
chunks.append(
CaptureChunk(
chunk_index=len(chunks),