Add IEEE802.15.4 address to embassy net Stack

This commit is contained in:
Ruben De Smet 2023-07-28 16:22:03 +02:00
parent c52d1d11f9
commit c3ba08ffb6
No known key found for this signature in database
GPG key ID: 1AE26A210C14115B

View file

@ -247,7 +247,7 @@ impl<D: Driver + 'static> Stack<D> {
#[cfg(feature = "medium-ip")]
Medium::Ip => HardwareAddress::Ip,
#[cfg(feature = "medium-ieee802154")]
Medium::Ieee802154 => HardwareAddress::Ieee802154(Ieee802154Address::Absent),
Medium::Ieee802154 => HardwareAddress::Ieee802154(Ieee802154Address::Extended(device.ieee802154_address())),
#[allow(unreachable_patterns)]
_ => panic!(
"Unsupported medium {:?}. Make sure to enable it in embassy-net's Cargo features.",
@ -747,6 +747,13 @@ impl<D: Driver + 'static> Inner<D> {
)));
}
#[cfg(feature = "medium-ieee802154")]
if self.device.capabilities().medium == Medium::Ieee802154 {
s.iface.set_hardware_addr(HardwareAddress::Ieee802154(Ieee802154Address::Extended(
self.device.ieee802154_address(),
)));
}
let timestamp = instant_to_smoltcp(Instant::now());
let mut smoldev = DriverAdapter {
cx: Some(cx),