未验证 提交 22442f08 编写于 作者: D Drzony 提交者: GitHub

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

上级 807ed51d
...@@ -64,6 +64,15 @@ String LwipIntf::hostname(void) ...@@ -64,6 +64,15 @@ String LwipIntf::hostname(void)
return wifi_station_get_hostname(); 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 Set ESP8266 station DHCP hostname
@param aHostname max length:24 @param aHostname max length:24
......
...@@ -34,6 +34,12 @@ public: ...@@ -34,6 +34,12 @@ public:
return hostname(aHostname.c_str()); return hostname(aHostname.c_str());
} }
bool hostname(const char* aHostname); bool hostname(const char* aHostname);
// ESP32 API compatibility
bool setHostname(const char* aHostName)
{
return hostname(aHostName);
}
const char* getHostname();
protected: protected:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册