This commit is contained in:
2026-02-28 10:06:36 +01:00
parent 8a124fe17d
commit 99dcbca8ac
8 changed files with 82 additions and 38 deletions

View File

@@ -3,7 +3,7 @@ import argparse
import sys
from core.config import load_config
from core.connection import BuzzerConnection, BuzzerError
from core.commands import info, ls, put, mkdir, rm, confirm, reboot, play
from core.commands import info, ls, put, mkdir, rm, confirm, reboot, play, check
def main():
parser = argparse.ArgumentParser(description="Edis Buzzer Host Tool")
@@ -42,6 +42,10 @@ def main():
play_parser = subparsers.add_parser("play", help="Spielt eine Datei auf dem Controller ab")
play_parser.add_argument("path", type=str, help="Pfad der abzuspielenden Datei (z.B. /lfs/a/neu)")
# Befehl: check
check_parser = subparsers.add_parser("check", help="Holt die CRC32 einer Datei und zeigt sie an")
check_parser.add_argument("path", type=str, help="Pfad der zu prüfenden Datei (z.B. /lfs/a/neu)")
# Befehl: confirm
confirm_parser = subparsers.add_parser("confirm", help="Bestätigt die aktuell laufende Firmware")
@@ -95,6 +99,12 @@ def main():
reboot.execute(conn)
elif args.command == "play":
play.execute(conn, path=args.path)
elif args.command == "check":
CRC32 = check.execute(conn, path=args.path)
if CRC32:
print(f"CRC32 von '{args.path}': 0x{CRC32['crc32']:08x}")
else:
print(f"Fehler: Keine CRC32-Information für '{args.path}' erhalten.")
elif args.command == "info" or args.command is None:
# Wurde kein Befehl oder explizit 'info' angegeben, sind wir hier schon fertig
pass