sta config mode
This commit is contained in:
@@ -307,7 +307,10 @@ impl Esp<'_> {
|
||||
bssid: None,
|
||||
channel: None,
|
||||
show_hidden: false,
|
||||
scan_type: ScanTypeConfig::Passive(core::time::Duration::from_secs(2)),
|
||||
scan_type: ScanTypeConfig::Active {
|
||||
min: Default::default(),
|
||||
max: Default::default(),
|
||||
},
|
||||
};
|
||||
let rv = lock.scan_with_config_async(scan_config).await?;
|
||||
info!("end wifi scan lock");
|
||||
@@ -499,6 +502,7 @@ impl Esp<'_> {
|
||||
}
|
||||
Timer::after(Duration::from_millis(500)).await;
|
||||
}
|
||||
let timeout = TIME_ACCESS.get().await.current_time_us() + max_wait as u64 * 1000;
|
||||
loop {
|
||||
let state = esp_wifi::wifi::sta_state();
|
||||
println!("waiting wifi sta connected {:?}", state);
|
||||
@@ -518,6 +522,7 @@ impl Esp<'_> {
|
||||
}
|
||||
Timer::after(Duration::from_millis(500)).await;
|
||||
}
|
||||
let timeout = TIME_ACCESS.get().await.current_time_us() + max_wait as u64 * 1000;
|
||||
while !stack.is_link_up() {
|
||||
if TIME_ACCESS.get().await.current_time_us() > timeout {
|
||||
bail!("Timeout waiting for wifi link up")
|
||||
@@ -525,6 +530,7 @@ impl Esp<'_> {
|
||||
println!("waiting for wifi link up");
|
||||
Timer::after(Duration::from_millis(500)).await;
|
||||
}
|
||||
let timeout = TIME_ACCESS.get().await.current_time_us() + max_wait as u64 * 1000;
|
||||
while !stack.is_config_up() {
|
||||
if TIME_ACCESS.get().await.current_time_us() > timeout {
|
||||
bail!("Timeout waiting for wifi config up")
|
||||
|
||||
Reference in New Issue
Block a user