pub fn new(
        sn: Sn,
        src_port: u16,
        hostname: Hostname<'hn>,
        dst: SocketAddrV4,
        identity: &'psk [u8],
        psk: &'psk [u8],
        rx: &'b mut [u8; N],
    ) -> Self {
        Self {
            tls: TlsClient::new(sn, src_port, hostname, dst, identity, psk, rx),
            state_timeout: StateTimeout {
                state: State::Init,
                timeout: None,
            },
            client_id: None,

            pkt_id: 1,
        }
    }
/// Create a new MQTT client.
///
/// # Arguments
///
/// * `sn` - The socket number to use for MQTT.
/// * `src_port` - The MQTT source port, this is typically [`SRC_PORT`].
/// * `server` - The IP address and port for the MQTT server.
///
/// # Example
///
/// ```
/// # fn load_identity_from_memory() -> &'static [u8] { &[] }
/// # fn load_key_from_memory() -> &'static [u8] { &[] }
/// use w5500_mqtt::{
///     hl::Hostname,
///     ll::{
///         net::{Ipv4Addr, SocketAddrV4},
///         Sn,
///     },
///     tls::{Client, DST_PORT},
///     SRC_PORT,
/// };
///
/// static mut RXBUF: [u8; 2048] = [0; 2048];
///
/// let client: Client<2048> = Client::new(
///     Sn::Sn2,
///     SRC_PORT,
///     Hostname::new_unwrapped("mqtt.local"),
///     SocketAddrV4::new(Ipv4Addr::new(192, 168, 5, 6), DST_PORT),
///     load_identity_from_memory(),
///     &load_key_from_memory(),
///     unsafe { &mut RXBUF },
/// );
/// ```
///
/// [`SRC_PORT`]: crate::SRC_PORT
Create a new MQTT client.
Create a new MQTT client .
pub fn new(
        sn: Sn,
        src_port: u16,
        hostname: Hostname<'hn>,
        dst: SocketAddrV4,
        identity: &'psk [u8],
        psk: &'psk [u8],
        rx: &'b mut [u8; N],
    ) -> Self {
        Self {
            tls: TlsClient::new(sn, src_port, hostname, dst, identity, psk, rx),
            state_timeout: StateTimeout {
                state: State::Init,
                timeout: None,
            },
            client_id: None,
            pkt_id: 1,
        }
    }
pub fn new ( sn : Sn , src_port : u16 , hostname : Hostname < ' hn > , dst : SocketAddrV4 , identity : & ' psk [ u8 ] , psk : & ' psk [ u8 ] , rx : & ' b mut [ u8 ; N ] , ) -> Self { Self { tls : TlsClient :: new ( sn , src_port , hostname , dst , identity , psk , rx ) , state_timeout : StateTimeout { state : State :: Init , timeout : None , } , client_id : None , pkt_id : 1 , } }
Create a new MQTT client.
Create a new MQTT client .
sn
Sn
src_port
u16
hostname
Hostname<'hn>
dst
SocketAddrV4
identity
&'psk [u8]
psk
&'psk [u8]
rx
&'b mut [u8; N]
sn
Sn
src_port
u16
hostname
Hostname<'hn>
dst
SocketAddrV4
identity
&'psk [u8]
psk
&'psk [u8]
rx
&'b mut [u8; N]
example
None
fn load_identity_from_memory() -> &'static [u8] { &[] }
None
fn load_key_from_memory() -> &'static [u8] { &[] }




let client: Client<2048> = Client::new(
Sn::Sn2,
SRC_PORT,
Hostname::new_unwrapped("mqtt.local"),
SocketAddrV4::new(Ipv4Addr::new(192, 168, 5, 6), DST_PORT),
load_identity_from_memory(),
&load_key_from_memory(),
unsafe { &mut RXBUF },
);
```

[`SRC_PORT`]: crate::SRC_PORT
let client : Client<2048 > = Client :: new ( Sn :: Sn2 SRC_PORT Hostname :: new_unwrapped ( " mqtt . local " ) SocketAddrV4 :: new ( Ipv4Addr :: new ( 192 168 5 6 ) DST_PORT ) load_identity_from_memory () &load_key_from_memory () unsafe { &mut RXBUF } ) ; ` ` ` [ ` SRC_PORT ` ] : crate :: SRC_PORT