SimpleMDNS: let begin return a bool (#2599)

SimpleMDNS: let `begin` return a bool
To be compatible with LEAmDNS
This commit is contained in:
GUVWAF 2024-11-11 21:04:08 +01:00 committed by GitHub
parent 6c8d62fdb8
commit 5a428647d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -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) {

View file

@ -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);