pub struct Control<'a> { /* private fields */ }Expand description
Handle for managing the network and WiFI state.
Implementations§
Source§impl<'a> Control<'a>
impl<'a> Control<'a>
Sourcepub fn hardware_address(&self) -> HardwareAddress
pub fn hardware_address(&self) -> HardwareAddress
Get hardware address
Use after init method successful execution
This method may be used to update interface hardware address if you have initialized network stack before this device
use embassy_net::wire::HardwareAddress;
iface.set_hardware_addr(HardwareAddress::from_driver(ctl.hardware_address()).unwrap());Sourcepub fn reset(&self)
pub fn reset(&self)
Reset ESP and initialzation state
init should be executed again after reset
Sourcepub async fn get_status(&mut self) -> Result<Status, Error>
pub async fn get_status(&mut self) -> Result<Status, Error>
Get the current status.
Sourcepub async fn scan<const N: usize>(
&mut self,
result: &mut Vec<Network, N>,
) -> Result<(), Error>
pub async fn scan<const N: usize>( &mut self, result: &mut Vec<Network, N>, ) -> Result<(), Error>
Scan for available networks.
Sourcepub async fn connect(&mut self, ssid: &str, password: &str) -> Result<(), Error>
pub async fn connect(&mut self, ssid: &str, password: &str) -> Result<(), Error>
Connect to the network identified by ssid using the provided password.
Sourcepub async fn disconnect(&mut self) -> Result<(), Error>
pub async fn disconnect(&mut self) -> Result<(), Error>
Disconnect from any currently connected network.
Sourcepub async fn get_fw_version(&mut self) -> Result<FwVersion, Error>
pub async fn get_fw_version(&mut self) -> Result<FwVersion, Error>
Return the firmware version of the device.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Control<'a>
impl<'a> !Send for Control<'a>
impl<'a> !Sync for Control<'a>
impl<'a> !UnwindSafe for Control<'a>
impl<'a> Freeze for Control<'a>
impl<'a> Unpin for Control<'a>
impl<'a> UnsafeUnpin for Control<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more