Revert "fix: improve metadata frame detection and update version to v0.12.1"
This reverts commit ad7b064b67.
This commit is contained in:
@@ -125,20 +125,6 @@ _BULK_COUNTER_STEP = 0x0400 # chunk counter increment per chunk ✅
|
||||
# protocol requirement. Confirmed 2026-04-06: 0x0400 for chunk 1 works; 0x1004
|
||||
# causes a 120-second device timeout. Formula n * 0x0400 is used for all chunks.
|
||||
|
||||
# Needles for identifying the 5A metadata frame.
|
||||
# Devices with no Project/Client/etc. configured omit those label strings,
|
||||
# so b"Geo: " (geo threshold — always present) is the universal fallback.
|
||||
# Mirror of _METADATA_FRAME_NEEDLES in client.py; kept here for the
|
||||
# stop_after_metadata check in read_bulk_waveform_stream.
|
||||
_METADATA_FRAME_NEEDLES: tuple[bytes, ...] = (
|
||||
b"Project:",
|
||||
b"Client:",
|
||||
b"User Name:",
|
||||
b"Seis Loc:",
|
||||
b"Extended Notes",
|
||||
b"Geo: ",
|
||||
)
|
||||
|
||||
# Default timeout values (seconds).
|
||||
# MiniMate Plus is a slow device — keep these generous.
|
||||
DEFAULT_RECV_TIMEOUT = 10.0
|
||||
@@ -631,13 +617,9 @@ class MiniMateProtocol:
|
||||
break
|
||||
raise
|
||||
|
||||
# Detect metadata frame using the same multi-needle set used by
|
||||
# _decode_a5_waveform. Devices with no Project/Client/etc.
|
||||
# configured omit those label strings; b"Geo: " is the fallback.
|
||||
_is_metadata = any(n in rsp.data for n in _METADATA_FRAME_NEEDLES)
|
||||
log.warning(
|
||||
"5A RX chunk=%d page_key=0x%04X data_len=%d is_metadata=%s",
|
||||
chunk_num, rsp.page_key, len(rsp.data), _is_metadata,
|
||||
"5A RX chunk=%d page_key=0x%04X data_len=%d contains_Project=%s",
|
||||
chunk_num, rsp.page_key, len(rsp.data), b"Project:" in rsp.data,
|
||||
)
|
||||
|
||||
if rsp.page_key == 0x0000:
|
||||
@@ -647,7 +629,7 @@ class MiniMateProtocol:
|
||||
|
||||
frames_data.append(rsp.data)
|
||||
|
||||
if stop_after_metadata and _is_metadata:
|
||||
if stop_after_metadata and b"Project:" in rsp.data:
|
||||
log.debug("5A A5[%d] metadata found — stopping early", chunk_num)
|
||||
break
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user