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
impl UdpMulticastRadio
Sourcepub async fn bind_v4(
group_addr: Ipv4Addr,
port: u16,
) -> Result<Self, UdpMulticastRadioError>
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.
Sourcepub async fn bind_with_config(
config: UdpMulticastRadioConfig,
) -> Result<Self, UdpMulticastRadioError>
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
impl Radio for UdpMulticastRadio
type Error = UdpMulticastRadioError
Source§async fn transmit(
&mut self,
data: &[u8],
_options: TxOptions,
) -> Result<(), TxError<Self::Error>>
async fn transmit( &mut self, data: &[u8], _options: TxOptions, ) -> Result<(), TxError<Self::Error>>
Source§fn poll_receive(
&mut self,
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<Result<RxInfo, Self::Error>>
fn poll_receive( &mut self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<RxInfo, Self::Error>>
buf. Read more