Release v0.34.0 — Series-4 parity, and most of Blastware's report from the event file alone #59

Merged
serversdown merged 245 commits from dev into main 2026-11-04 18:19:24 -05:00
Showing only changes of commit 93349ed040 - Show all commits
+8 -4
View File
@@ -444,12 +444,16 @@ def test_a_literal_0x10_in_data_round_trips():
assert _destuffed_payload(build_request(0x71, 0x082C, bytes(10), data))[16:] == data
def test_a_checksum_that_lands_on_an_escape_byte_is_escaped():
# Pick the last data byte so SUM8 of the payload is exactly 0x03.
@pytest.mark.parametrize("target", [0x02, 0x03, 0x04, 0x10])
def test_a_checksum_that_lands_on_an_escape_byte_is_escaped(target):
# Pick the last data byte so SUM8 of the payload is exactly `target`. If that
# byte is itself an escape byte the earlier bytes shift, but the last three
# on the wire stay DLE target ETX.
head = bytes([0x10, 0x00, 0x7E, 0x00, 0x00, 0x7E]) + bytes(10) + b"\x01\x02"
last = (0x03 - sum(head)) & 0xFF
last = (target - sum(head)) & 0xFF
f = build_request(0x7E, 0x007E, bytes(10), b"\x01\x02" + bytes([last]))
assert f[-3:] == bytes([DLE, 0x03, ETX])
assert unstuff(f[2:-1])[-1] == target # the checksum byte itself
assert f[-3:] == bytes([DLE, target, ETX])
def test_without_data_the_frame_is_unchanged():