Skip to content

Commit 22442f0

Browse files
authored
Added ESP32 compatible methods for setting/getting hostname (#7900)
1 parent 807ed51 commit 22442f0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Diff for: cores/esp8266/LwipIntf.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ String LwipIntf::hostname(void)
6464
return wifi_station_get_hostname();
6565
}
6666

67+
/**
68+
Get ESP8266 station DHCP hostname
69+
@return hostname
70+
*/
71+
const char* LwipIntf::getHostname(void)
72+
{
73+
return wifi_station_get_hostname();
74+
}
75+
6776
/**
6877
Set ESP8266 station DHCP hostname
6978
@param aHostname max length:24

Diff for: cores/esp8266/LwipIntf.h

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ class LwipIntf
3434
return hostname(aHostname.c_str());
3535
}
3636
bool hostname(const char* aHostname);
37+
// ESP32 API compatibility
38+
bool setHostname(const char* aHostName)
39+
{
40+
return hostname(aHostName);
41+
}
42+
const char* getHostname();
3743

3844
protected:
3945

0 commit comments

Comments
 (0)