feat: simulator bridge, rig seed and web UI (in progress)
Work in progress from the same tree as the controller's sequences-v2 changes. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4fc3345fc9
commit
4d8aeb5df8
26 files changed
+3907
-288
No files matched your search
+25
-6
@@ -1,16 +1,23 @@
|
||||
"""Minimal `network` stub so imports succeed (led-simulator)."""
|
||||
"""Minimal ``network`` stub so imports succeed (led-simulator).
|
||||
|
||||
Each simulated driver gets its own MAC from ``LED_SIM_MAC`` (12 hex digits).
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
STA_IF = 0
|
||||
AP_IF = 1
|
||||
|
||||
# Fixed “STA” identity for hello.py / discovery on the host.
|
||||
_SIM_MAC = b"\xaa\xbb\xcc\xdd\xee\xff"
|
||||
_SIM_MAC = bytes.fromhex(os.environ.get("LED_SIM_MAC", "aabbccddeeff"))
|
||||
_channel = 1
|
||||
|
||||
|
||||
class WLAN:
|
||||
PM_NONE = 0
|
||||
PM_PERFORMANCE = 1
|
||||
PM_POWERSAVE = 2
|
||||
|
||||
def __init__(self, interface):
|
||||
def __init__(self, interface=STA_IF):
|
||||
self._interface = interface
|
||||
self._active = False
|
||||
|
||||
@@ -21,18 +28,30 @@ class WLAN:
|
||||
return None
|
||||
|
||||
def config(self, param=None, **kwargs):
|
||||
global _channel
|
||||
if "channel" in kwargs:
|
||||
_channel = int(kwargs["channel"])
|
||||
if param == "mac":
|
||||
return _SIM_MAC
|
||||
if param == "channel":
|
||||
return _channel
|
||||
if param == "essid":
|
||||
return ""
|
||||
return None
|
||||
|
||||
def connect(self, *args, **kwargs):
|
||||
return None
|
||||
|
||||
def disconnect(self):
|
||||
return None
|
||||
|
||||
def isconnected(self):
|
||||
return True
|
||||
|
||||
def status(self, param=None):
|
||||
return 1010 # STAT_GOT_IP
|
||||
|
||||
def ifconfig(self, config_tuple=None):
|
||||
if config_tuple is None:
|
||||
# ip, subnet, gateway, dns — enough for hello UDP targets
|
||||
return ("192.168.1.100", "255.255.255.0", "192.168.1.1", "8.8.8.8")
|
||||
return ("192.168.4.%d" % (10 + _SIM_MAC[-1] % 200), "255.255.255.0", "192.168.4.1", "8.8.8.8")
|
||||
return None
|
||||
Reference in new issue
Block a user