STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_ota_flash.FakeBoard Class Reference
Inheritance diagram for test_ota_flash.FakeBoard:
[legend]
Collaboration diagram for test_ota_flash.FakeBoard:
[legend]

Public Member Functions

None __init__ (self, str behavior="ok")
bool bind (self)
None run (self)

Public Attributes

str behavior = behavior
int|None declared_size = None
bytes received = b""
str|None error = None

Static Protected Member Functions

bytes|None _recv_exact (socket.socket conn, int n)

Protected Attributes

 _ready = threading.Event()
 _srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

Detailed Description

One-shot espota listener on 127.0.0.1:3232.

behavior: 'ok'     -> read all, reply "OK\\n"
          'silent' -> read all, close without replying (ESP32 rebooted first)
          'error'  -> read all, reply "FAILED\\n"
Captures the declared size header and the received firmware bytes.

Definition at line 83 of file test_ota_flash.py.

Constructor & Destructor Documentation

◆ __init__()

None test_ota_flash.FakeBoard.__init__ ( self,
str behavior = "ok" )

Definition at line 92 of file test_ota_flash.py.

References __init__().

Referenced by __init__().

Member Function Documentation

◆ _recv_exact()

bytes | None test_ota_flash.FakeBoard._recv_exact ( socket.socket conn,
int n )
staticprotected

Definition at line 143 of file test_ota_flash.py.

References min.

Referenced by run().

◆ bind()

bool test_ota_flash.FakeBoard.bind ( self)

Definition at line 102 of file test_ota_flash.py.

References _srv, bind(), sequencer::anonymous_namespace{ScriptRunner.cpp}::Interp.error, and error.

Referenced by bind().

◆ run()

None test_ota_flash.FakeBoard.run ( self)

Member Data Documentation

◆ _ready

test_ota_flash.FakeBoard._ready = threading.Event()
protected

Definition at line 98 of file test_ota_flash.py.

Referenced by run().

◆ _srv

test_ota_flash.FakeBoard._srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
protected

Definition at line 99 of file test_ota_flash.py.

Referenced by bind(), and run().

◆ behavior

str test_ota_flash.FakeBoard.behavior = behavior

Definition at line 94 of file test_ota_flash.py.

Referenced by run().

◆ declared_size

int | None test_ota_flash.FakeBoard.declared_size = None

Definition at line 95 of file test_ota_flash.py.

Referenced by run().

◆ error

str | None test_ota_flash.FakeBoard.error = None

Definition at line 97 of file test_ota_flash.py.

Referenced by bind(), run(), and backend.routers.layerx.Job.view().

◆ received

bytes test_ota_flash.FakeBoard.received = b""

Definition at line 96 of file test_ota_flash.py.

Referenced by run().


The documentation for this class was generated from the following file: