SimpleMDNS: let begin return a bool (#2599)
SimpleMDNS: let `begin` return a bool To be compatible with LEAmDNS
This commit is contained in:
parent
6c8d62fdb8
commit
5a428647d4
2 changed files with 5 additions and 3 deletions
|
|
@ -24,9 +24,9 @@
|
|||
#include <LwipEthernet.h>
|
||||
#include <lwip/apps/mdns.h>
|
||||
|
||||
void SimpleMDNS::begin(const char *hostname, unsigned int ttl) {
|
||||
bool SimpleMDNS::begin(const char *hostname, unsigned int ttl) {
|
||||
if (_running) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
mdns_resp_init();
|
||||
struct netif *n = netif_list;
|
||||
|
|
@ -37,6 +37,8 @@ void SimpleMDNS::begin(const char *hostname, unsigned int ttl) {
|
|||
__setStateChangeCallback(_statusCB);
|
||||
_hostname = strdup(hostname);
|
||||
_running = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SimpleMDNS::enableArduino(unsigned int port, bool passwd) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
class SimpleMDNS {
|
||||
|
||||
public:
|
||||
void begin(const char *hostname, unsigned int ttl = 60);
|
||||
bool begin(const char *hostname, unsigned int ttl = 60);
|
||||
void enableArduino(unsigned int port, bool passwd = false);
|
||||
void addService(const char *service, const char *proto, unsigned int port);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue