Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ESP32 compatible methods for setting/getting hostname #7900

Merged
merged 2 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cores/esp8266/LwipIntf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions cores/esp8266/LwipIntf.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class LwipIntf
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:

Expand Down