pub struct SimulatedDevice { /* private fields */ }Expand description
A deterministic, RAM-backed device that speaks HDLC-Lite exactly like USB.
Implementations§
Source§impl SimulatedDevice
impl SimulatedDevice
pub fn new(config: SessionConfig) -> SimulatedDevice
Sourcepub fn attach(&mut self)
pub fn attach(&mut self)
Attach over the virtual equivalent of a physically secure serial link.
pub fn detach(&mut self)
Sourcepub fn ingest(&mut self, bytes: &[u8], now_ms: u64) -> Result<(), String>
pub fn ingest(&mut self, bytes: &[u8], now_ms: u64) -> Result<(), String>
Feed an arbitrary serial byte chunk into the virtual USB link.
pub fn take_outbound(&mut self) -> Option<Vec<u8>>
Sourcepub fn take_transmitted(&mut self) -> Vec<Vec<u8>>
pub fn take_transmitted(&mut self) -> Vec<Vec<u8>>
Everything the device has transmitted since the last drain, in order. The queue grows until drained; a caller with no air to put frames on drains and discards.
Sourcepub fn inject_radio_rx(&mut self, bytes: &[u8], now_ms: u64)
pub fn inject_radio_rx(&mut self, bytes: &[u8], now_ms: u64)
Put a canned radio frame through the real device receive path.
Sourcepub fn inject_radio_rx_with_info(
&mut self,
bytes: &[u8],
info: &RadioRxInfo,
now_ms: u64,
)
pub fn inject_radio_rx_with_info( &mut self, bytes: &[u8], info: &RadioRxInfo, now_ms: u64, )
Put a radio frame through the real device receive path with the
caller’s own reception facts — all-None for a frame that
crossed no air and was measured by nobody.
Sourcepub fn inject_demo_rx(&mut self, now_ms: u64)
pub fn inject_demo_rx(&mut self, now_ms: u64)
Build and inject a small valid UMSH packet for interactive UI demos.