Struct wpactrl::WpaCtrlAttached
[−]
[src]
pub struct WpaCtrlAttached(_, _);
A connection to wpasupplicant / hostap that receives status messages
Methods
impl WpaCtrlAttached
[src]
fn detach(self) -> Result<WpaCtrl>
[src]
Stop listening for and discard any remaining control interface messages
Examples
let mut wpa = wpactrl::WpaCtrl::new().open().unwrap().attach().unwrap(); wpa.detach().unwrap();
fn recv(&mut self) -> Result<Option<String>>
[src]
Receive the next control interface message.
Note that multiple control interface messages can be pending; call this function repeatedly until it returns None to get all of them.
Examples
let mut wpa = wpactrl::WpaCtrl::new().open().unwrap().attach().unwrap(); assert_eq!(wpa.recv().unwrap(), None);
fn request(&mut self, cmd: &str) -> Result<String>
[src]
Send a command to wpa_supplicant/hostapd.
Commands are generally identical to those used in wpa_cli, except all uppercase (eg LIST_NETWORKS, SCAN, etc)
Control interface messages will be buffered as the command runs, and will be returned on the next call to recv.
Examples
let mut wpa = wpactrl::WpaCtrl::new().open().unwrap(); assert_eq!(wpa.request("PING").unwrap(), "PONG\n");