fix(device_access): wake a MiniMate before every state read in a start/stop, so a start's read-back is answered
BE9441, 2026-10-26 23:41:48 (through the bridge): SFM's start (0x96, Blastware's own bytes) was acked 0x69 and the unit began monitoring -- Brian saw it -- but the read-back sent one bare 0x1C two seconds later and got nothing for 120 s, so the change reported 'sent and acknowledged, but reading the state back failed' (504, audit 0c1cf813). Nothing was retried. A monitoring MiniMate ignores a bare request until SESSION_RESET + POLL (measured 2026-04-08). The read-back had relied on the connect's wake; a stop's read-back (18:53, the unit idle by then) never needed it. Every state read in the change now goes through _woken_state: client.poll() (41 03, POLL, 41 03, POLL -- the connect's own sequence), then 0x1C. Test: after the send, every 0x1C read is preceded by a POLL. No codec, store or DB change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
1 parent
6f2acc79e6
commit
9886422212
2 files changed
+26
-1
No files matched your search
@@ -771,3 +771,17 @@ def test_series3_a_cold_unit_during_a_change_is_not_retried():
|
||||
da.start_monitoring(TCP3, "BE18193")
|
||||
assert fake.writes == []
|
||||
assert len(da.factory_calls) == 1 # the change path never takes _run's retry
|
||||
|
||||
|
||||
# -- Series 3: a monitoring unit answers only after the wake ----------------------
|
||||
|
||||
def test_series3_wakes_the_unit_before_every_state_read():
|
||||
# BE9441, 2026-10-26 23:41: the start was acked, then one bare 0x1C read got
|
||||
# nothing for 120 s -- a monitoring unit ignores everything until SESSION_RESET
|
||||
# + POLL (measured 2026-04-08), which only the connect had sent.
|
||||
fake = FakeMiniMateClient(monitor_states=[False, True])
|
||||
r = access3(fake).start_monitoring(TCP3, "BE18193")
|
||||
assert r.outcome == "sent" and r.verified == "ok"
|
||||
after = fake.calls[fake.calls.index("start_monitoring") + 1:]
|
||||
reads = [i for i, c in enumerate(after) if c == "get_monitor_status"]
|
||||
assert reads and all(after[i - 1] == "poll" for i in reads)
|
||||
Reference in new issue
Block a user