add wait_config_up to examples
This commit is contained in:
parent
3e0b752bef
commit
cf2d4eca7c
5 changed files with 18 additions and 6 deletions
|
@ -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 a new issue