Skip to content
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
4 changes: 3 additions & 1 deletion libraries/ESPmDNS/src/ESPmDNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void MDNSResponder::disableWorkstation(){
}
}

void MDNSResponder::addService(char *name, char *proto, uint16_t port){
bool MDNSResponder::addService(char *name, char *proto, uint16_t port){
char _name[strlen(name)+2];
char _proto[strlen(proto)+2];
if (name[0] == '_') {
Expand All @@ -146,7 +146,9 @@ void MDNSResponder::addService(char *name, char *proto, uint16_t port){

if(mdns_service_add(NULL, _name, _proto, port, NULL, 0)) {
log_e("Failed adding service %s.%s.\n", name, proto);
return false;
}
return true;
}

bool MDNSResponder::addServiceTxt(char *name, char *proto, char *key, char *value){
Expand Down
10 changes: 5 additions & 5 deletions libraries/ESPmDNS/src/ESPmDNS.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ class MDNSResponder {
setInstanceName(String(name));
}

void addService(char *service, char *proto, uint16_t port);
void addService(const char *service, const char *proto, uint16_t port){
addService((char *)service, (char *)proto, port);
bool addService(char *service, char *proto, uint16_t port);
bool addService(const char *service, const char *proto, uint16_t port){
return addService((char *)service, (char *)proto, port);
}
void addService(String service, String proto, uint16_t port){
addService(service.c_str(), proto.c_str(), port);
bool addService(String service, String proto, uint16_t port){
return addService(service.c_str(), proto.c_str(), port);
}

bool addServiceTxt(char *name, char *proto, char * key, char * value);
Expand Down