This commit is contained in:
2026-02-28 10:06:52 +01:00
parent 99dcbca8ac
commit 4d8899b2e0

View File

@@ -0,0 +1,18 @@
# core/commands/check.py
from core.connection import BuzzerError
def execute(conn, path: str) -> dict:
"""Holt die CRC32 einer datei und gibt sie als Int zurück."""
lines = conn.send_command("check " + path)
if not lines:
raise BuzzerError("Keine Antwort auf 'check' empfangen.")
parts = lines[0].split()
if len(parts) != 2 or parts[0] != "CRC32":
raise BuzzerError(f"Unerwartetes Check-Format: {lines[0]}")
crc32 = int(parts[1], 16)
return {
"crc32": crc32
}