Skip to content

Commit 5a42864

Browse files
authored
SimpleMDNS: let begin return a bool (earlephilhower#2599)
SimpleMDNS: let `begin` return a bool To be compatible with LEAmDNS
1 parent 6c8d62f commit 5a42864

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

libraries/SimpleMDNS/src/SimpleMDNS.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#include <LwipEthernet.h>
2525
#include <lwip/apps/mdns.h>
2626

27-
void SimpleMDNS::begin(const char *hostname, unsigned int ttl) {
27+
bool SimpleMDNS::begin(const char *hostname, unsigned int ttl) {
2828
if (_running) {
29-
return;
29+
return false;
3030
}
3131
mdns_resp_init();
3232
struct netif *n = netif_list;
@@ -37,6 +37,8 @@ void SimpleMDNS::begin(const char *hostname, unsigned int ttl) {
3737
__setStateChangeCallback(_statusCB);
3838
_hostname = strdup(hostname);
3939
_running = true;
40+
41+
return true;
4042
}
4143

4244
void SimpleMDNS::enableArduino(unsigned int port, bool passwd) {

libraries/SimpleMDNS/src/SimpleMDNS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class SimpleMDNS {
2626

2727
public:
28-
void begin(const char *hostname, unsigned int ttl = 60);
28+
bool begin(const char *hostname, unsigned int ttl = 60);
2929
void enableArduino(unsigned int port, bool passwd = false);
3030
void addService(const char *service, const char *proto, unsigned int port);
3131

0 commit comments

Comments
 (0)