Add Ip hardware address to Driver

This commit is contained in:
Ruben De Smet 2023-07-31 12:19:04 +02:00
parent 4afdce4ec5
commit 83ff3cbc69
No known key found for this signature in database
GPG key ID: 1AE26A210C14115B
2 changed files with 4 additions and 0 deletions

View file

@ -12,6 +12,8 @@ pub enum HardwareAddress {
Ethernet([u8; 6]), Ethernet([u8; 6]),
/// An eight-octet IEEE802.15.4 address /// An eight-octet IEEE802.15.4 address
Ieee802154([u8; 8]), Ieee802154([u8; 8]),
/// Indicates that a Driver is IP-native, and has no hardware address
Ip,
} }
/// Main `embassy-net` driver API. /// Main `embassy-net` driver API.

View file

@ -236,6 +236,8 @@ fn to_smoltcp_hardware_address(addr: driver::HardwareAddress) -> HardwareAddress
driver::HardwareAddress::Ethernet(eth) => HardwareAddress::Ethernet(EthernetAddress(eth)), driver::HardwareAddress::Ethernet(eth) => HardwareAddress::Ethernet(EthernetAddress(eth)),
#[cfg(feature = "medium-ieee802154")] #[cfg(feature = "medium-ieee802154")]
driver::HardwareAddress::Ieee802154(ieee) => HardwareAddress::Ieee802154(Ieee802154Address::Extended(ieee)), driver::HardwareAddress::Ieee802154(ieee) => HardwareAddress::Ieee802154(Ieee802154Address::Extended(ieee)),
#[cfg(feature = "medium-ip")]
driver::HardwareAddress::Ip => HardwareAddress::Ip,
#[allow(unreachable_patterns)] #[allow(unreachable_patterns)]
_ => panic!("Unsupported address {:?}. Make sure to enable medium-ethernet or medium-ieee802154 in embassy-net's Cargo features.", addr), _ => panic!("Unsupported address {:?}. Make sure to enable medium-ethernet or medium-ieee802154 in embassy-net's Cargo features.", addr),