Protective Stop
Loading...
Searching...
No Matches
protective_stop_machine::IMachineBackend Class Referenceabstract

Backend seam the node depends on, implemented by SoftwareMachineBackend (hosts pstop_c) and HardwareMachineBackend (HTTP-polls the ESP32). More...

#include <backend.hpp>

Inheritance diagram for protective_stop_machine::IMachineBackend:
[legend]

Public Member Functions

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

Detailed Description

Backend seam the node depends on, implemented by SoftwareMachineBackend (hosts pstop_c) and HardwareMachineBackend (HTTP-polls the ESP32).

Implementations are rclcpp-free.

Member Function Documentation

◆ configure()

virtual bool protective_stop_machine::IMachineBackend::configure ( const MachineTiming & timing,
std::string & error )
pure virtual

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.

Implemented in protective_stop_machine::HardwareMachineBackend, and protective_stop_machine::SoftwareMachineBackend.

◆ name()

virtual const char * protective_stop_machine::IMachineBackend::name ( ) const
pure virtual

Backend kind, "software" or "hardware".

Implemented in protective_stop_machine::HardwareMachineBackend, and protective_stop_machine::SoftwareMachineBackend.

◆ snapshot()

virtual MachineSnapshot protective_stop_machine::IMachineBackend::snapshot ( ) const
pure virtual

◆ start()

virtual bool protective_stop_machine::IMachineBackend::start ( )
pure virtual

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

Returns
False on a fatal setup error.

Implemented in protective_stop_machine::HardwareMachineBackend, and protective_stop_machine::SoftwareMachineBackend.

◆ stop()

virtual void protective_stop_machine::IMachineBackend::stop ( )
pure virtual

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.

Implemented in protective_stop_machine::HardwareMachineBackend, and protective_stop_machine::SoftwareMachineBackend.


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