From 9d20105dd4d6a4c0a680d1694edc54091a1cf77b Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sun, 24 Nov 2024 13:37:23 +0100 Subject: [PATCH] Document the `N` generic for Udp as done for Tcp --- edge-nal-embassy/src/udp.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/edge-nal-embassy/src/udp.rs b/edge-nal-embassy/src/udp.rs index eafca46..9f4f89f 100644 --- a/edge-nal-embassy/src/udp.rs +++ b/edge-nal-embassy/src/udp.rs @@ -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 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, buffers: &'d UdpBuffers) -> Self { Self { stack, buffers } }