Refactor(Project): Change Project Structure

This commit is contained in:
Tochukwu Nkemdilim
2018-07-19 16:14:34 +01:00
parent e8b83bf245
commit 65c641670d
17 changed files with 268 additions and 250 deletions
+17 -16
View File
@@ -2,26 +2,27 @@ mod connectivity;
mod hotspot;
mod platforms;
pub use connectivity::{Config, WifiConnectionError};
use connectivity::{Network, WifiConnectionError};
use platforms::{Config, WiFi};
fn main() -> Result<(), WifiConnectionError> {
// let config = Some(Config {
// interface: Some("wlo1"),
// });
let config = Some(Config {
interface: Some("wlo1"),
});
// let wifi = WiFi::new("AndroidAPSD22", config);
let mut wifi = WiFi::new(config);
// match wifi.connect("belm4235") {
// Ok(result) => println!(
// "{}",
// if result == true {
// "Connection Successfull."
// } else {
// "Invalid password."
// }
// ),
// Err(err) => println!("The following error occurred: {:?}", err),
// }
match wifi.connect("AndroidAPSD22", "belm4235") {
Ok(result) => println!(
"{}",
if result == true {
"Connection Successfull."
} else {
"Invalid password."
}
),
Err(err) => println!("The following error occurred: {:?}", err),
}
Ok(())
}