Crates.io | wifi-rs |
lib.rs | wifi-rs |
version | 0.2.4 |
source | src |
created_at | 2018-11-11 08:35:18.663893 |
updated_at | 2024-01-05 11:50:59.134527 |
description | Interface with and manage Wireless Network (WiFi) |
homepage | |
repository | https://github.com/toksdotdev/wifi-rs |
max_upload_size | |
id | 96045 |
size | 35,587 |
A rust crate to interface and manage Wi-Fi networks.
This is a command-line counterpart of managing networks instead of via a GUI.
Windows
, Linux
, MacOS
).Windows
, Linux
, MacOS
).Windows
, Linux
).Note that only open, WEP and WPA-PSK networks are supported at the moment.
It is also supposed that IP configuration is obtained via DHCP.
use wifi_rs::{prelude::*, WiFi};
fn main() -> Result<(), WifiConnectionError> {
let config = Some(Config {
interface: Some("wlo1"),
});
let mut wifi = WiFi::new(config);
match wifi.connect("AndroidAPSD22", "belm4235") {
Ok(result) => println!(
"{}",
if result == true {
"Connection Successful."
} else {
"Invalid password."
}
),
Err(err) => println!("The following error occurred: {:?}", err),
}
Ok(())
}
tempfile
crate on windows to generate windows profile temporary file.is_wifi_enabled
for windows.wifi-CLI
with recent updates.Any feature you feel is missing, why not send in a Pull Request, and let's help make this project better. Or if there are any bugs, kindly create an issue, so we could work together towards fixing it.
Love this project, please show some love by starring the project 😃.