Add Classified Brief 0x02 and remove hardcoded toolchains

This commit is contained in:
Kevin Thomas committed 2026-10-08 10:54:37 -04:00
1 parent ea7fa10403
commit 9d307322d5
44 files changed
+2065 -27

No files matched your search

+86 -26
View File
@@ -88,6 +88,88 @@ def _parse_args() -> argparse.Namespace:
return parser.parse_args()
def _open_radio(port: str, baud: int) -> "serial.Serial":
"""
Open serial connection to the REYAX transceiver.
Parameters
----------
port : str
Serial device path or COM port identifier.
baud : int
Baud rate for serial communication.
Returns
-------
serial.Serial
Open serial interface to the radio.
"""
print(f"[*] Opening REYAX RYLR998 on {port} @ {baud}...")
try:
return serial.Serial(port, baud, timeout=0.5)
except Exception as e:
sys.exit(f"[-] Failed to open {port}: {e}")
def _start_radio(ser: "serial.Serial") -> None:
"""
Start listener thread and send initial AT ping.
Parameters
----------
ser : serial.Serial
Open serial connection to the ground RYLR998.
Returns
-------
None
"""
thread = threading.Thread(target=_reader_thread, args=(ser,), daemon=True)
thread.start()
time.sleep(0.1)
ser.write(b"AT\r\n")
def _print_banner() -> None:
"""
Print console connection info and operator command instructions.
Parameters
----------
None
Returns
-------
None
"""
print("[+] Connected. Type AT commands (e.g. AT, AT+BAND?, AT+NETWORKID?).")
print("[+] Incoming airborne packets print as [LORA RX] +RCV=...")
print("[+] Press Ctrl-C or Ctrl-D to exit.\n")
def _console_loop(ser: "serial.Serial") -> None:
"""
Forward operator input lines to the serial transceiver.
Parameters
----------
ser : serial.Serial
Open serial connection to the ground RYLR998.
Returns
-------
None
"""
try:
while True:
cmd = input("> ").strip()
if cmd:
ser.write(cmd.encode("utf-8") + b"\r\n")
except (KeyboardInterrupt, EOFError):
print("\n[*] Exiting LoRa console.")
ser.close()
def main() -> None:
"""
Open the ground station radio and forward operator input.
@@ -103,32 +185,10 @@ def main() -> None:
if serial is None:
sys.exit("pyserial required: pip install pyserial")
args = _parse_args()
print(f"[*] Opening REYAX RYLR998 on {args.port} @ {args.baud}...")
try:
ser = serial.Serial(args.port, args.baud, timeout=0.5)
except Exception as e:
sys.exit(f"[-] Failed to open {args.port}: {e}")
thread = threading.Thread(target=_reader_thread, args=(ser,), daemon=True)
thread.start()
time.sleep(0.1)
ser.write(b"AT\r\n")
print("[+] Connected. Type AT commands (e.g. AT, AT+BAND?, AT+NETWORKID?).")
print("[+] Incoming airborne packets print as [LORA RX] +RCV=...")
print("[+] Press Ctrl-C or Ctrl-D to exit.\n")
try:
while True:
cmd = input("> ").strip()
if not cmd:
continue
ser.write(cmd.encode("utf-8") + b"\r\n")
except (KeyboardInterrupt, EOFError):
print("\n[*] Exiting LoRa console.")
ser.close()
ser = _open_radio(args.port, args.baud)
_start_radio(ser)
_print_banner()
_console_loop(ser)
if __name__ == "__main__":