10#include "protective_stop_machine/backend.hpp"
12namespace protective_stop_machine
35inline bool software_remote_admitted(
const SoftwareConfig & config, uint32_t remote_id)
37 for (uint32_t listed_id : config.denylist) {
38 if (listed_id == remote_id) {
43 if (config.allowlist.empty()) {
47 for (uint32_t listed_id : config.allowlist) {
48 if (listed_id == remote_id) {
71 const char *
name()
const override
81 std::unique_ptr<Impl> impl_;
Backend seam the node depends on, implemented by SoftwareMachineBackend (hosts pstop_c) and HardwareM...
Definition backend.hpp:113
bool start() override
Begins servicing: software binds UDP and runs the machine loop, hardware starts polling.
const char * name() const override
Backend kind, "software" or "hardware".
Definition software_backend.hpp:71
void stop() override
Stops servicing and leaves the machine in its SAFE state.
SoftwareMachineBackend(const SoftwareConfig &config)
Copies config; no I/O until start().
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.
One immutable read of machine state, mapped straight onto the ROS messages.
Definition backend.hpp:64
Runtime-settable timing envelope.
Definition backend.hpp:100
Deployment values for the in-process software backend.
Definition software_backend.hpp:17
uint32_t machine_id
Device ID of this machine.
Definition software_backend.hpp:23
MachineTiming timing
Initial timing envelope.
Definition software_backend.hpp:25
std::vector< uint32_t > denylist
Remote IDs refused regardless of the allowlist.
Definition software_backend.hpp:29
std::vector< uint32_t > allowlist
Remote IDs permitted to bond; empty admits any remote.
Definition software_backend.hpp:27
int port
UDP port remotes bond to.
Definition software_backend.hpp:21
std::string bind_addr
Local address the UDP socket binds to.
Definition software_backend.hpp:19