Chore(Docs): Improve Docs

This commit is contained in:
Tochukwu Nkemdilim
2018-11-10 06:42:45 +01:00
parent 55ccc6c68e
commit 0affa87c00
3 changed files with 9 additions and 4 deletions
+1
View File
@@ -10,6 +10,7 @@ mod platforms;
pub mod prelude {
pub use connectivity::*;
pub use hotspot::*;
pub use platforms::Config;
}
pub use platforms::WiFi;
+1 -2
View File
@@ -27,7 +27,6 @@ impl Osx {
/// Wifi interface for osx operating system.
/// This provides basic functionalities for wifi interface.
impl WifiInterface for Osx {
/// Check if wireless network adapter is enabled.
fn is_wifi_enabled() -> Result<bool, WifiError> {
let output = Command::new("networksetup")
.args(&["radio", "wifi"])
@@ -50,7 +49,7 @@ impl WifiInterface for Osx {
Ok(())
}
/// Turn off the wireless network adapter.
/// Turn off the wireless adapter.
fn turn_off() -> Result<(), WifiError> {
let output = Command::new("networksetup")
.args(&["-setairportpower", "en0", "off"])
+7 -2
View File
@@ -1,5 +1,5 @@
extern crate wifi_rs;
use self::wifi_rs::{prelude::*, Config, WiFi};
use self::wifi_rs::{prelude::*, WiFi};
#[test]
fn connect_to_wifi_failed() {
@@ -14,7 +14,12 @@ fn connect_to_wifi_failed() {
#[test]
fn create_hotspot() {
let hotspot_created = WiFi::create_hotspot("hello", "hi").unwrap();
let config = Some(Config {
interface: Some("wlo1"),
});
let mut wifi = WiFi::new(config);
let hotspot_created = wifi.create_hotspot("hello", "hi", None).unwrap();
assert_eq!(hotspot_created, true);
}