"""Walk blocks of the new 5-11-26 events and look at what comes after Tran block.""" import sys sys.path.insert(0, ".") from minimateplus.waveform_codec import walk_body, find_data_start def main(): for stem in ("M529LL1A.SP0", "M529LL1A.SS0", "M529LL1A.SV0"): with open(f"tests/fixtures/5-11-26/{stem}", "rb") as f: raw = f.read() body = raw[43:-26] start = find_data_start(body) blocks = walk_body(body, start) print(f"\n=== {stem} === body={len(body)} start={start} blocks walked={len(blocks)}") for i, b in enumerate(blocks[:20]): print(f" block[{i:>2}] @ {b.offset:>5} tag={b.tag_hi:02x} NN=0x{b.tag_lo:02x}({b.tag_lo}) len={b.length} data[:24]={b.data[:24].hex(' ')}") if __name__ == "__main__": main()