Files
buzzer/buzzer_tool/core/commands/check.py
2026-03-01 11:11:56 +01:00

18 lines
505 B
Python

# 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) != 1:
raise BuzzerError(f"Unerwartetes Check-Format: {lines[0]}")
crc32 = int(parts[0], 16)
return {
"crc32": crc32
}