Feat(WifiStatus)): Check Fi Status

This commit is contained in:
Tochukwu Nkemdilim
2018-07-03 17:02:37 +01:00
parent 96c16e70a9
commit c6e4d7359f
8 changed files with 112 additions and 4 deletions
+2
View File
@@ -9,6 +9,7 @@ pub trait Network: fmt::Debug {
/// Makes an attempt to connect to a selected wireless network with password specified.
fn connect(&self, password: &str) -> Result<bool, NetworkError>;
fn disconnect(&self) -> Result<bool, NetworkError>;
fn is_wifi_enabled(&self) -> bool;
}
// #[derive(Debug)]
@@ -33,6 +34,7 @@ pub enum NetworkError {
IoError(io::Error),
FailedToConnect(String),
FailedToDisconnect(String),
WiFiInterfaceDisabled,
}
impl From<io::Error> for NetworkError {