pub struct WpaController { /* private fields */ }Expand description
WPA controller
All methods require to provide buffer to temporary hold data from the socket.
Use WpaController::into_buffered to create wrapped instance with own buffer
Implementations§
Source§impl WpaController
impl WpaController
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Attempts to connect to WPA controller at specified path
Sourcepub fn open_path(path: &Path) -> Result<Self, Error>
pub fn open_path(path: &Path) -> Result<Self, Error>
Attempts to connect to WPA controller at specified path
Sourcepub fn open_path_with(
path: &Path,
options: &Options<impl SuffixGenerator>,
) -> Result<Self, Error>
pub fn open_path_with( path: &Path, options: &Options<impl SuffixGenerator>, ) -> Result<Self, Error>
Attempts to connect to WPA controller at specified path with provided options
Sourcepub fn into_buffered(self) -> BufferedWpaController
pub fn into_buffered(self) -> BufferedWpaController
Wraps controller with builtin buffer.
Sourcepub fn request(&self, req: WpaControlReq) -> Result<usize, Error>
pub fn request(&self, req: WpaControlReq) -> Result<usize, Error>
Sends request, returning number of bytes written.
Sourcepub fn recv<'a>(
&self,
buffer: &'a mut [u8],
) -> Result<Option<WpaControlMessage<'a>>, Error>
pub fn recv<'a>( &self, buffer: &'a mut [u8], ) -> Result<Option<WpaControlMessage<'a>>, Error>
Attempts to receive message.
Sourcepub fn recv_req_result(
&self,
buffer: &mut [u8],
) -> Option<Result<Result<(), ()>, Error>>
pub fn recv_req_result( &self, buffer: &mut [u8], ) -> Option<Result<Result<(), ()>, Error>>
Attempts to receive reply for result of command.
This method will continuously recv skipping unsolicited messages
§Result
-
Returns
Noneif neither success or fail are present among replies. -
Ok(())indicates success. -
Err(())indicates failure.
Sourcepub fn add_network(
&self,
ssid: &str,
wpa_pass: Option<&str>,
hidden: bool,
buffer: &mut [u8],
) -> Result<Id, Error>
pub fn add_network( &self, ssid: &str, wpa_pass: Option<&str>, hidden: bool, buffer: &mut [u8], ) -> Result<Id, Error>
Sourcepub fn remove_network(&self, id: Id, buffer: &mut [u8]) -> Result<(), Error>
pub fn remove_network(&self, id: Id, buffer: &mut [u8]) -> Result<(), Error>
Performs removal of known network by id.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WpaController
impl RefUnwindSafe for WpaController
impl Send for WpaController
impl Sync for WpaController
impl Unpin for WpaController
impl UnwindSafe for WpaController
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