Refactor(Project): Change Project Structure
This commit is contained in:
+17
-16
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user