proxyclient:m1n1:rely on UartInterface defaults when creating object

- in 'main' section, device name and baud values are redundant as the
  UartInterface constructor handles it already
- Add a comment on how to run proxy.py as script

Signed-off-by: Alexis Deruelle <alexis.deruelle@gmail.com>
This commit is contained in:
Alexis Deruelle 2022-11-12 14:56:16 +01:00 committed by Hector Martin
parent bd82c5f47a
commit 0673a226c9

View file

@ -1126,11 +1126,11 @@ class M1N1Proxy(Reloadable):
__all__.extend(k for k, v in globals().items()
if (callable(v) or isinstance(v, type)) and v.__module__ == __name__)
# To run m1n1/proxy.py as script, use:
# $ cd <path to>/m1n1/proxyclient
# $ python3 -m m1n1.proxy m1n1/proxy.py
if __name__ == "__main__":
import serial
uartdev = os.environ.get("M1N1DEVICE", "/dev/m1n1")
usbuart = serial.Serial(uartdev, 115200)
uartif = UartInterface(usbuart, debug=True)
uartif = UartInterface(device=None, debug=True)
print("Sending NOP...", end=' ')
uartif.nop()
print("OK")