diff options
| author | Ruben De Smet <[email protected]> | 2023-06-07 12:04:15 +0200 |
|---|---|---|
| committer | Ruben De Smet <[email protected]> | 2023-06-07 13:18:19 +0200 |
| commit | 352f0b6c3823797576c36f417d6be40189bca5d5 (patch) | |
| tree | 4dc2111b5c797883756fd55329b6af1f02c1d1d5 /examples/std | |
| parent | ca47af6978e85012ff70a98726fcb63ed985109d (diff) | |
net: Support dual stackĀ IP
Diffstat (limited to 'examples/std')
| -rw-r--r-- | examples/std/src/bin/net.rs | 4 | ||||
| -rw-r--r-- | examples/std/src/bin/net_dns.rs | 4 | ||||
| -rw-r--r-- | examples/std/src/bin/net_udp.rs | 4 | ||||
| -rw-r--r-- | examples/std/src/bin/tcp_accept.rs | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs index 14cf3f25b..3aadb029d 100644 --- a/examples/std/src/bin/net.rs +++ b/examples/std/src/bin/net.rs | |||
| @@ -42,13 +42,13 @@ async fn main_task(spawner: Spawner) { | |||
| 42 | 42 | ||
| 43 | // Choose between dhcp or static ip | 43 | // Choose between dhcp or static ip |
| 44 | let config = if opts.static_ip { | 44 | let config = if opts.static_ip { |
| 45 | Config::StaticV4(embassy_net::StaticConfigV4 { | 45 | Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 46 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), | 46 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), |
| 47 | dns_servers: Vec::new(), | 47 | dns_servers: Vec::new(), |
| 48 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), | 48 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), |
| 49 | }) | 49 | }) |
| 50 | } else { | 50 | } else { |
| 51 | Config::Dhcp(Default::default()) | 51 | Config::dhcpv4(Default::default()) |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | // Generate random seed | 54 | // Generate random seed |
diff --git a/examples/std/src/bin/net_dns.rs b/examples/std/src/bin/net_dns.rs index 0a479a744..65b5a2cd9 100644 --- a/examples/std/src/bin/net_dns.rs +++ b/examples/std/src/bin/net_dns.rs | |||
| @@ -40,14 +40,14 @@ async fn main_task(spawner: Spawner) { | |||
| 40 | 40 | ||
| 41 | // Choose between dhcp or static ip | 41 | // Choose between dhcp or static ip |
| 42 | let config = if opts.static_ip { | 42 | let config = if opts.static_ip { |
| 43 | Config::StaticV4(embassy_net::StaticConfigV4 { | 43 | Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 44 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 1), 24), | 44 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 1), 24), |
| 45 | dns_servers: Vec::from_slice(&[Ipv4Address::new(8, 8, 4, 4).into(), Ipv4Address::new(8, 8, 8, 8).into()]) | 45 | dns_servers: Vec::from_slice(&[Ipv4Address::new(8, 8, 4, 4).into(), Ipv4Address::new(8, 8, 8, 8).into()]) |
| 46 | .unwrap(), | 46 | .unwrap(), |
| 47 | gateway: Some(Ipv4Address::new(192, 168, 69, 100)), | 47 | gateway: Some(Ipv4Address::new(192, 168, 69, 100)), |
| 48 | }) | 48 | }) |
| 49 | } else { | 49 | } else { |
| 50 | Config::Dhcp(Default::default()) | 50 | Config::dhcpv4(Default::default()) |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | // Generate random seed | 53 | // Generate random seed |
diff --git a/examples/std/src/bin/net_udp.rs b/examples/std/src/bin/net_udp.rs index 0ede5d998..3fc46156c 100644 --- a/examples/std/src/bin/net_udp.rs +++ b/examples/std/src/bin/net_udp.rs | |||
| @@ -38,13 +38,13 @@ async fn main_task(spawner: Spawner) { | |||
| 38 | 38 | ||
| 39 | // Choose between dhcp or static ip | 39 | // Choose between dhcp or static ip |
| 40 | let config = if opts.static_ip { | 40 | let config = if opts.static_ip { |
| 41 | Config::StaticV4(embassy_net::StaticConfigV4 { | 41 | Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 42 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), | 42 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), |
| 43 | dns_servers: Vec::new(), | 43 | dns_servers: Vec::new(), |
| 44 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), | 44 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), |
| 45 | }) | 45 | }) |
| 46 | } else { | 46 | } else { |
| 47 | Config::Dhcp(Default::default()) | 47 | Config::dhcpv4(Default::default()) |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | // Generate random seed | 50 | // Generate random seed |
diff --git a/examples/std/src/bin/tcp_accept.rs b/examples/std/src/bin/tcp_accept.rs index 4379d0439..df09986ac 100644 --- a/examples/std/src/bin/tcp_accept.rs +++ b/examples/std/src/bin/tcp_accept.rs | |||
| @@ -53,13 +53,13 @@ async fn main_task(spawner: Spawner) { | |||
| 53 | 53 | ||
| 54 | // Choose between dhcp or static ip | 54 | // Choose between dhcp or static ip |
| 55 | let config = if opts.static_ip { | 55 | let config = if opts.static_ip { |
| 56 | Config::StaticV4(embassy_net::StaticConfigV4 { | 56 | Config::ipv4_static(embassy_net::StaticConfigV4 { |
| 57 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), | 57 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), |
| 58 | dns_servers: Vec::new(), | 58 | dns_servers: Vec::new(), |
| 59 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), | 59 | gateway: Some(Ipv4Address::new(192, 168, 69, 1)), |
| 60 | }) | 60 | }) |
| 61 | } else { | 61 | } else { |
| 62 | Config::Dhcp(Default::default()) | 62 | Config::dhcpv4(Default::default()) |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | // Generate random seed | 65 | // Generate random seed |
