Skip to main content

Module armed

Module armed 

Source
Expand description

Whether the vehicle counts as armed, read from the router’s state socket.

Every consumer that must refuse a link-dropping action in flight (the control surface’s interlock, the plugin host’s unattended updates, the installer and the CLI) answers the same question the same way: the latest vehicle-state snapshot says armed: false and is younger than ARMED_STATE_MAX_AGE, or the vehicle is treated as armed. No state, a stale state, or a state without an armed field proves nothing, so each of those fails closed.

StateSocketProbe keeps a live snapshot for a long-running service; read_state_snapshot reads one snapshot for a one-shot caller.

Structs§

StateSocketProbe
An ArmedProbe fed by a background reader of the router state socket.

Constants§

ARMED_STATE_MAX_AGE
How old the vehicle state may be before the vehicle is assumed armed.

Traits§

ArmedProbe
A source of the armed verdict.

Functions§

read_state_snapshot
Read one vehicle-state snapshot from state_socket, giving up after timeout. None when the socket is absent, the stream ends, or no frame arrives in time; pass the result to vehicle_treated_as_armed.
vehicle_treated_as_armed
Whether the vehicle should be treated as armed: the latest state says so, or there is no state newer than ARMED_STATE_MAX_AGE to say otherwise.