8000 Added ESP32 compatible methods for setting/getting hostname (#7900) · esp8266/Arduino@22442f0 · GitHub
[go: up one dir, main page]

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

cores/esp8266/LwipIntf.cpp

Lines changed: 9 additions & 0 deletions
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

cores/esp8266/LwipIntf.h

Lines changed: 6 additions & 0 deletions
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)
0