pub struct PluginContext {Show 26 fields
pub plugin_id: String,
pub plugin_version: String,
pub agent_id: String,
pub data_dir: Option<PathBuf>,
pub events: EventsClient,
pub mavlink: MavlinkClient,
pub msp: MspClient,
pub telemetry: TelemetryClient,
pub peripheral_manager: PeripheralClient,
pub peripherals: PeripheralClient,
pub camera: CameraClient,
pub vision: VisionClient,
pub config: ConfigClient,
pub buttons: ButtonClient,
pub flight: FlightClient,
pub gpio: GpioClient,
pub display: DisplayClient,
pub radio: RadioClient,
pub cloud: CloudClient,
pub node: NodeClient,
pub mdns: MdnsClient,
pub video: VideoClient,
pub sensors: SensorsClient,
pub process: ProcessClient,
pub lifecycle: LifecycleClient,
pub tools: ToolsClient,
/* private fields */
}Expand description
The object handed to every lifecycle hook. Every host-facing surface is a capability-gated facade; the IPC client is an implementation detail.
Ports ados.plugins.ipc.context.PluginContext. The peripherals field is
an alias for peripheral_manager, matching the Python back-compat alias.
Fields§
§plugin_id: String§plugin_version: String§agent_id: String§data_dir: Option<PathBuf>The plugin’s per-drone data directory, when the host set one on the unit.
None on a host that did not — a plugin must handle its absence rather
than assume a path.
events: EventsClient§mavlink: MavlinkClient§msp: MspClientctx.msp — raw MSP read/write for a Betaflight / iNav / KISS FC.
telemetry: TelemetryClient§peripheral_manager: PeripheralClient§peripherals: PeripheralClientAlias for peripheral_manager (Python ctx.peripherals).
camera: CameraClient§vision: VisionClientctx.vision — subscribe to engine frames, register models, run
inference, publish detections, and inject visual-odometry pose.
config: ConfigClientFront-panel button presses; quiet on a board with no panel.
flight: FlightClientThe scoped guided-setpoint sender.
gpio: GpioClientHost GPIO output (status line, buzzer).
display: DisplayClientThe reserved data-driven display page.
radio: RadioClientThe additive auxiliary radio stream.
cloud: CloudClientThe plugin’s cloud stream and cloud records.
node: NodeClientFacts about this node: profile, board, ground-station role, camera.
mdns: MdnsClientLocal-network service discovery through the host’s mDNS responder.
video: VideoClientWebRTC playback sessions on the agent’s camera legs.
sensors: SensorsClientThe sensor rig document.
process: ProcessClient§lifecycle: LifecycleClient§tools: ToolsClientThe plugin’s MCP tool handler registration.
Implementations§
Source§impl PluginContext
impl PluginContext
Sourcepub fn new(
ipc: Arc<PluginIpcClient>,
plugin_version: impl Into<String>,
agent_id: impl Into<String>,
data_dir: Option<String>,
static_config: BTreeMap<String, Value>,
) -> Self
pub fn new( ipc: Arc<PluginIpcClient>, plugin_version: impl Into<String>, agent_id: impl Into<String>, data_dir: Option<String>, static_config: BTreeMap<String, Value>, ) -> Self
Build a context over a connected client. static_config is the
manifest-supplied config dict the runner read at start.
Sourcepub async fn ping_supervisor(&self) -> Result<Value, ClientError>
pub async fn ping_supervisor(&self) -> Result<Value, ClientError>
Health probe against the host. Mirrors ping_supervisor.
Sourcepub fn client(&self) -> &Arc<PluginIpcClient> ⓘ
pub fn client(&self) -> &Arc<PluginIpcClient> ⓘ
The shared client, for advanced callers that need a method not yet on a facade.