Function esp_ward::connectivity::wifi::create_socket
source · pub fn create_socket<'a, 's, MODE>(
wifi_stack: &'s WifiStack<'a, MODE>,
ip_string: &str,
port: u16,
rx_buffer: &'a mut [u8],
tx_buffer: &'a mut [u8]
) -> Socket<'s, 'a, MODE>where
MODE: WifiDeviceMode,Expand description
Creates a new socket for communication over WiFi.
§Arguments
wifi_stack- Reference to theWifiStackto use for creating the socket.ip_string- The IP address as a string to which the socket should connect.port- The port number for the connection.rx_buffer- A mutable reference to the buffer used for receiving data.tx_buffer- A mutable reference to the buffer used for transmitting data.
§Returns
Returns a Socket instance ready for communication.