diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp index d2746745c..b4a4807b9 100644 --- a/cores/esp8266/LwipIntf.cpp +++ b/cores/esp8266/LwipIntf.cpp @@ -64,6 +64,15 @@ String LwipIntf::hostname(void) return wifi_station_get_hostname(); } +/** + Get ESP8266 station DHCP hostname + @return hostname +*/ +const char* LwipIntf::getHostname(void) +{ + return wifi_station_get_hostname(); +} + /** Set ESP8266 station DHCP hostname @param aHostname max length:24 diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h index 972a7c800..d73c2d825 100644 --- a/cores/esp8266/LwipIntf.h +++ b/cores/esp8266/LwipIntf.h @@ -34,6 +34,12 @@ public: return hostname(aHostname.c_str()); } bool hostname(const char* aHostname); + // ESP32 API compatibility + bool setHostname(const char* aHostName) + { + return hostname(aHostName); + } + const char* getHostname(); protected: