diff options
Diffstat (limited to 'embassy-net/src/lib.rs')
| -rw-r--r-- | embassy-net/src/lib.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index 693a39ed5..3f0634849 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs | |||
| @@ -106,6 +106,7 @@ impl<const SOCK: usize> StackResources<SOCK> { | |||
| 106 | /// Static IP address configuration. | 106 | /// Static IP address configuration. |
| 107 | #[cfg(feature = "proto-ipv4")] | 107 | #[cfg(feature = "proto-ipv4")] |
| 108 | #[derive(Debug, Clone, PartialEq, Eq)] | 108 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 109 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 109 | pub struct StaticConfigV4 { | 110 | pub struct StaticConfigV4 { |
| 110 | /// IP address and subnet mask. | 111 | /// IP address and subnet mask. |
| 111 | pub address: Ipv4Cidr, | 112 | pub address: Ipv4Cidr, |
| @@ -118,6 +119,7 @@ pub struct StaticConfigV4 { | |||
| 118 | /// Static IPv6 address configuration | 119 | /// Static IPv6 address configuration |
| 119 | #[cfg(feature = "proto-ipv6")] | 120 | #[cfg(feature = "proto-ipv6")] |
| 120 | #[derive(Debug, Clone, PartialEq, Eq)] | 121 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 122 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 121 | pub struct StaticConfigV6 { | 123 | pub struct StaticConfigV6 { |
| 122 | /// IP address and subnet mask. | 124 | /// IP address and subnet mask. |
| 123 | pub address: Ipv6Cidr, | 125 | pub address: Ipv6Cidr, |
| @@ -130,6 +132,7 @@ pub struct StaticConfigV6 { | |||
| 130 | /// DHCP configuration. | 132 | /// DHCP configuration. |
| 131 | #[cfg(feature = "dhcpv4")] | 133 | #[cfg(feature = "dhcpv4")] |
| 132 | #[derive(Debug, Clone, PartialEq, Eq)] | 134 | #[derive(Debug, Clone, PartialEq, Eq)] |
| 135 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 133 | #[non_exhaustive] | 136 | #[non_exhaustive] |
| 134 | pub struct DhcpConfig { | 137 | pub struct DhcpConfig { |
| 135 | /// Maximum lease duration. | 138 | /// Maximum lease duration. |
| @@ -168,7 +171,8 @@ impl Default for DhcpConfig { | |||
| 168 | } | 171 | } |
| 169 | 172 | ||
| 170 | /// Network stack configuration. | 173 | /// Network stack configuration. |
| 171 | #[derive(Debug, Clone, Default)] | 174 | #[derive(Debug, Clone, Default, PartialEq, Eq)] |
| 175 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 172 | #[non_exhaustive] | 176 | #[non_exhaustive] |
| 173 | pub struct Config { | 177 | pub struct Config { |
| 174 | /// IPv4 configuration | 178 | /// IPv4 configuration |
| @@ -219,7 +223,8 @@ impl Config { | |||
| 219 | 223 | ||
| 220 | /// Network stack IPv4 configuration. | 224 | /// Network stack IPv4 configuration. |
| 221 | #[cfg(feature = "proto-ipv4")] | 225 | #[cfg(feature = "proto-ipv4")] |
| 222 | #[derive(Debug, Clone, Default)] | 226 | #[derive(Debug, Clone, Default, PartialEq, Eq)] |
| 227 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 223 | pub enum ConfigV4 { | 228 | pub enum ConfigV4 { |
| 224 | /// Do not configure IPv4. | 229 | /// Do not configure IPv4. |
| 225 | #[default] | 230 | #[default] |
| @@ -233,7 +238,8 @@ pub enum ConfigV4 { | |||
| 233 | 238 | ||
| 234 | /// Network stack IPv6 configuration. | 239 | /// Network stack IPv6 configuration. |
| 235 | #[cfg(feature = "proto-ipv6")] | 240 | #[cfg(feature = "proto-ipv6")] |
| 236 | #[derive(Debug, Clone, Default)] | 241 | #[derive(Debug, Clone, Default, PartialEq, Eq)] |
| 242 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 237 | pub enum ConfigV6 { | 243 | pub enum ConfigV6 { |
| 238 | /// Do not configure IPv6. | 244 | /// Do not configure IPv6. |
| 239 | #[default] | 245 | #[default] |
| @@ -458,7 +464,7 @@ impl<'d> Stack<'d> { | |||
| 458 | /// seed | 464 | /// seed |
| 459 | /// ); | 465 | /// ); |
| 460 | /// // Launch network task that runs `runner.run().await` | 466 | /// // Launch network task that runs `runner.run().await` |
| 461 | /// spawner.spawn(net_task(runner)).unwrap(); | 467 | /// spawner.spawn(net_task(runner).unwrap()); |
| 462 | /// // Wait for DHCP config | 468 | /// // Wait for DHCP config |
| 463 | /// stack.wait_config_up().await; | 469 | /// stack.wait_config_up().await; |
| 464 | /// // use the network stack | 470 | /// // use the network stack |
