mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
add wait_config_up to examples
This commit is contained in:
parent
3e0b752bef
commit
cf2d4eca7c
@ -79,7 +79,10 @@ async fn main(spawner: Spawner) -> ! {
|
||||
));
|
||||
|
||||
// Launch network task
|
||||
unwrap!(spawner.spawn(net_task(&stack)));
|
||||
unwrap!(spawner.spawn(net_task(stack)));
|
||||
|
||||
// Ensure DHCP configuration is up before trying connect
|
||||
stack.wait_config_up().await;
|
||||
|
||||
info!("Network task initialized");
|
||||
|
||||
|
@ -80,7 +80,10 @@ async fn main(spawner: Spawner) -> ! {
|
||||
));
|
||||
|
||||
// Launch network task
|
||||
unwrap!(spawner.spawn(net_task(&stack)));
|
||||
unwrap!(spawner.spawn(net_task(stack)));
|
||||
|
||||
// Ensure DHCP configuration is up before trying connect
|
||||
stack.wait_config_up().await;
|
||||
|
||||
info!("Network task initialized");
|
||||
|
||||
|
@ -101,6 +101,9 @@ async fn main(spawner: Spawner) -> ! {
|
||||
// Launch network task
|
||||
unwrap!(spawner.spawn(net_task(&stack)));
|
||||
|
||||
// Ensure DHCP configuration is up before trying connect
|
||||
stack.wait_config_up().await;
|
||||
|
||||
info!("Network task initialized");
|
||||
|
||||
// Then we can use it!
|
||||
|
@ -83,6 +83,9 @@ async fn main(spawner: Spawner) -> ! {
|
||||
// Launch network task
|
||||
unwrap!(spawner.spawn(net_task(&stack)));
|
||||
|
||||
// Ensure DHCP configuration is up before trying connect
|
||||
stack.wait_config_up().await;
|
||||
|
||||
info!("Network task initialized");
|
||||
|
||||
// Then we can use it!
|
||||
|
@ -82,13 +82,13 @@ async fn main(spawner: Spawner) -> ! {
|
||||
));
|
||||
|
||||
// Launch network task
|
||||
unwrap!(spawner.spawn(net_task(&stack)));
|
||||
unwrap!(spawner.spawn(net_task(stack)));
|
||||
|
||||
// Ensure DHCP configuration is up before trying connect
|
||||
stack.wait_config_up().await;
|
||||
|
||||
info!("Network task initialized");
|
||||
|
||||
// To ensure DHCP configuration before trying connect
|
||||
Timer::after(Duration::from_secs(20)).await;
|
||||
|
||||
static STATE: TcpClientState<1, 1024, 1024> = TcpClientState::new();
|
||||
let client = TcpClient::new(&stack, &STATE);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user