feat(simulator): add GUI runner, stubs, and workspace assets
Add host simulator scaffolding, examples, and docs so led-driver main can run end-to-end with MicroPython module stubs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
38
stubs/network.py
Normal file
38
stubs/network.py
Normal file
@@ -0,0 +1,38 @@
|
||||
"""Minimal `network` stub so imports succeed (led-simulator)."""
|
||||
|
||||
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"
|
||||
|
||||
|
||||
class WLAN:
|
||||
PM_NONE = 0
|
||||
|
||||
def __init__(self, interface):
|
||||
self._interface = interface
|
||||
self._active = False
|
||||
|
||||
def active(self, is_active=None):
|
||||
if is_active is None:
|
||||
return self._active
|
||||
self._active = bool(is_active)
|
||||
return None
|
||||
|
||||
def config(self, param=None, **kwargs):
|
||||
if param == "mac":
|
||||
return _SIM_MAC
|
||||
return None
|
||||
|
||||
def connect(self, *args, **kwargs):
|
||||
return None
|
||||
|
||||
def isconnected(self):
|
||||
return True
|
||||
|
||||
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 None
|
||||
Reference in New Issue
Block a user