diff options
| author | JuliDi <[email protected]> | 2023-09-09 09:50:24 +0200 |
|---|---|---|
| committer | JuliDi <[email protected]> | 2023-09-09 09:50:24 +0200 |
| commit | 40a18b075dc80048233c54f5cff80658405a9050 (patch) | |
| tree | 91b1dc52780721740356090c2f82b3a049479b2c /embassy-net/src | |
| parent | cf2d4eca7c3a3f53aa57a7d9a53de490962019cf (diff) | |
improve docstring
Diffstat (limited to 'embassy-net/src')
| -rw-r--r-- | embassy-net/src/lib.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index 4922490d9..87247c8e1 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs | |||
| @@ -367,13 +367,12 @@ impl<D: Driver + 'static> Stack<D> { | |||
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | /// Wait for the network stack to obtain a valid IP configuration. | 369 | /// Wait for the network stack to obtain a valid IP configuration. |
| 370 | /// Returns instantly if [`Stack::is_config_up`] returns `true`. | ||
| 371 | /// | 370 | /// |
| 372 | /// ## Watch out: | 371 | /// ## Notes: |
| 373 | /// The Future is polled only when the [`Stack`] is running, | 372 | /// - Ensure [`Stack::run`] has been called before using this function. |
| 374 | /// e.g. call `spawner.spawn(net_task(stack))`. | ||
| 375 | /// | 373 | /// |
| 376 | /// `await`ing before will never yield! | 374 | /// - This function may never yield (e.g. if no configuration is obtained through DHCP). |
| 375 | /// The caller is supposed to handle a timeout for this case. | ||
| 377 | /// | 376 | /// |
| 378 | /// ## Example | 377 | /// ## Example |
| 379 | /// ```ignore | 378 | /// ```ignore |
| @@ -385,7 +384,7 @@ impl<D: Driver + 'static> Stack<D> { | |||
| 385 | /// make_static!(embassy_net::StackResources::<2>::new()), | 384 | /// make_static!(embassy_net::StackResources::<2>::new()), |
| 386 | /// seed | 385 | /// seed |
| 387 | /// )); | 386 | /// )); |
| 388 | /// // Launch network task | 387 | /// // Launch network task that runs `stack.run().await` |
| 389 | /// spawner.spawn(net_task(stack)).unwrap(); | 388 | /// spawner.spawn(net_task(stack)).unwrap(); |
| 390 | /// // Wait for DHCP config | 389 | /// // Wait for DHCP config |
| 391 | /// stack.wait_config_up().await; | 390 | /// stack.wait_config_up().await; |
