pub trait Device<'a> {
// Required methods
fn set_client(&self, client: &'a dyn Client);
fn init(&self) -> Result<(), ErrorCode>;
fn mac(&self) -> Result<[u8; 6], ErrorCode>;
fn access_point(
&self,
ssid: Ssid,
security: Option<(Security, Passphrase)>,
channel: u8,
) -> Result<(), ErrorCode>;
fn station(&self) -> Result<(), ErrorCode>;
fn join(
&self,
ssid: Ssid,
security: Option<(Security, Passphrase)>,
) -> Result<(), ErrorCode>;
fn leave(&self) -> Result<(), ErrorCode>;
fn scan(&self) -> Result<(), ErrorCode>;
fn stop_scan(&self) -> Result<(), ErrorCode>;
}Required Methods§
Sourcefn set_client(&self, client: &'a dyn Client)
fn set_client(&self, client: &'a dyn Client)
Set client
Sourcefn access_point(
&self,
ssid: Ssid,
security: Option<(Security, Passphrase)>,
channel: u8,
) -> Result<(), ErrorCode>
fn access_point( &self, ssid: Ssid, security: Option<(Security, Passphrase)>, channel: u8, ) -> Result<(), ErrorCode>
Configure the device as access point (AP)
§Arguments
ssid: The SSID of the configured networksecurity: Security method used by the network:Noneif the network is open- tuple of the security method and the passphrase buffer
channel: 802.11 WLAN channel number
Sourcefn join(
&self,
ssid: Ssid,
security: Option<(Security, Passphrase)>,
) -> Result<(), ErrorCode>
fn join( &self, ssid: Ssid, security: Option<(Security, Passphrase)>, ) -> Result<(), ErrorCode>
Join a network, either open or protected
§Arguments
ssid: WiFi network SSIDsecurity: Security method to use in order to join the network:Noneif the network is open- tuple of the security method and the passphrase buffer