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§
- State
Socket Probe - An
ArmedProbefed 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§
- Armed
Probe - A source of the armed verdict.
Functions§
- read_
state_ snapshot - Read one vehicle-state snapshot from
state_socket, giving up aftertimeout.Nonewhen the socket is absent, the stream ends, or no frame arrives in time; pass the result tovehicle_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_AGEto say otherwise.