fn udp_send_to_if_free(
        &mut self,
        sn: Sn,
        buf: &[u8],
        addr: &SocketAddrV4,
    ) -> Result<u16, Self::Error> {
        self.set_sn_dest(sn, addr)?;
        self.udp_send_if_free(sn, buf)
    }
/// Sends data on the socket to the given address.
/// On success, returns the number of bytes written.
///
/// This will transmit only if there is enough free space in the W5500
/// transmit buffer.
///
/// # Comparison to [`std::net::UdpSocket::send_to`]
///
/// * You cannot transmit more than `u16::MAX` bytes at once.
/// * You can only provide one destination.
///
/// # Panics
///
/// * (debug) The socket must be opened as a UDP socket.
///
/// # Example
///
/// ```no_run
/// # use embedded_hal_mock as h;
/// # let mut w5500 = w5500_ll::blocking::vdm::W5500::new(h::spi::Mock::new(&[]), h::pin::Mock::new(&[]));
/// use w5500_hl::{
///     ll::{Registers, Sn::Sn0},
///     net::{Ipv4Addr, SocketAddrV4},
///     Udp,
/// };
///
/// const DEST: SocketAddrV4 = SocketAddrV4::new(Ipv4Addr::new(192, 0, 2, 1), 8081);
///
/// w5500.udp_bind(Sn0, 8080)?;
/// let buf: [u8; 10] = [0; 10];
/// let tx_bytes: u16 = w5500.udp_send_to_if_free(Sn0, &buf, &DEST)?;
/// assert_eq!(usize::from(tx_bytes), buf.len());
/// # Ok::<(), w5500_hl::ll::blocking::vdm::Error<_, _>>(())
/// ```
///
/// [`std::net::UdpSocket::send_to`]: https://doc.rust-lang.org/std/net/struct.UdpSocket.html#method.send_to
Sends data on the socket to the given address.
On success, returns the number of bytes written.

This will transmit only if there is enough free space in the W5500
transmit buffer.
Sends data on the socket to the given address . On success returns the number of bytes written . This will transmit only if there is enough free space in the W5500 transmit buffer .
fn udp_send_to_if_free(
        &mut self,
        sn: Sn,
        buf: &[u8],
        addr: &SocketAddrV4,
    ) -> Result<u16, Self::Error> {
        self.set_sn_dest(sn, addr)?;
        self.udp_send_if_free(sn, buf)
    }
fn udp_send_to_if_free ( & mut self , sn : Sn , buf : & [ u8 ] , addr : & SocketAddrV4 , ) -> Result < u16 , Self :: Error > { self . set_sn_dest ( sn , addr ) ? ; self . udp_send_if_free ( sn , buf ) }
Sends data on the socket to the given address.
Sends data on the socket to the given address .
&mut self
sn
Sn
buf
&[u8]
addr
&SocketAddrV4
&mut self
sn
Sn
buf
&[u8]
addr
&SocketAddrV4
comparison to [`std::net::udpsocket::send_to`]
You cannot transmit more than `u16::MAX` bytes at once.
You can only provide one destination.
You cannot transmit more than ` u16 :: MAX ` bytes at once . You can only provide one destination .
panics
(debug) The socket must be opened as a UDP socket.
( debug ) The socket must be opened as a UDP socket .
example
None
use embedded_hal_mock as h;
None
let mut w5500 = w5500_ll::blocking::vdm::w5500::new(h::spi::mock::new(&[]), h::pin::mock::new(&[]));
None
ok::<(), w5500_hl::ll::blocking::vdm::error<_, _>>(())
None