Skip to content

Commit

Permalink
Document the N generic for Udp as done for Tcp (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero authored Nov 24, 2024
1 parent 8df8e3c commit c1b9e4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions edge-nal-embassy/src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ impl<'d, D: Driver, const N: usize, const TX_SZ: usize, const RX_SZ: usize, cons
Udp<'d, D, N, TX_SZ, RX_SZ, M>
{
/// Create a new `Udp` instance for the provided Embassy networking stack using the provided UDP buffers.
///
/// Ensure that the number of buffers `N` fits within StackResources<N> of
/// [embassy_net::Stack], while taking into account the sockets used for DHCP, DNS, etc. else
/// [smoltcp::iface::SocketSet] will panic with `adding a socket to a full SocketSet`.
pub fn new(stack: &'d Stack<D>, buffers: &'d UdpBuffers<N, TX_SZ, RX_SZ, M>) -> Self {
Self { stack, buffers }
}
Expand Down

0 comments on commit c1b9e4a

Please sign in to comment.