fix: remove special case chunk counter, all chunks use chunk_num * 0x0400
This commit is contained in:
@@ -508,11 +508,13 @@ class MiniMateProtocol:
|
||||
log.debug("5A A5[0] page_key=0x%04X %d bytes", rsp.page_key, len(rsp.data))
|
||||
|
||||
# ── Step 2: chunk loop ───────────────────────────────────────────────
|
||||
# Chunk 1 uses a fixed counter of 0x1004, confirmed from 4-2-26 BW TX capture.
|
||||
# Chunks 2+ use n * 0x0400. Device silently ignores frames with wrong counter.
|
||||
_CHUNK1_COUNTER = 0x1004
|
||||
# Chunk counters are monotonic: chunk_num * 0x0400 for all chunks.
|
||||
# The 4-2-26 BW TX capture showed 0x1004 for chunk 1, but this is a
|
||||
# Blastware artifact — the device accepts any counter value and streams
|
||||
# data regardless. Empirically confirmed 2026-04-06: 0x0400 for chunk 1
|
||||
# works; 0x1004 causes the device to ignore the frame (timeout).
|
||||
for chunk_num in range(1, max_chunks + 1):
|
||||
counter = _CHUNK1_COUNTER if chunk_num == 1 else chunk_num * _BULK_COUNTER_STEP
|
||||
counter = chunk_num * _BULK_COUNTER_STEP
|
||||
params = bulk_waveform_params(key4, counter)
|
||||
log.debug("5A chunk %d counter=0x%04X", chunk_num, counter)
|
||||
self._send(build_5a_frame(_BULK_CHUNK_OFFSET, params))
|
||||
|
||||
Reference in New Issue
Block a user