fix(sfm): wake a MiniMate before the read-back reconnect reads its serial (#9 review)
The reconnect in ce441a0 opened a fresh connection and sent a bare 0x15 (the
identity check) before any SESSION_RESET + POLL. It exists for a unit that has
just started -- sensor check, then monitoring -- and a monitoring MiniMate
ignores a bare request until woken (measured 2026-04-08), so the identity read
would have timed out and the start reported unconfirmed anyway. Now: open,
wake (the same retried wake the read-back uses), read the serial, read 0x1C --
the order the status read and the legacy write routes use. Still one
reconnect, TCP only, nothing re-sent.
The fake gains bare_requests_ignored (off unless a test asks): a fresh
connection's reads time out, with the real client's TimeoutError, until woken.
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
1626e521ae
commit
dbd8a91661
3 files changed
+41
-4
No files matched your search
@@ -249,8 +249,12 @@ class Series3Adapter:
|
||||
address.key, exc)
|
||||
client.close()
|
||||
client.open()
|
||||
# Wake first: the identity read is a bare 0x15, which a unit that
|
||||
# has just started ignores until SESSION_RESET + POLL (the order
|
||||
# the status read and the legacy write routes use: poll, then read).
|
||||
client.wake(attempt_s=S3_WAKE_ATTEMPT_S, deadline_s=S3_WAKE_DEADLINE_S)
|
||||
self._check(client.read_serial(), serial, address)
|
||||
return _woken_state(client)
|
||||
return s3_run_state(client.get_monitor_status())
|
||||
|
||||
return run_change(
|
||||
serial=serial, series=3, start=start, dry_run=dry_run,
|
||||
|
||||
Reference in new issue
Block a user