diff options
| author | Ruben De Smet <[email protected]> | 2023-06-05 14:57:17 +0200 |
|---|---|---|
| committer | Ruben De Smet <[email protected]> | 2023-06-06 17:04:21 +0200 |
| commit | 54bab33c7342510be538bc6d8545fe50146557cf (patch) | |
| tree | bafd49491fd9e40bc1a53b083c690406b1122899 /examples | |
| parent | 44624b2d7a15ccc94971fc8d2091800f67821c58 (diff) | |
Rename StaticConfig to StaticConfigV4
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf52840/src/bin/usb_ethernet.rs | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_multisocket.rs | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_tcp_client.rs | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_tcp_server.rs | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/ethernet_w5500_udp.rs | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/usb_ethernet.rs | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/wifi_ap_tcp_server.rs | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/wifi_tcp_server.rs | 2 | ||||
| -rw-r--r-- | examples/std/src/bin/net.rs | 2 | ||||
| -rw-r--r-- | examples/std/src/bin/net_dns.rs | 2 | ||||
| -rw-r--r-- | examples/std/src/bin/net_udp.rs | 2 | ||||
| -rw-r--r-- | examples/std/src/bin/tcp_accept.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/usb_ethernet.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f7/src/bin/eth.rs | 2 | ||||
| -rw-r--r-- | examples/stm32h5/src/bin/eth.rs | 2 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/eth.rs | 2 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/eth_client.rs | 2 | ||||
| -rw-r--r-- | examples/stm32l5/src/bin/usb_ethernet.rs | 2 |
18 files changed, 18 insertions, 18 deletions
diff --git a/examples/nrf52840/src/bin/usb_ethernet.rs b/examples/nrf52840/src/bin/usb_ethernet.rs index 1065f5b5d..b4316f5a4 100644 --- a/examples/nrf52840/src/bin/usb_ethernet.rs +++ b/examples/nrf52840/src/bin/usb_ethernet.rs | |||
| @@ -98,7 +98,7 @@ async fn main(spawner: Spawner) { | |||
| 98 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 98 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 99 | 99 | ||
| 100 | let config = embassy_net::Config::Dhcp(Default::default()); | 100 | let config = embassy_net::Config::Dhcp(Default::default()); |
| 101 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 101 | //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { |
| 102 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 102 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 103 | // dns_servers: Vec::new(), | 103 | // dns_servers: Vec::new(), |
| 104 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 104 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/rp/src/bin/ethernet_w5500_multisocket.rs b/examples/rp/src/bin/ethernet_w5500_multisocket.rs index 63e142e7d..7e9e20b28 100644 --- a/examples/rp/src/bin/ethernet_w5500_multisocket.rs +++ b/examples/rp/src/bin/ethernet_w5500_multisocket.rs | |||
| @@ -120,7 +120,7 @@ async fn listen_task(stack: &'static Stack<Device<'static>>, id: u8, port: u16) | |||
| 120 | } | 120 | } |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfig { | 123 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 { |
| 124 | loop { | 124 | loop { |
| 125 | if let Some(config) = stack.config() { | 125 | if let Some(config) = stack.config() { |
| 126 | return config.clone(); | 126 | return config.clone(); |
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs index a532de00d..c0275be1b 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs | |||
| @@ -108,7 +108,7 @@ async fn main(spawner: Spawner) { | |||
| 108 | } | 108 | } |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfig { | 111 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 { |
| 112 | loop { | 112 | loop { |
| 113 | if let Some(config) = stack.config() { | 113 | if let Some(config) = stack.config() { |
| 114 | return config.clone(); | 114 | return config.clone(); |
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs index 599f6b1e9..da73e41ff 100644 --- a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs +++ b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs | |||
| @@ -116,7 +116,7 @@ async fn main(spawner: Spawner) { | |||
| 116 | } | 116 | } |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfig { | 119 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 { |
| 120 | loop { | 120 | loop { |
| 121 | if let Some(config) = stack.config() { | 121 | if let Some(config) = stack.config() { |
| 122 | return config.clone(); | 122 | return config.clone(); |
diff --git a/examples/rp/src/bin/ethernet_w5500_udp.rs b/examples/rp/src/bin/ethernet_w5500_udp.rs index ac5a65bb6..4c861cbd2 100644 --- a/examples/rp/src/bin/ethernet_w5500_udp.rs +++ b/examples/rp/src/bin/ethernet_w5500_udp.rs | |||
| @@ -95,7 +95,7 @@ async fn main(spawner: Spawner) { | |||
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfig { | 98 | async fn wait_for_config(stack: &'static Stack<Device<'static>>) -> embassy_net::StaticConfigV4 { |
| 99 | loop { | 99 | loop { |
| 100 | if let Some(config) = stack.config() { | 100 | if let Some(config) = stack.config() { |
| 101 | return config.clone(); | 101 | return config.clone(); |
diff --git a/examples/rp/src/bin/usb_ethernet.rs b/examples/rp/src/bin/usb_ethernet.rs index 16fbf5e91..d33d9c72e 100644 --- a/examples/rp/src/bin/usb_ethernet.rs +++ b/examples/rp/src/bin/usb_ethernet.rs | |||
| @@ -87,7 +87,7 @@ async fn main(spawner: Spawner) { | |||
| 87 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 87 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 88 | 88 | ||
| 89 | let config = embassy_net::Config::Dhcp(Default::default()); | 89 | let config = embassy_net::Config::Dhcp(Default::default()); |
| 90 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 90 | //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { |
| 91 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 91 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 92 | // dns_servers: Vec::new(), | 92 | // dns_servers: Vec::new(), |
| 93 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 93 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs index b27d3c9f8..970cf4b32 100644 --- a/examples/rp/src/bin/wifi_ap_tcp_server.rs +++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs | |||
| @@ -62,7 +62,7 @@ async fn main(spawner: Spawner) { | |||
| 62 | .await; | 62 | .await; |
| 63 | 63 | ||
| 64 | // Use a link-local address for communication without DHCP server | 64 | // Use a link-local address for communication without DHCP server |
| 65 | let config = Config::Static(embassy_net::StaticConfig { | 65 | let config = Config::StaticV4(embassy_net::StaticConfigV4 { |
| 66 | address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(169, 254, 1, 1), 16), | 66 | address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(169, 254, 1, 1), 16), |
| 67 | dns_servers: heapless::Vec::new(), | 67 | dns_servers: heapless::Vec::new(), |
| 68 | gateway: None, | 68 | gateway: None, |
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs index 1a00bca96..9f95f8b03 100644 --- a/examples/rp/src/bin/wifi_tcp_server.rs +++ b/examples/rp/src/bin/wifi_tcp_server.rs | |||
| @@ -62,7 +62,7 @@ async fn main(spawner: Spawner) { | |||
| 62 | .await; | 62 | .await; |
| 63 | 63 | ||
| 64 | let config = Config::Dhcp(Default::default()); | 64 | let config = Config::Dhcp(Default::default()); |
| 65 | //let config = embassy_net::Config::Static(embassy_net::Config { | 65 | //let config = embassy_net::Config::StaticV4(embassy_net::Config { |
| 66 | // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), | 66 | // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), |
| 67 | // dns_servers: Vec::new(), | 67 | // dns_servers: Vec::new(), |
| 68 | // gateway: Some(Ipv4Address::new(192, 168, 69, 1)), | 68 | // gateway: Some(Ipv4Address::new(192, 168, 69, 1)), |
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs index b42bfc13b..14cf3f25b 100644 --- a/examples/std/src/bin/net.rs +++ b/examples/std/src/bin/net.rs | |||
| @@ -42,7 +42,7 @@ 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::Static(embassy_net::StaticConfig { | 45 | Config::StaticV4(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)), |
diff --git a/examples/std/src/bin/net_dns.rs b/examples/std/src/bin/net_dns.rs index 932ac5831..0a479a744 100644 --- a/examples/std/src/bin/net_dns.rs +++ b/examples/std/src/bin/net_dns.rs | |||
| @@ -40,7 +40,7 @@ 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::Static(embassy_net::StaticConfig { | 43 | Config::StaticV4(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(), |
diff --git a/examples/std/src/bin/net_udp.rs b/examples/std/src/bin/net_udp.rs index d89ec7643..0ede5d998 100644 --- a/examples/std/src/bin/net_udp.rs +++ b/examples/std/src/bin/net_udp.rs | |||
| @@ -38,7 +38,7 @@ 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::Static(embassy_net::StaticConfig { | 41 | Config::StaticV4(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)), |
diff --git a/examples/std/src/bin/tcp_accept.rs b/examples/std/src/bin/tcp_accept.rs index 01695baea..4379d0439 100644 --- a/examples/std/src/bin/tcp_accept.rs +++ b/examples/std/src/bin/tcp_accept.rs | |||
| @@ -53,7 +53,7 @@ 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::Static(embassy_net::StaticConfig { | 56 | Config::StaticV4(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)), |
diff --git a/examples/stm32f4/src/bin/usb_ethernet.rs b/examples/stm32f4/src/bin/usb_ethernet.rs index d229cc3ef..0856b4842 100644 --- a/examples/stm32f4/src/bin/usb_ethernet.rs +++ b/examples/stm32f4/src/bin/usb_ethernet.rs | |||
| @@ -95,7 +95,7 @@ async fn main(spawner: Spawner) { | |||
| 95 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 95 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 96 | 96 | ||
| 97 | let config = embassy_net::Config::Dhcp(Default::default()); | 97 | let config = embassy_net::Config::Dhcp(Default::default()); |
| 98 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 98 | //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { |
| 99 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 99 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 100 | // dns_servers: Vec::new(), | 100 | // dns_servers: Vec::new(), |
| 101 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 101 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs index d8438241c..ebdf0d8a0 100644 --- a/examples/stm32f7/src/bin/eth.rs +++ b/examples/stm32f7/src/bin/eth.rs | |||
| @@ -63,7 +63,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 63 | ); | 63 | ); |
| 64 | 64 | ||
| 65 | let config = embassy_net::Config::Dhcp(Default::default()); | 65 | let config = embassy_net::Config::Dhcp(Default::default()); |
| 66 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 66 | //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { |
| 67 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 67 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 68 | // dns_servers: Vec::new(), | 68 | // dns_servers: Vec::new(), |
| 69 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 69 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs index 5d1eadf4b..811f74c88 100644 --- a/examples/stm32h5/src/bin/eth.rs +++ b/examples/stm32h5/src/bin/eth.rs | |||
| @@ -82,7 +82,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 82 | ); | 82 | ); |
| 83 | 83 | ||
| 84 | let config = embassy_net::Config::Dhcp(Default::default()); | 84 | let config = embassy_net::Config::Dhcp(Default::default()); |
| 85 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 85 | //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { |
| 86 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 86 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 87 | // dns_servers: Vec::new(), | 87 | // dns_servers: Vec::new(), |
| 88 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 88 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index 3aa7b2271..5360a213a 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs | |||
| @@ -64,7 +64,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 64 | ); | 64 | ); |
| 65 | 65 | ||
| 66 | let config = embassy_net::Config::Dhcp(Default::default()); | 66 | let config = embassy_net::Config::Dhcp(Default::default()); |
| 67 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 67 | //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { |
| 68 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 68 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 69 | // dns_servers: Vec::new(), | 69 | // dns_servers: Vec::new(), |
| 70 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 70 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs index 575c716b6..42781cfdc 100644 --- a/examples/stm32h7/src/bin/eth_client.rs +++ b/examples/stm32h7/src/bin/eth_client.rs | |||
| @@ -65,7 +65,7 @@ async fn main(spawner: Spawner) -> ! { | |||
| 65 | ); | 65 | ); |
| 66 | 66 | ||
| 67 | let config = embassy_net::Config::Dhcp(Default::default()); | 67 | let config = embassy_net::Config::Dhcp(Default::default()); |
| 68 | //let config = embassy_net::Config::StaticConfig(embassy_net::Config { | 68 | //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { |
| 69 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 69 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 70 | // dns_servers: Vec::new(), | 70 | // dns_servers: Vec::new(), |
| 71 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 71 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs index 6163e0709..d96d2f350 100644 --- a/examples/stm32l5/src/bin/usb_ethernet.rs +++ b/examples/stm32l5/src/bin/usb_ethernet.rs | |||
| @@ -92,7 +92,7 @@ async fn main(spawner: Spawner) { | |||
| 92 | unwrap!(spawner.spawn(usb_ncm_task(runner))); | 92 | unwrap!(spawner.spawn(usb_ncm_task(runner))); |
| 93 | 93 | ||
| 94 | let config = embassy_net::Config::Dhcp(Default::default()); | 94 | let config = embassy_net::Config::Dhcp(Default::default()); |
| 95 | //let config = embassy_net::Config::Static(embassy_net::StaticConfig { | 95 | //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { |
| 96 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), | 96 | // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), |
| 97 | // dns_servers: Vec::new(), | 97 | // dns_servers: Vec::new(), |
| 98 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), | 98 | // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), |
