mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-12-29 20:51:10 +00:00
esp-radio: Rename Config to WifiApStaConfig and WifiConfig to Config (#4278)
* esp-radio: Rename Config to WifiApStaConfigi and WifiConfig to Config * mg * changelog * build error * remove WifiConfig entries from MG and changelog
This commit is contained in:
parent
2811ad9209
commit
952f5ffa47
@ -34,7 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Update bt-hci version to add additional HCI commands (#3920)
|
||||
- A number of enums/structs have been marked as `#[non_exhaustive]` (#3981, #4017)
|
||||
- `AuthMethod`, `Protocol`, `AccessPointInfo`, `AccessPointConfiguration`, `ClientConfiguration`, `Capability`, `Configuration`, `WifiEvent`, `InternalWifiError`, `ScanTypeConfig`, `WifiState`, and `WifiMode`
|
||||
- The `Configuration`, `ClientConfiguration`, `AccessPointConfiguration`, and `EapClientConfiguration` enums have been renamed to `Config`, `ClientConfig`, `AccessPointConfig`, and `EapClientConfig` (#3994)
|
||||
- The `Configuration`, `ClientConfiguration`, `AccessPointConfiguration`, and `EapClientConfiguration` enums have been renamed to `ModeConfig`, `ClientConfig`, `AccessPointConfig`, and `EapClientConfig` (#3994, #4278)
|
||||
- Error types implements `core::error:Error`
|
||||
- Use `esp-phy` internally for PHY initialization (#3892)
|
||||
- `ap_state()` and `sta_state()` marked as stable (#4017)
|
||||
|
||||
@ -83,7 +83,7 @@ The `scan_with_config_sync_max`, `scan_with_config_sync_max`, `scan_n`, and `sca
|
||||
+let (controller, ifaces) = esp_radio::wifi::new(&ctrl, p.WIFI, config).unwrap();
|
||||
```
|
||||
|
||||
The `Configuration`, `ClientConfiguration`, `AccessPointConfiguration`, and `EapClientConfiguration` enums have been renamed to `Config`, `ClientConfig`, `AccessPointConfig`, and `EapClientConfig`:
|
||||
The `Configuration`, `ClientConfiguration`, `AccessPointConfiguration`, and `EapClientConfiguration` enums have been renamed to `ModeConfig`, `ClientConfig`, `AccessPointConfig`, and `EapClientConfig`:
|
||||
|
||||
```diff
|
||||
use esp_radio::wifi::{
|
||||
@ -93,7 +93,7 @@ use esp_radio::wifi::{
|
||||
- EapClientConfiguration,
|
||||
+ AccessPointConfig,
|
||||
+ ClientConfig,
|
||||
+ Config,
|
||||
+ ModeConfig,
|
||||
+ EapClientConfig
|
||||
}
|
||||
```
|
||||
@ -113,7 +113,7 @@ Same for `set_configuration()` to `set_config()`:
|
||||
- config.ssid = "esp-radio".into();
|
||||
- config
|
||||
- });
|
||||
+ let ap_config = Config::AccessPoint(AccessPointConfig::default().with_ssid("esp-radio".into()));
|
||||
+ let ap_config = ModeConfig::AccessPoint(AccessPointConfig::default().with_ssid("esp-radio".into()));
|
||||
```
|
||||
|
||||
### BLE
|
||||
@ -146,7 +146,7 @@ The `BleController` can now be configured using `esp_radio::ble::Config`:
|
||||
- .with_password("password".into()),
|
||||
- AccessPointConfig::default().with_ssid("esp-radio".into()),
|
||||
- );
|
||||
+ let client_config = Config::ApSta(
|
||||
+ let client_config = ModeConfig::ApSta(
|
||||
+ ClientConfig::default()
|
||||
+ .with_ssid("ssid".into())
|
||||
+ .with_password("password".into()),
|
||||
|
||||
@ -899,7 +899,7 @@ pub enum Capability {
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
|
||||
#[non_exhaustive]
|
||||
pub enum Config {
|
||||
pub enum ModeConfig {
|
||||
/// No configuration (default).
|
||||
#[default]
|
||||
None,
|
||||
@ -919,20 +919,20 @@ pub enum Config {
|
||||
EapClient(EapClientConfig),
|
||||
}
|
||||
|
||||
impl Config {
|
||||
impl ModeConfig {
|
||||
fn validate(&self) -> Result<(), WifiError> {
|
||||
match self {
|
||||
Config::None => Ok(()),
|
||||
Config::Client(client_configuration) => client_configuration.validate(),
|
||||
Config::AccessPoint(access_point_configuration) => {
|
||||
ModeConfig::None => Ok(()),
|
||||
ModeConfig::Client(client_configuration) => client_configuration.validate(),
|
||||
ModeConfig::AccessPoint(access_point_configuration) => {
|
||||
access_point_configuration.validate()
|
||||
}
|
||||
Config::ApSta(client_configuration, access_point_configuration) => {
|
||||
ModeConfig::ApSta(client_configuration, access_point_configuration) => {
|
||||
client_configuration.validate()?;
|
||||
access_point_configuration.validate()
|
||||
}
|
||||
#[cfg(feature = "wifi-eap")]
|
||||
Config::EapClient(eap_client_configuration) => eap_client_configuration.validate(),
|
||||
ModeConfig::EapClient(eap_client_configuration) => eap_client_configuration.validate(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1012,18 +1012,18 @@ impl WifiMode {
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<&Config> for WifiMode {
|
||||
impl TryFrom<&ModeConfig> for WifiMode {
|
||||
type Error = WifiError;
|
||||
|
||||
/// Based on the current `Config`, derives a `WifiMode` based on it.
|
||||
fn try_from(config: &Config) -> Result<Self, Self::Error> {
|
||||
/// Based on the current `ModeConfig`, derives a `WifiMode` based on it.
|
||||
fn try_from(config: &ModeConfig) -> Result<Self, Self::Error> {
|
||||
let mode = match config {
|
||||
Config::None => return Err(WifiError::UnknownWifiMode),
|
||||
Config::AccessPoint(_) => Self::Ap,
|
||||
Config::Client(_) => Self::Sta,
|
||||
Config::ApSta(_, _) => Self::ApSta,
|
||||
ModeConfig::None => return Err(WifiError::UnknownWifiMode),
|
||||
ModeConfig::AccessPoint(_) => Self::Ap,
|
||||
ModeConfig::Client(_) => Self::Sta,
|
||||
ModeConfig::ApSta(_, _) => Self::ApSta,
|
||||
#[cfg(feature = "wifi-eap")]
|
||||
Config::EapClient(_) => Self::Sta,
|
||||
ModeConfig::EapClient(_) => Self::Sta,
|
||||
};
|
||||
|
||||
Ok(mode)
|
||||
@ -2693,7 +2693,7 @@ impl CountryInfo {
|
||||
/// Wi-Fi configuration.
|
||||
#[derive(Clone, Copy, BuilderLite, Debug)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
pub struct WifiConfig {
|
||||
pub struct Config {
|
||||
/// Power save mode.
|
||||
power_save_mode: PowerSaveMode,
|
||||
|
||||
@ -2793,7 +2793,7 @@ pub struct WifiConfig {
|
||||
rx_ba_win: u8,
|
||||
}
|
||||
|
||||
impl Default for WifiConfig {
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
power_save_mode: PowerSaveMode::default(),
|
||||
@ -2817,7 +2817,7 @@ impl Default for WifiConfig {
|
||||
}
|
||||
}
|
||||
|
||||
impl WifiConfig {
|
||||
impl Config {
|
||||
fn validate(&self) {
|
||||
if self.rx_ba_win as u16 >= self.dynamic_rx_buf_num {
|
||||
warn!("RX BA window size should be less than the number of dynamic RX buffers.");
|
||||
@ -2837,7 +2837,7 @@ impl WifiConfig {
|
||||
pub fn new<'d>(
|
||||
_inited: &'d Controller<'d>,
|
||||
device: crate::hal::peripherals::WIFI<'d>,
|
||||
config: WifiConfig,
|
||||
config: Config,
|
||||
) -> Result<(WifiController<'d>, Interfaces<'d>), WifiError> {
|
||||
if crate::is_interrupts_disabled() {
|
||||
return Err(WifiError::Unsupported);
|
||||
@ -3135,42 +3135,42 @@ impl WifiController<'_> {
|
||||
/// This will set the mode accordingly.
|
||||
/// You need to use Wifi::connect() for connecting to an AP.
|
||||
///
|
||||
/// Passing [Config::None] will disable both, AP and STA mode.
|
||||
/// Passing [ModeConfig::None] will disable both, AP and STA mode.
|
||||
///
|
||||
/// If you don't intend to use Wi-Fi anymore at all consider tearing down
|
||||
/// Wi-Fi completely.
|
||||
pub fn set_config(&mut self, conf: &Config) -> Result<(), WifiError> {
|
||||
pub fn set_config(&mut self, conf: &ModeConfig) -> Result<(), WifiError> {
|
||||
conf.validate()?;
|
||||
|
||||
let mode = match conf {
|
||||
Config::None => wifi_mode_t_WIFI_MODE_NULL,
|
||||
Config::Client(_) => wifi_mode_t_WIFI_MODE_STA,
|
||||
Config::AccessPoint(_) => wifi_mode_t_WIFI_MODE_AP,
|
||||
Config::ApSta(_, _) => wifi_mode_t_WIFI_MODE_APSTA,
|
||||
ModeConfig::None => wifi_mode_t_WIFI_MODE_NULL,
|
||||
ModeConfig::Client(_) => wifi_mode_t_WIFI_MODE_STA,
|
||||
ModeConfig::AccessPoint(_) => wifi_mode_t_WIFI_MODE_AP,
|
||||
ModeConfig::ApSta(_, _) => wifi_mode_t_WIFI_MODE_APSTA,
|
||||
#[cfg(feature = "wifi-eap")]
|
||||
Config::EapClient(_) => wifi_mode_t_WIFI_MODE_STA,
|
||||
ModeConfig::EapClient(_) => wifi_mode_t_WIFI_MODE_STA,
|
||||
};
|
||||
|
||||
esp_wifi_result!(unsafe { esp_wifi_set_mode(mode) })?;
|
||||
|
||||
match conf {
|
||||
Config::None => Ok(()),
|
||||
Config::Client(config) => {
|
||||
ModeConfig::None => Ok(()),
|
||||
ModeConfig::Client(config) => {
|
||||
self.apply_sta_config(config)?;
|
||||
Self::apply_protocols(wifi_interface_t_WIFI_IF_STA, &config.protocols)
|
||||
}
|
||||
Config::AccessPoint(config) => {
|
||||
ModeConfig::AccessPoint(config) => {
|
||||
self.apply_ap_config(config)?;
|
||||
Self::apply_protocols(wifi_interface_t_WIFI_IF_AP, &config.protocols)
|
||||
}
|
||||
Config::ApSta(sta_config, ap_config) => {
|
||||
ModeConfig::ApSta(sta_config, ap_config) => {
|
||||
self.apply_ap_config(ap_config)?;
|
||||
Self::apply_protocols(wifi_interface_t_WIFI_IF_AP, &ap_config.protocols)?;
|
||||
self.apply_sta_config(sta_config)?;
|
||||
Self::apply_protocols(wifi_interface_t_WIFI_IF_STA, &sta_config.protocols)
|
||||
}
|
||||
#[cfg(feature = "wifi-eap")]
|
||||
Config::EapClient(config) => {
|
||||
ModeConfig::EapClient(config) => {
|
||||
self.apply_sta_eap_config(config)?;
|
||||
Self::apply_protocols(wifi_interface_t_WIFI_IF_STA, &config.protocols)
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ use esp_hal::{
|
||||
use esp_println::{print, println};
|
||||
use esp_radio::wifi::{
|
||||
AccessPointConfig,
|
||||
Config,
|
||||
ModeConfig,
|
||||
event::{self, EventExt},
|
||||
};
|
||||
use smoltcp::iface::{SocketSet, SocketStorage};
|
||||
@ -88,7 +88,8 @@ fn main() -> ! {
|
||||
let socket_set = SocketSet::new(&mut socket_set_entries[..]);
|
||||
let mut stack = Stack::new(iface, device, socket_set, now, rng.random());
|
||||
|
||||
let ap_config = Config::AccessPoint(AccessPointConfig::default().with_ssid("esp-radio".into()));
|
||||
let ap_config =
|
||||
ModeConfig::AccessPoint(AccessPointConfig::default().with_ssid("esp-radio".into()));
|
||||
let res = controller.set_config(&ap_config);
|
||||
println!("wifi_set_configuration returned {:?}", res);
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ use esp_hal::{
|
||||
timer::timg::TimerGroup,
|
||||
};
|
||||
use esp_println::{print, println};
|
||||
use esp_radio::wifi::{AccessPointConfig, ClientConfig, Config};
|
||||
use esp_radio::wifi::{AccessPointConfig, ClientConfig, ModeConfig};
|
||||
use smoltcp::{
|
||||
iface::{SocketSet, SocketStorage},
|
||||
wire::IpAddress,
|
||||
@ -81,7 +81,7 @@ fn main() -> ! {
|
||||
sta_socket_set.add(smoltcp::socket::dhcpv4::Socket::new());
|
||||
let sta_stack = Stack::new(sta_interface, sta_device, sta_socket_set, now, rng.random());
|
||||
|
||||
let client_config = Config::ApSta(
|
||||
let client_config = ModeConfig::ApSta(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
@ -41,7 +41,7 @@ use esp_hal::{
|
||||
use esp_println::{print, println};
|
||||
use esp_radio::{
|
||||
ble::controller::BleConnector,
|
||||
wifi::{ClientConfig, Config},
|
||||
wifi::{ClientConfig, ModeConfig},
|
||||
};
|
||||
use smoltcp::{
|
||||
iface::{SocketSet, SocketStorage},
|
||||
@ -130,7 +130,7 @@ fn main() -> ! {
|
||||
let rng = Rng::new();
|
||||
let stack = Stack::new(iface, device, socket_set, now, rng.random());
|
||||
|
||||
let client_config = Config::Client(
|
||||
let client_config = ModeConfig::Client(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
@ -27,7 +27,7 @@ use esp_hal::{
|
||||
timer::timg::TimerGroup,
|
||||
};
|
||||
use esp_println::{print, println};
|
||||
use esp_radio::wifi::{ClientConfig, Config, ScanConfig};
|
||||
use esp_radio::wifi::{ClientConfig, ModeConfig, ScanConfig};
|
||||
use smoltcp::{
|
||||
iface::{SocketSet, SocketStorage},
|
||||
wire::{DhcpOption, IpAddress},
|
||||
@ -82,7 +82,7 @@ fn main() -> ! {
|
||||
.set_power_saving(esp_radio::wifi::PowerSaveMode::None)
|
||||
.unwrap();
|
||||
|
||||
let client_config = Config::Client(
|
||||
let client_config = ModeConfig::Client(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
@ -34,7 +34,7 @@ use esp_hal::{clock::CpuClock, ram, rng::Rng, timer::timg::TimerGroup};
|
||||
use esp_println::{print, println};
|
||||
use esp_radio::{
|
||||
Controller,
|
||||
wifi::{AccessPointConfig, Config, WifiApState, WifiController, WifiDevice, WifiEvent},
|
||||
wifi::{AccessPointConfig, ModeConfig, WifiApState, WifiController, WifiDevice, WifiEvent},
|
||||
};
|
||||
|
||||
esp_bootloader_esp_idf::esp_app_desc!();
|
||||
@ -249,7 +249,7 @@ async fn connection(mut controller: WifiController<'static>) {
|
||||
}
|
||||
if !matches!(controller.is_started(), Ok(true)) {
|
||||
let client_config =
|
||||
Config::AccessPoint(AccessPointConfig::default().with_ssid("esp-radio".into()));
|
||||
ModeConfig::AccessPoint(AccessPointConfig::default().with_ssid("esp-radio".into()));
|
||||
controller.set_config(&client_config).unwrap();
|
||||
println!("Starting wifi");
|
||||
controller.start_async().await.unwrap();
|
||||
|
||||
@ -43,7 +43,7 @@ use esp_radio::{
|
||||
wifi::{
|
||||
AccessPointConfig,
|
||||
ClientConfig,
|
||||
Config,
|
||||
ModeConfig,
|
||||
WifiApState,
|
||||
WifiController,
|
||||
WifiDevice,
|
||||
@ -116,7 +116,7 @@ async fn main(spawner: Spawner) -> ! {
|
||||
seed,
|
||||
);
|
||||
|
||||
let client_config = Config::ApSta(
|
||||
let client_config = ModeConfig::ApSta(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
@ -22,7 +22,15 @@ use esp_hal::{clock::CpuClock, ram, rng::Rng, timer::timg::TimerGroup};
|
||||
use esp_println::println;
|
||||
use esp_radio::{
|
||||
Controller,
|
||||
wifi::{ClientConfig, Config, ScanConfig, WifiController, WifiDevice, WifiEvent, WifiStaState},
|
||||
wifi::{
|
||||
ClientConfig,
|
||||
ModeConfig,
|
||||
ScanConfig,
|
||||
WifiController,
|
||||
WifiDevice,
|
||||
WifiEvent,
|
||||
WifiStaState,
|
||||
},
|
||||
};
|
||||
|
||||
esp_bootloader_esp_idf::esp_app_desc!();
|
||||
@ -156,7 +164,7 @@ async fn connection(mut controller: WifiController<'static>) {
|
||||
_ => {}
|
||||
}
|
||||
if !matches!(controller.is_started(), Ok(true)) {
|
||||
let client_config = Config::Client(
|
||||
let client_config = ModeConfig::Client(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
@ -28,7 +28,15 @@ use esp_hal::{clock::CpuClock, rng::Rng, rtc_cntl::Rtc, timer::timg::TimerGroup}
|
||||
use esp_println::println;
|
||||
use esp_radio::{
|
||||
Controller,
|
||||
wifi::{ClientConfig, Config, ScanConfig, WifiController, WifiDevice, WifiEvent, WifiStaState},
|
||||
wifi::{
|
||||
ClientConfig,
|
||||
ModeConfig,
|
||||
ScanConfig,
|
||||
WifiController,
|
||||
WifiDevice,
|
||||
WifiEvent,
|
||||
WifiStaState,
|
||||
},
|
||||
};
|
||||
use log::{error, info};
|
||||
use sntpc::{NtpContext, NtpTimestampGenerator, get_time};
|
||||
@ -213,7 +221,7 @@ async fn connection(mut controller: WifiController<'static>) {
|
||||
Timer::after(Duration::from_millis(5000)).await
|
||||
}
|
||||
if !matches!(controller.is_started(), Ok(true)) {
|
||||
let client_config = Config::Client(
|
||||
let client_config = ModeConfig::Client(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
@ -23,7 +23,7 @@ use esp_hal::{
|
||||
timer::timg::TimerGroup,
|
||||
};
|
||||
use esp_println::{print, println};
|
||||
use esp_radio::wifi::{ClientConfig, Config, ScanConfig};
|
||||
use esp_radio::wifi::{ClientConfig, ModeConfig, ScanConfig};
|
||||
use smoltcp::iface::{SocketSet, SocketStorage};
|
||||
|
||||
esp_bootloader_esp_idf::esp_app_desc!();
|
||||
@ -70,7 +70,7 @@ fn main() -> ! {
|
||||
let now = || time::Instant::now().duration_since_epoch().as_millis();
|
||||
let mut stack = Stack::new(iface, device, socket_set, now, rng.random());
|
||||
|
||||
let client_config = Config::Client(
|
||||
let client_config = ModeConfig::Client(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
@ -31,7 +31,7 @@ use esp_hal::{clock::CpuClock, ram, rng::Rng, timer::timg::TimerGroup};
|
||||
use esp_println::println;
|
||||
use esp_radio::{
|
||||
Controller,
|
||||
wifi::{ClientConfig, Config, WifiController, WifiDevice, WifiEvent, WifiStaState},
|
||||
wifi::{ClientConfig, ModeConfig, WifiController, WifiDevice, WifiEvent, WifiStaState},
|
||||
};
|
||||
|
||||
esp_bootloader_esp_idf::esp_app_desc!();
|
||||
@ -154,7 +154,7 @@ async fn connection(mut controller: WifiController<'static>) {
|
||||
_ => {}
|
||||
}
|
||||
if !matches!(controller.is_started(), Ok(true)) {
|
||||
let client_config = Config::Client(
|
||||
let client_config = ModeConfig::Client(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
@ -27,7 +27,7 @@ use esp_radio::{
|
||||
Controller,
|
||||
wifi::{
|
||||
ClientConfig,
|
||||
Config as WifiConfig,
|
||||
ModeConfig,
|
||||
WifiController,
|
||||
WifiDevice,
|
||||
WifiEvent,
|
||||
@ -69,7 +69,7 @@ async fn connection_manager(
|
||||
println!("📡 Starting WiFi connection manager");
|
||||
|
||||
if !matches!(controller.is_started(), Ok(true)) {
|
||||
let client_config = WifiConfig::Client(
|
||||
let client_config = ModeConfig::Client(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
@ -24,7 +24,7 @@ use esp_hal::{
|
||||
timer::timg::TimerGroup,
|
||||
};
|
||||
use esp_println::println;
|
||||
use esp_radio::wifi::{ClientConfig, ScanConfig, WifiConfig, WifiMode};
|
||||
use esp_radio::wifi::{ClientConfig, Config, ModeConfig, ScanConfig, WifiMode};
|
||||
|
||||
esp_bootloader_esp_idf::esp_app_desc!();
|
||||
|
||||
@ -52,7 +52,7 @@ async fn main(_spawner: Spawner) {
|
||||
let (mut controller, _interfaces) = esp_radio::wifi::new(
|
||||
esp_wifi_ctrl,
|
||||
peripherals.WIFI.reborrow(),
|
||||
WifiConfig::default(),
|
||||
Config::default(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
@ -109,7 +109,7 @@ async fn main(_spawner: Spawner) {
|
||||
println!("Best AP found: {:?}", best_one);
|
||||
println!("Connecting to WiFi SSID: {}", SSID);
|
||||
|
||||
let client_config = esp_radio::wifi::Config::Client(
|
||||
let client_config = ModeConfig::Client(
|
||||
ClientConfig::default()
|
||||
.with_ssid(best_one.ssid.clone())
|
||||
.with_bssid(best_one.bssid)
|
||||
|
||||
@ -34,7 +34,7 @@ use esp_hal::{
|
||||
timer::timg::TimerGroup,
|
||||
};
|
||||
use esp_println::println;
|
||||
use esp_radio::wifi::{ClientConfig, Config, ScanConfig};
|
||||
use esp_radio::wifi::{ClientConfig, ModeConfig, ScanConfig};
|
||||
use smoltcp::{
|
||||
iface::{SocketSet, SocketStorage},
|
||||
wire::{DhcpOption, IpAddress},
|
||||
@ -101,7 +101,7 @@ fn main() -> ! {
|
||||
let now = || time::Instant::now().duration_since_epoch().as_millis();
|
||||
let stack = Stack::new(iface, device, socket_set, now, rng.random());
|
||||
|
||||
let client_config = Config::Client(
|
||||
let client_config = ModeConfig::Client(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
@ -18,7 +18,7 @@ use esp_backtrace as _;
|
||||
use esp_hal::interrupt::software::SoftwareInterruptControl;
|
||||
use esp_hal::{clock::CpuClock, main, rng::Rng, time, timer::timg::TimerGroup};
|
||||
use esp_println::println;
|
||||
use esp_radio::wifi::{ClientConfig, Config, CsiConfig, ScanConfig};
|
||||
use esp_radio::wifi::{ClientConfig, CsiConfig, ModeConfig, ScanConfig};
|
||||
use smoltcp::{
|
||||
iface::{SocketSet, SocketStorage},
|
||||
wire::DhcpOption,
|
||||
@ -68,7 +68,7 @@ fn main() -> ! {
|
||||
let now = || time::Instant::now().duration_since_epoch().as_millis();
|
||||
let stack = Stack::new(iface, device, socket_set, now, rng.random());
|
||||
|
||||
let client_config = Config::Client(
|
||||
let client_config = ModeConfig::Client(
|
||||
ClientConfig::default()
|
||||
.with_ssid(SSID.into())
|
||||
.with_password(PASSWORD.into()),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user