pre uart exchange

This commit is contained in:
2026-03-04 16:32:51 +01:00
parent b665cb5def
commit 4f3fbff258
46 changed files with 2820 additions and 3186 deletions

28
tool/core/cmd/proto.py Normal file
View File

@@ -0,0 +1,28 @@
# tool/core/cmd/proto.py
import struct
from core.utils import console, console_err
from core.protocol import COMMANDS, ERRORS
class proto:
def __init__(self, bus):
self.bus = bus
def get(self):
self.bus.send_request(COMMANDS['get_protocol_version'], None)
data = self.bus.receive_response(length=1)
if not data or data.get('type') == 'error':
return None
payload = data['data']
result = {
'protocol_version': payload[0]
}
return result
def print(self, result):
if not result:
return
protocol_version = result['protocol_version']
console.print(f"[title]Protokoll Version[/info] des Controllers ist [info]{protocol_version}[/info]:")