diff --git a/Sming/SmingCore/Platform/AccessPoint.cpp b/Sming/SmingCore/Platform/AccessPoint.cpp index 704cca246b..5d4a687f7b 100644 --- a/Sming/SmingCore/Platform/AccessPoint.cpp +++ b/Sming/SmingCore/Platform/AccessPoint.cpp @@ -138,11 +138,11 @@ bool AccessPointClass::setIP(IPAddress address) return true; } -String AccessPointClass::getMAC() +String AccessPointClass::getMAC(char sep) { uint8 hwaddr[6]; if(wifi_get_macaddr(SOFTAP_IF, hwaddr)) - return makeHexString(hwaddr, sizeof(hwaddr), ':'); + return makeHexString(hwaddr, sizeof(hwaddr), sep); else return nullptr; } diff --git a/Sming/SmingCore/Platform/AccessPoint.h b/Sming/SmingCore/Platform/AccessPoint.h index ac063cb299..3edca54257 100644 --- a/Sming/SmingCore/Platform/AccessPoint.h +++ b/Sming/SmingCore/Platform/AccessPoint.h @@ -70,9 +70,10 @@ class AccessPointClass : protected ISystemReadyHandler bool setIP(IPAddress address); /** @brief Get WiFi AP MAC address + * @param optional separator between bytes (e.g. ':') * @retval String WiFi AP MAC address */ - String getMAC(); + String getMAC(char sep = '\0'); /** @brief Get WiFi AP network mask * @retval IPAddress WiFi AP network mask diff --git a/Sming/SmingCore/Platform/Station.cpp b/Sming/SmingCore/Platform/Station.cpp index 454dbcc319..cb21e4867b 100644 --- a/Sming/SmingCore/Platform/Station.cpp +++ b/Sming/SmingCore/Platform/Station.cpp @@ -157,11 +157,11 @@ IPAddress StationClass::getIP() return info.ip; } -String StationClass::getMAC() +String StationClass::getMAC(char sep) { uint8 hwaddr[6]; if(wifi_get_macaddr(STATION_IF, hwaddr)) - return makeHexString(hwaddr, sizeof(hwaddr), ':'); + return makeHexString(hwaddr, sizeof(hwaddr), sep); else return nullptr; } diff --git a/Sming/SmingCore/Platform/Station.h b/Sming/SmingCore/Platform/Station.h index 5f7ea483bb..874a4e1e76 100644 --- a/Sming/SmingCore/Platform/Station.h +++ b/Sming/SmingCore/Platform/Station.h @@ -157,9 +157,10 @@ class StationClass : protected ISystemReadyHandler IPAddress getIP(); /** @brief Get WiFi station MAC address + * @param optional separator between bytes (e.g. ':') * @retval String WiFi station MAC address */ - String getMAC(); + String getMAC(char sep = '\0'); /** @brief Get WiFi station network mask * @retval IPAddress WiFi station network mask