Recover kit checksums from a truncated Sox schema reply

The device builds the schema and version replies in a fixed 512-byte
packet and drops whatever does not fit. Read strings defensively, recover
a cut-off checksum from the one local manifest matching its prefix, and
fail with a clear message when the kit list cannot be recovered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-29 21:04:03 +03:00
co-authored by Claude Opus 5.5
parent fd35e5c9bb
commit a9593de065
4 changed files with 68 additions and 11 deletions
+1
View File
@@ -45,6 +45,7 @@ class DeviceSession:
"""DASP connect → read schema → load root. Called from background thread."""
self.sox_client = SoxClient(host, int(port), user, password)
self.sox_client.on_event = self._on_sox_event
self.sox_client.checksum_resolver = schema.resolve_truncated_checksum
self.sox_client.connect()
parts = self.sox_client.read_schema()