Skip to main content

SimplexConfig

Struct SimplexConfig 

Source
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

Source

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.

Source

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.

Source

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.

Source

pub fn session_role(&self) -> SessionRole

Initiator for the source, Responder for the peer. Fixed by the end.

Source

pub fn sensing_role(&self) -> SensingRole

Transmitter for the source, Receiver for the peer. Fixed by the end.

Source

pub fn get_reporting(&self) -> Reporting

None for the source, Report { to: Host } for the peer. Fixed by the end.

Source

pub fn end(&self) -> SimplexEnd

Which end this is.

Source

pub fn is_source(&self) -> bool

Whether this is the flooding end.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.