pub struct RadioClient { /* private fields */ }Expand description
ctx.radio — the additive auxiliary application stream on the link.
Opens a plugin-owned lane alongside the existing telemetry/video planes, gated so it only exists while the plugin is active.
Implementations§
Source§impl RadioClient
impl RadioClient
Sourcepub async fn open_aux_stream(&self) -> Result<Value, ClientError>
pub async fn open_aux_stream(&self) -> Result<Value, ClientError>
Open the auxiliary stream.
Sourcepub async fn close_aux_stream(&self) -> Result<Value, ClientError>
pub async fn close_aux_stream(&self) -> Result<Value, ClientError>
Close the auxiliary stream.
Sourcepub async fn send_aux(
&self,
channel: u8,
payload: &[u8],
) -> Result<Value, ClientError>
pub async fn send_aux( &self, channel: u8, payload: &[u8], ) -> Result<Value, ClientError>
Send one application datagram on the open auxiliary stream.
channel must be the reserved app channel this plugin’s direction uses
(AppStream 8 or AppCommand 9); the host refuses any other. The payload
is opaque to the host; a payload over the aux-frame maximum is refused
before it is sent.
Sourcepub async fn subscribe_aux<F: Fn(u8, Vec<u8>) + Send + Sync + 'static>(
&self,
cb: F,
) -> Result<(), ClientError>
pub async fn subscribe_aux<F: Fn(u8, Vec<u8>) + Send + Sync + 'static>( &self, cb: F, ) -> Result<(), ClientError>
Subscribe to application datagrams received on the open auxiliary stream.
The callback receives each (channel, payload) the host forwards; the
plugin’s codec routes by channel. A stream with no inbound frames never
fires the callback — the resting state, not an error. Register before
subscribing so no early frame is missed.