forked from arti/vt1200
plan: task 2 must pass the strip payload into the CRC
This commit is contained in:
1 parent
11375a1323
commit
4122ebe616
1 file changed
+3
-1
@@ -138,6 +138,8 @@ def test_strip_frame_round_trips_through_the_header():
|
||||
assert head["kind"] == 1 and head["rows"] == 8 and head["stretch"] == 128
|
||||
assert head["payload_len"] == 8 * 160
|
||||
assert b"".join(pkts)[16:] == rows
|
||||
from harness.udpstream.frame import unpack_header as _u
|
||||
assert _u(pkts[0][:16], b"".join(pkts)[16:])["crc_ok"] is True
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Run test to verify it fails**
|
||||
@@ -147,7 +149,7 @@ Expected: FAIL — no module `vidsrc`
|
||||
|
||||
- [ ] **Step 3: Implement `Rows.pack_row` and `StripSource`**
|
||||
|
||||
`pack_row` sets bit `i` of the byte stream for pixel `i` (MSB first within each byte). `StripSource.encode` prepends `pack_header(KIND_STRIP, frame_no, len(rows), rows, stretch)` and chunks the result at 1450 bytes.
|
||||
`pack_row` sets bit `i` of the byte stream for pixel `i` (MSB first within each byte). `StripSource.encode` prepends `pack_header(KIND_STRIP, frame_no, len(rows), rows, stretch, payload=rows)` — **the payload must be passed so the CRC covers it**, or the terminal rejects every frame — and chunks the result at 1450 bytes.
|
||||
|
||||
- [ ] **Step 4: Run test to verify it passes**
|
||||
|
||||
|
||||
Reference in new issue
Block a user