From e1a8caffa441644089e8f904acb460e79cb44e99 Mon Sep 17 00:00:00 2001 From: Josh Junon Date: Fri, 29 Sep 2023 17:23:39 +0200 Subject: [PATCH] enc28j60: expose a the MAC address via `address()` getter --- embassy-net-enc28j60/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/embassy-net-enc28j60/src/lib.rs b/embassy-net-enc28j60/src/lib.rs index 72229dc08..f96a6ff14 100644 --- a/embassy-net-enc28j60/src/lib.rs +++ b/embassy-net-enc28j60/src/lib.rs @@ -194,6 +194,11 @@ where self.bit_field_set(common::Register::ECON1, common::ECON1::mask().rxen()); } + /// Returns the device's MAC address + pub fn address(&self) -> [u8; 6] { + self.mac_addr + } + /// Flushes the transmit buffer, ensuring all pending transmissions have completed /// NOTE: The returned packet *must* be `read` or `ignore`-d, otherwise this method will always /// return `None` on subsequent invocations