embassy_socket/connection/socket_state.rs
1use crate::connection::pool::Pool;
2
3/// socket connection<br />
4/// N is socket number<br />
5/// TX_SZ is socket tx size<br />
6/// RX_SZ is socket rx size<br />
7/// BUF_SIZE is read data buf size
8pub struct SocketState<const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize> {
9 /// memory pool
10 pub pool: Pool<([u8; TX_SZ], [u8; RX_SZ], [u8; BUF_SIZE]), N>,
11}
12
13/// custom method
14impl<const N: usize, const TX_SZ: usize, const RX_SZ: usize, const BUF_SIZE: usize> SocketState<N, TX_SZ, RX_SZ, BUF_SIZE> {
15 /// create socket connection
16 pub const fn new() -> Self {
17 Self { pool: Pool::new() }
18 }
19}