Skip to content

mDNS: Add support for String arg to begin() #5542

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

Merged
merged 1 commit into from
Dec 23, 2018
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
6 changes: 6 additions & 0 deletions libraries/ESP8266mDNS/src/ESP8266mDNS_Legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,18 @@ class MDNSResponder {
MDNSResponder();
~MDNSResponder();
bool begin(const char* hostName);
bool begin(const String& hostName) {
return begin(hostName.c_str());
}
//for compatibility
bool begin(const char* hostName, IPAddress ip, uint32_t ttl=120){
(void) ip;
(void) ttl;
return begin(hostName);
}
bool begin(const String& hostName, IPAddress ip, uint32_t ttl=120) {
return begin(hostName.c_str(), ip, ttl);
}
/* Application should call this whenever AP is configured/disabled */
void notifyAPChange();
void update();
Expand Down
6 changes: 6 additions & 0 deletions libraries/ESP8266mDNS/src/LEAmDNS.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,16 @@ class MDNSResponder {
// Later call MDNS::update() in every 'loop' to run the process loop
// (probing, announcing, responding, ...)
bool begin(const char* p_pcHostname);
bool begin(const String& p_strHostname) {return begin(p_strHostname.c_str());}
// for compatibility
bool begin(const char* p_pcHostname,
IPAddress p_IPAddress, // ignored
uint32_t p_u32TTL = 120); // ignored
bool begin(const String& p_strHostname,
IPAddress p_IPAddress, // ignored
uint32_t p_u32TTL = 120) { // ignored
return begin(p_strHostname.c_str(), p_IPAddress, p_u32TTL);
}
// Finish MDNS processing
bool close(void);

Expand Down