net: StaticV4 config behind proto-ipv4

This commit is contained in:
Ruben De Smet
2023-06-05 16:00:53 +02:00
parent 54bab33c73
commit e871324bde
8 changed files with 47 additions and 16 deletions

View File

@ -122,7 +122,7 @@ async fn listen_task(stack: &'static Stack<Device<'static>>, id: u8, port: u16)
async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 {
loop {
if let Some(config) = stack.config() {
if let Some(config) = stack.config_v4() {
return config.clone();
}
yield_now().await;

View File

@ -110,7 +110,7 @@ async fn main(spawner: Spawner) {
async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 {
loop {
if let Some(config) = stack.config() {
if let Some(config) = stack.config_v4() {
return config.clone();
}
yield_now().await;

View File

@ -118,7 +118,7 @@ async fn main(spawner: Spawner) {
async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 {
loop {
if let Some(config) = stack.config() {
if let Some(config) = stack.config_v4() {
return config.clone();
}
yield_now().await;

View File

@ -97,7 +97,7 @@ async fn main(spawner: Spawner) {
async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 {
loop {
if let Some(config) = stack.config() {
if let Some(config) = stack.config_v4() {
return config.clone();
}
yield_now().await;