[][src]Trait w5500::Udp

pub trait Udp {
    type Error;
    fn receive(
        &mut self,
        target_buffer: &mut [u8]
    ) -> Result<Option<(IpAddress, u16, usize)>, Self::Error>;
fn blocking_send(
        &mut self,
        host: &IpAddress,
        host_port: u16,
        data: &[u8]
    ) -> Result<(), Self::Error>; }

UDP trait that defines send and receive methods for UDP packets

Associated Types

type Error

Loading content...

Required methods

fn receive(
    &mut self,
    target_buffer: &mut [u8]
) -> Result<Option<(IpAddress, u16, usize)>, Self::Error>

fn blocking_send(
    &mut self,
    host: &IpAddress,
    host_port: u16,
    data: &[u8]
) -> Result<(), Self::Error>

Loading content...

Implementors

impl<'_, '_, '_, '_, ChipSelect: OutputPin, Spi: FullDuplex<u8>> Udp for (&'_ mut ActiveW5500<'_, '_, ChipSelect, Spi>, &'_ UdpSocket)[src]

type Error = TransferError<Spi::Error, ChipSelect::Error>

fn receive(
    &mut self,
    destination: &mut [u8]
) -> Result<Option<(IpAddress, u16, usize)>, Self::Error>
[src]

Returns a UDP packet if one is available. Will return None if no UDP packets are in the socket's buffer

fn blocking_send(
    &mut self,
    host: &IpAddress,
    host_port: u16,
    data: &[u8]
) -> Result<(), Self::Error>
[src]

Sends a UDP packet to the specified IP and port, and blocks until it is fully sent

Loading content...