Protective Stop
Loading...
Searching...
No Matches
protective_stop_machine::SoftwareMachineBackend Class Reference

Hosts pstop_c in-process, making the node itself the machine. More...

#include <software_backend.hpp>

Inheritance diagram for protective_stop_machine::SoftwareMachineBackend:
[legend]
Collaboration diagram for protective_stop_machine::SoftwareMachineBackend:
[legend]

Public Member Functions

 SoftwareMachineBackend (const SoftwareConfig &config)
 Copies config; no I/O until start().
bool start () override
 Begins servicing: software binds UDP and runs the machine loop, hardware starts polling.
void stop () override
 Stops servicing and leaves the machine in its SAFE state.
MachineSnapshot snapshot () const override
 Thread-safe copy of the latest state.
bool configure (const MachineTiming &timing, std::string &error) override
 Applies an already safety-validated timing change.
const char * name () const override
 Backend kind, "software" or "hardware".

Detailed Description

Hosts pstop_c in-process, making the node itself the machine.

Runs a machine instance on a dedicated thread and binds UDP so remotes bond directly to it. On stop() or node death the machine stops replying and remotes fail-safe on their own heartbeat timeout (design ยง8).

Member Function Documentation

◆ configure()

bool protective_stop_machine::SoftwareMachineBackend::configure ( const MachineTiming & timing,
std::string & error )
overridevirtual

Applies an already safety-validated timing change.

Parameters
timingTiming to apply.
errorSet when the backend cannot honour the change.
Returns
False on an error or a refusal.

Implements protective_stop_machine::IMachineBackend.

◆ name()

const char * protective_stop_machine::SoftwareMachineBackend::name ( ) const
inlineoverridevirtual

Backend kind, "software" or "hardware".

Implements protective_stop_machine::IMachineBackend.

◆ snapshot()

MachineSnapshot protective_stop_machine::SoftwareMachineBackend::snapshot ( ) const
overridevirtual

Thread-safe copy of the latest state.

Implements protective_stop_machine::IMachineBackend.

◆ start()

bool protective_stop_machine::SoftwareMachineBackend::start ( )
overridevirtual

Begins servicing: software binds UDP and runs the machine loop, hardware starts polling.

Returns
False on a fatal setup error.

Implements protective_stop_machine::IMachineBackend.

◆ stop()

void protective_stop_machine::SoftwareMachineBackend::stop ( )
overridevirtual

Stops servicing and leaves the machine in its SAFE state.

Software stops the loop so remotes fail-safe; hardware stops polling while the ESP32 keeps enforcing. Idempotent.

Implements protective_stop_machine::IMachineBackend.


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