fix: add new helper (_recv_5a_batch()) that helps with assembling chunks over TCP

This commit is contained in:
2026-04-27 18:39:34 -04:00
parent a7585cb5e0
commit f5c81f2cab
4 changed files with 148 additions and 97 deletions
+7 -10
View File
@@ -886,17 +886,14 @@ def device_event_blastware_file(
with _build_client(port, baud, host, tcp_port, timeout=120.0) as client:
info = client.connect()
# Use stop_after_metadata=True (full_waveform=False) with 1 extra
# chunk after "Project:". The extra chunk is required to prime the
# device over TCP: termination at term_counter=metadata_counter+0x0400
# returns only ~90 bytes (no useful footer) over TCP/cellular, but
# termination at metadata_counter+0x0800 (one chunk later) returns
# the full 737-byte frame containing the footer.
# chunk after "Project:". The extra chunk primes the device so that
# the termination response carries the full waveform footer bytes.
# Without it the terminator returns only ~90 bytes (no useful footer).
#
# Confirmed from 4-26-26 BW RS-232 capture: BW terminates at 0x1800
# without an extra chunk (works on RS-232 but not TCP).
# write_blastware_file() automatically skips the extra chunk's
# contribution — only the probe+ADC+metadata+terminator bytes appear
# in the output file.
# The extra chunk's ADC data IS part of the Blastware file body —
# confirmed from 4-27-26 TCP capture: all 14 A5 frames (including the
# extra chunk's 2 TCP sub-frames) contribute to the correct 6864-byte
# output. write_blastware_file() includes all frames unconditionally.
#
# full_waveform=True (natural end-of-stream) downloads ALL chunks
# including post-event silence (35+ chunks for a 9-sec event at