further digging and basic emulator
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user