pub struct SimulatedDevice { /* private fields */ }Expand description
A deterministic, RAM-backed device that speaks HDLC-Lite exactly like USB.
The storage, radio, RSSI sampler, and entropy source are small stand-ins;
every protocol decision is made by the production device [Session].
Implementations§
Source§impl SimulatedDevice
impl SimulatedDevice
pub fn new() -> Self
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 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_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.