UdpMulticastRadio

Struct UdpMulticastRadio 

Source
pub struct UdpMulticastRadio { /* private fields */ }
Expand description

Host-side radio simulator backed by UDP multicast.

Raw UMSH frames are sent and received over IPv4 multicast with no additional framing. Multicast loopback is enabled by default so that multiple processes on the same host can exchange frames via the loopback interface.

Because multicast loopback echoes every sent frame back to the sender, UdpMulticastRadio stores the last transmitted frame and silently drops any received frame that is an exact byte-for-byte match. A legitimately forwarded copy of the frame is never an exact match: repeaters always modify the packet (decrementing the hop count or removing a source-route entry), so only the loopback echo is affected.

Implementations§

Source§

impl UdpMulticastRadio

Source

pub async fn bind_v4( group_addr: Ipv4Addr, port: u16, ) -> Result<Self, UdpMulticastRadioError>

Bind a UDP multicast simulator socket using a simple localhost-oriented configuration.

Source

pub async fn bind_with_config( config: UdpMulticastRadioConfig, ) -> Result<Self, UdpMulticastRadioError>

Bind a UDP multicast simulator socket using the provided configuration.

Trait Implementations§

Source§

impl Radio for UdpMulticastRadio

Source§

type Error = UdpMulticastRadioError

Source§

async fn transmit( &mut self, data: &[u8], _options: TxOptions, ) -> Result<(), TxError<Self::Error>>

Transmit a complete raw UMSH frame.
Source§

fn poll_receive( &mut self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<RxInfo, Self::Error>>

Poll reception of one frame into buf. Read more
Source§

fn max_frame_size(&self) -> usize

Return the largest supported raw frame size.
Source§

fn t_frame_ms(&self) -> u32

Return the approximate airtime for a maximum-length frame.

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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
§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
Source§

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