fix(protocol): adjust waveform download to use full_waveform for accurate event streaming

This commit is contained in:
2026-04-23 13:02:55 -04:00
parent ec6362cb8e
commit 84c87d0b57
+7 -7
View File
@@ -885,13 +885,13 @@ def device_event_blastware_file(
def _do(): def _do():
with _build_client(port, baud, host, tcp_port, timeout=120.0) as client: with _build_client(port, baud, host, tcp_port, timeout=120.0) as client:
info = client.connect() info = client.connect()
# Use full_waveform=False (metadata-only, stop_after_metadata=True) — # Use full_waveform=True (stop_after_metadata=False) so the device
# Blastware writes waveform files from only the first ~8 A5 frames, NOT # signals its own end-of-stream rather than us stopping at "Project:".
# the full bulk download. Using full_waveform=True produces a file # BW downloads until natural end-of-stream for each event — for this
# ~8x larger than Blastware's because it includes all post-event # 5-chunk event that gives the correct body + footer. For events with
# silence chunks. The metadata-only a5_frames (with terminator) are # many silence chunks (35+) the file will be larger than BW's, but
# sufficient for byte-perfect write_blastware_file output. # correctness takes priority over size matching for now.
events = client.get_events(full_waveform=False, stop_after_index=index) events = client.get_events(full_waveform=True, stop_after_index=index)
matching = [ev for ev in events if ev.index == index] matching = [ev for ev in events if ev.index == index]
return matching[0] if matching else None, info return matching[0] if matching else None, info
ev, info = _run_with_retry(_do, is_tcp=_is_tcp(host)) ev, info = _run_with_retry(_do, is_tcp=_is_tcp(host))