improve docstring
This commit is contained in:
parent
cf2d4eca7c
commit
40a18b075d
@ -367,13 +367,12 @@ impl<D: Driver + 'static> Stack<D> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Wait for the network stack to obtain a valid IP configuration.
|
/// Wait for the network stack to obtain a valid IP configuration.
|
||||||
/// Returns instantly if [`Stack::is_config_up`] returns `true`.
|
|
||||||
///
|
///
|
||||||
/// ## Watch out:
|
/// ## Notes:
|
||||||
/// The Future is polled only when the [`Stack`] is running,
|
/// - Ensure [`Stack::run`] has been called before using this function.
|
||||||
/// e.g. call `spawner.spawn(net_task(stack))`.
|
|
||||||
///
|
///
|
||||||
/// `await`ing before will never yield!
|
/// - This function may never yield (e.g. if no configuration is obtained through DHCP).
|
||||||
|
/// The caller is supposed to handle a timeout for this case.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
@ -385,7 +384,7 @@ impl<D: Driver + 'static> Stack<D> {
|
|||||||
/// make_static!(embassy_net::StackResources::<2>::new()),
|
/// make_static!(embassy_net::StackResources::<2>::new()),
|
||||||
/// seed
|
/// seed
|
||||||
/// ));
|
/// ));
|
||||||
/// // Launch network task
|
/// // Launch network task that runs `stack.run().await`
|
||||||
/// spawner.spawn(net_task(stack)).unwrap();
|
/// spawner.spawn(net_task(stack)).unwrap();
|
||||||
/// // Wait for DHCP config
|
/// // Wait for DHCP config
|
||||||
/// stack.wait_config_up().await;
|
/// stack.wait_config_up().await;
|
||||||
|
Loading…
Reference in New Issue
Block a user