net: improve error message on unsupported medium.

This commit is contained in:
Dario Nieuwenhuis 2023-08-25 01:03:24 +02:00
parent 6d3377e6a6
commit b5748524f8
2 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,7 @@ categories = [
"embedded", "embedded",
"no-std", "no-std",
"asynchronous", "asynchronous",
"network-programming",
] ]
[package.metadata.embassy_docs] [package.metadata.embassy_docs]

View File

@ -249,7 +249,10 @@ fn to_smoltcp_hardware_address(addr: driver::HardwareAddress) -> HardwareAddress
driver::HardwareAddress::Ip => HardwareAddress::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 medium {:?}. Make sure to enable the right medium feature in embassy-net's Cargo features.",
addr
),
} }
} }