Struct Wifi

Source
pub struct Wifi<B, C> { /* private fields */ }
Expand description

Base type for controlling an ESP32-WROOM NINA firmware-based WiFi board.

Implementations§

Source§

impl<S, C> Wifi<S, C>

Source

pub fn init<D: DelayMs<u16>>( spi: S, esp32_control_pins: C, delay: &mut D, ) -> Result<Wifi<S, C>, Error>

Initialize the ESP32-WROOM WiFi device. Call this function to put the connected ESP32-WROOM device in a known good state to accept commands.

Source

pub fn firmware_version(&mut self) -> Result<FirmwareVersion, Error>

Retrieve the NINA firmware version contained on the connected ESP32-WROOM device (e.g. 1.7.4).

Source

pub fn join(&mut self, ssid: &str, passphrase: &str) -> Result<(), Error>

Join a WiFi network given an SSID and a Passphrase.

Source

pub fn leave(&mut self) -> Result<(), Error>

Disconnect from a previously joined WiFi network.

Source

pub fn get_connection_status(&mut self) -> Result<ConnectionStatus, Error>

Retrieve the current WiFi network ConnectionStatus.

Source

pub fn set_dns( &mut self, dns1: IpAddress, dns2: Option<IpAddress>, ) -> Result<(), Error>

Set 1 or 2 DNS servers that are used for network hostname resolution.

Source

pub fn resolve(&mut self, hostname: &str) -> Result<IpAddress, Error>

Query the DNS server(s) provided via set_dns for the associated IP address to the provided hostname.

Source

pub fn destroy(self) -> S

Return a reference to the Spi bus instance typically used when cleaning up an instance of Wifi.

Trait Implementations§

Source§

impl<B: Debug, C: Debug> Debug for Wifi<B, C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B, C> !Freeze for Wifi<B, C>

§

impl<B, C> !RefUnwindSafe for Wifi<B, C>

§

impl<B, C> Send for Wifi<B, C>
where C: Send, B: Send,

§

impl<B, C> !Sync for Wifi<B, C>

§

impl<B, C> Unpin for Wifi<B, C>
where C: Unpin, B: Unpin,

§

impl<B, C> UnwindSafe for Wifi<B, C>
where C: UnwindSafe, B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.