Skip to content

Commit

Permalink
add https support
Browse files Browse the repository at this point in the history
  • Loading branch information
axos88 committed Sep 26, 2022
1 parent ae40df3 commit 11bd59e
Showing 1 changed file with 53 additions and 5 deletions.
58 changes: 53 additions & 5 deletions src/wifi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl From<Newtype<&wifi_ap_record_t>> for AccessPointInfo {
wifi_second_chan_t_WIFI_SECOND_CHAN_BELOW => SecondaryChannel::Below,
_ => panic!(),
},
signal_strength: a.rssi as u8,
signal_strength: a.rssi as _,
protocols: EnumSet::<Protocol>::empty(), // TODO
auth_method: AuthMethod::from(Newtype::<wifi_auth_mode_t>(a.authmode)),
}
Expand Down Expand Up @@ -639,7 +639,7 @@ where
WifiDriver::is_started(self)
}

fn is_up(&self) -> Result<bool, Self::Error> {
fn is_connected(&self) -> Result<bool, Self::Error> {
WifiDriver::is_up(self)
}

Expand All @@ -660,6 +660,22 @@ where
fn scan(&mut self) -> Result<alloc::vec::Vec<AccessPointInfo>, Self::Error> {
WifiDriver::scan(self)
}

fn start(&mut self) -> Result<(), Self::Error> {
WifiDriver::start(self)
}

fn stop(&mut self) -> Result<(), Self::Error> {
WifiDriver::stop(self)
}

fn connect(&mut self) -> Result<(), Self::Error> {
WifiDriver::connect(self)
}

fn disconnect(&mut self) -> Result<(), Self::Error> {
WifiDriver::disconnect(self)
}
}

#[cfg(esp_idf_comp_esp_netif_enabled)]
Expand Down Expand Up @@ -853,7 +869,7 @@ where
EspWifi::is_started(self)
}

fn is_up(&self) -> Result<bool, Self::Error> {
fn is_connected(&self) -> Result<bool, Self::Error> {
EspWifi::is_up(self)
}

Expand All @@ -871,9 +887,25 @@ where
EspWifi::scan_n(self)
}

fn scan(&mut self) -> Result<alloc::vec::Vec<AccessPointInfo>, Self::Error> {
fn scan(&mut self) -> Result<Vec<AccessPointInfo>, Self::Error> {
EspWifi::scan(self)
}

fn start(&mut self) -> Result<(), Self::Error> {
EspWifi::start(self)
}

fn stop(&mut self) -> Result<(), Self::Error> {
EspWifi::stop(self)
}

fn connect(&mut self) -> Result<(), Self::Error> {
EspWifi::connect(self)
}

fn disconnect(&mut self) -> Result<(), Self::Error> {
EspWifi::disconnect(self)
}
}

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
Expand Down Expand Up @@ -1088,7 +1120,7 @@ where
EspRawWifi::is_started(self)
}

fn is_up(&self) -> Result<bool, Self::Error> {
fn is_connected(&self) -> Result<bool, Self::Error> {
EspRawWifi::is_up(self)
}

Expand All @@ -1109,6 +1141,22 @@ where
fn scan(&mut self) -> Result<alloc::vec::Vec<AccessPointInfo>, Self::Error> {
EspRawWifi::scan(self)
}

fn start(&mut self) -> Result<(), Self::Error> {
EspRawWifi::start(self)
}

fn stop(&mut self) -> Result<(), Self::Error> {
EspRawWifi::stop(self)
}

fn connect(&mut self) -> Result<(), Self::Error> {
EspRawWifi::connect(self)
}

fn disconnect(&mut self) -> Result<(), Self::Error> {
EspRawWifi::disconnect(self)
}
}

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
Expand Down

0 comments on commit 11bd59e

Please sign in to comment.