Some fixes for the examples and the crate

This commit is contained in:
Israel Duff
2021-02-03 19:39:18 +01:00
parent 69fb3ae92b
commit f55eac147b
6 changed files with 54 additions and 6 deletions
+9 -3
View File
@@ -4,6 +4,7 @@ extern crate wifi_rs;
use clap::{App, Arg};
use std::io;
use wifi_rs::WiFi;
use wifi_rs::prelude::*;
fn main() -> Result<(), io::Error> {
let matches = App::new("Wi-Fi")
@@ -48,8 +49,13 @@ fn main() -> Result<(), io::Error> {
// Get Wireless Interface
let interface = matches.value_of("interface").unwrap();
let wifi = WiFi::new(ssid)?;
println!("Connection Status: {}", wifi.connect(password));
let config = Some(Config {
interface: Some(interface),
});
// let wifi = WiFi::new(ssid)?;
let mut wifi = WiFi::new(config);
println!("Connection Status: {:?}", wifi.connect(ssid, password));
Ok(())
}
}