Skip to content

Commit c1b9e4a

Browse files
authored
Document the N generic for Udp as done for Tcp (#47)
1 parent 8df8e3c commit c1b9e4a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

edge-nal-embassy/src/udp.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ impl<'d, D: Driver, const N: usize, const TX_SZ: usize, const RX_SZ: usize, cons
2929
Udp<'d, D, N, TX_SZ, RX_SZ, M>
3030
{
3131
/// Create a new `Udp` instance for the provided Embassy networking stack using the provided UDP buffers.
32+
///
33+
/// Ensure that the number of buffers `N` fits within StackResources<N> of
34+
/// [embassy_net::Stack], while taking into account the sockets used for DHCP, DNS, etc. else
35+
/// [smoltcp::iface::SocketSet] will panic with `adding a socket to a full SocketSet`.
3236
pub fn new(stack: &'d Stack<D>, buffers: &'d UdpBuffers<N, TX_SZ, RX_SZ, M>) -> Self {
3337
Self { stack, buffers }
3438
}

0 commit comments

Comments
 (0)