From be5d98f25f29ce3ad92afa3953e4634efeba9c37 Mon Sep 17 00:00:00 2001 From: Juraj Andrassy Date: Tue, 19 Dec 2023 19:57:50 +0100 Subject: [PATCH] Ethernet - standard MACAddress getter with a parameter --- libraries/Ethernet/src/Ethernet.cpp | 4 ++++ libraries/Ethernet/src/EthernetC33.h | 1 + 2 files changed, 5 insertions(+) diff --git a/libraries/Ethernet/src/Ethernet.cpp b/libraries/Ethernet/src/Ethernet.cpp index 4d820505..3151cdcc 100644 --- a/libraries/Ethernet/src/Ethernet.cpp +++ b/libraries/Ethernet/src/Ethernet.cpp @@ -174,6 +174,10 @@ uint8_t *CEthernet::MACAddress(void) { return mac_address; } +void CEthernet::MACAddress(uint8_t *mac) { + CLwipIf::getInstance().getMacAddress(NI_ETHERNET, mac); +} + IPAddress CEthernet::localIP() { if(ni != nullptr) { return IPAddress(ni->getIpAdd()); diff --git a/libraries/Ethernet/src/EthernetC33.h b/libraries/Ethernet/src/EthernetC33.h index 109a1977..23f8202d 100644 --- a/libraries/Ethernet/src/EthernetC33.h +++ b/libraries/Ethernet/src/EthernetC33.h @@ -62,6 +62,7 @@ class CEthernet { uint8_t *MACAddress(void); + void MACAddress(uint8_t *mac); IPAddress localIP(); IPAddress subnetMask(); IPAddress gatewayIP();