Struct esp32_simple::wifi::Connection
source · pub struct Connection<'a> { /* private fields */ }Expand description
Represents a Wi-Fi connection, handling its configuration and state management.
This struct leverages the BlockingWifi handler from the ESP-IDF framework for managing the connection.
Implementations§
source§impl<'a> Connection<'a>
impl<'a> Connection<'a>
sourcepub fn new(handler: BlockingWifi<EspWifi<'a>>, config: &Config) -> Result<Self>
pub fn new(handler: BlockingWifi<EspWifi<'a>>, config: &Config) -> Result<Self>
Creates a new Connection instance with the given Wi-Fi handler and configuration.
Configures, starts, connects, and waits for the network interface to come up.
§Arguments
handler- The Wi-Fi handler to manage the connection.config- The Wi-Fi configuration containing SSID, password, and authentication method.
§Returns
A connected Connection instance ready for use.
§Errors
Returns an error if the configuration cannot be set, SSID/password conversion fails, or the connection cannot be established.