pub struct SimplexConfig { /* private fields */ }Expand description
Configuration for the asymmetric ESP-NOW simplex exchange.
One node owns all the transmit airtime and floods; the other goes receive-only after discovery and measures the flood. Leaving the channel to a single transmitter is what makes this the highest-rate pairing the crate offers.
The two ends are not interchangeable, so they are not built the same way. The source needs a PHY rate, a bandwidth and a periodicity; the peer forces no TX PHY at all — it only receives — so handing it those settings would silently ignore them. Each constructor takes only what its end consumes.
The session role follows the soundings, as it does everywhere else in this model: the node that
floods is the Initiator, and the node that beacons to be found and
then falls silent is the Responder.
Implementations§
Source§impl SimplexConfig
impl SimplexConfig
Sourcepub fn source(config: EspNowConfig) -> Self
pub fn source(config: EspNowConfig) -> Self
The flooding end: an initiator and sensing transmitter that reports nothing.
Listens for the peer’s discovery beacon, learns its MAC, registers it as a unicast peer with a forced PHY, then unicasts a continuous max-rate flood. It measures nothing, so its receive path is disabled regardless of how the node is otherwise configured — a CSI rate task here would compete for the airtime the flood exists to fill.
Takes the full EspNowConfig because this end is where channel, PHY
rate and HT40 all apply. Any session role or reporting set on that config is ignored: this
end is fixed.
Sourcepub fn peer(channel: u8) -> Self
pub fn peer(channel: u8) -> Self
The measuring end: a responder and sensing receiver that reports every measurement.
Broadcasts a sparse (~1 Hz) discovery beacon until it hears a source, then
stops beaconing entirely and goes receive-only, capturing CSI from the source’s flood.
Takes only a channel, because that is all this end uses. There is no PHY rate to force — the peer never transmits once paired — and no periodicity, because it sounds nothing.
Sourcepub fn with_peer_mac(self, mac: [u8; 6]) -> Self
pub fn with_peer_mac(self, mac: [u8; 6]) -> Self
Pair with a known MAC instead of discovering one. Both ends must be given the other’s.
Sourcepub fn session_role(&self) -> SessionRole
pub fn session_role(&self) -> SessionRole
Initiator for the source, Responder for the peer. Fixed by the end.
Sourcepub fn sensing_role(&self) -> SensingRole
pub fn sensing_role(&self) -> SensingRole
Transmitter for the source, Receiver for the peer. Fixed by the end.
Sourcepub fn get_reporting(&self) -> Reporting
pub fn get_reporting(&self) -> Reporting
None for the source, Report { to: Host } for the peer. Fixed by the end.
Sourcepub fn end(&self) -> SimplexEnd
pub fn end(&self) -> SimplexEnd
Which end this is.