1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Added ESP32 compatible methods for setting/getting hostname (#7900)

This commit is contained in:
Drzony 2021-03-03 02:32:34 +01:00 committed by GitHub
parent 807ed51d0f
commit 22442f0873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -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

View File

@ -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: