Skip to content

Commit

Permalink
Add IEEE802.15.4 address to embassy net Stack
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Jul 28, 2023
1 parent c52d1d1 commit c3ba08f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion embassy-net/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit c3ba08f

Please sign in to comment.