diff --git a/scripts/radxa_g29_relay.py b/scripts/radxa_g29_relay.py index cf10acb..5c2da78 100755 --- a/scripts/radxa_g29_relay.py +++ b/scripts/radxa_g29_relay.py @@ -12,6 +12,7 @@ import socket import sys import termios import time +from typing import Optional BAUD_RATE = termios.B460800 CASQUE_IP = os.environ.get("STEAMFRAME_CASQUE_IP", "192.168.1.10") @@ -44,7 +45,7 @@ def open_serial(dev_path: str) -> int: return fd -def find_serial_device() -> str | None: +def find_serial_device() -> Optional[str]: forced = os.environ.get("G29_SERIAL_DEV") if forced and os.path.exists(forced): return forced @@ -61,7 +62,7 @@ def main() -> None: sock.setblocking(False) print(f"[radxa_g29_relay] UDP :0.0.0.0:{UDP_PORT} <-> {CASQUE_IP}:{UDP_PORT}", flush=True) - serial_fd: int | None = None + serial_fd: Optional[int] = None serial_buf = bytearray() last_casque_addr = (CASQUE_IP, UDP_PORT)