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
+1 -2
View File
@@ -1,4 +1,4 @@
mod providers;
pub mod providers;
use self::providers::prelude::HotspotConfig;
use crate::platforms::{WifiError, WifiInterface};
@@ -44,7 +44,6 @@ pub trait WifiHotspot: fmt::Debug + WifiInterface {
}
/// Stop serving a wireless network.
///
/// **NOTE: All users connected will automatically be disconnected.**
fn stop_hotspot(&mut self) -> Result<bool, WifiHotspotError> {
unimplemented!();
+12 -1
View File
@@ -16,6 +16,17 @@ pub struct HotspotConfig {
channel: Option<Channel>,
}
/// function to create a new config object
#[allow(dead_code)]
impl HotspotConfig {
pub fn new(band: Option<HotspotBand>, channel: Option<Channel>) -> HotspotConfig {
HotspotConfig {
band,
channel
}
}
}
#[allow(dead_code)]
#[derive(Debug)]
/// Band type of wireless hotspot.
@@ -58,9 +69,9 @@ impl WifiHotspot for WiFi {
let mut command = vec![
"device".to_string(),
"wifi".to_string(),
"hotspot".to_string(),
"ifname".to_string(),
self.interface.to_string(),
"hotspot".to_string(),
"con-name".to_string(),
HOTSPOT_GROUP.to_string(),
"ssid".to_string(),
+1
View File
@@ -6,6 +6,7 @@ mod platforms;
pub mod prelude {
pub use crate::connectivity::*;
pub use crate::hotspot::*;
pub use crate::hotspot::providers::prelude::*;
pub use crate::platforms::Config;
}