Browse Source

Added build flag to disable mDNS, default is enabled

fastled
Xose Pérez 7 years ago
parent
commit
160e0f9bda
2 changed files with 11 additions and 8 deletions
  1. +1
    -0
      code/espurna/config/general.h
  2. +10
    -8
      code/espurna/wifi.ino

+ 1
- 0
code/espurna/config/general.h View File

@ -93,6 +93,7 @@
#define WEBSERVER_PORT 80 #define WEBSERVER_PORT 80
#define DNS_PORT 53 #define DNS_PORT 53
#define ENABLE_CAPTIVE_PORTAL 0 #define ENABLE_CAPTIVE_PORTAL 0
#define ENABLE_MDNS 1
#define WEB_MODE_NORMAL 0 #define WEB_MODE_NORMAL 0
#define WEB_MODE_PASSWORD 1 #define WEB_MODE_PASSWORD 1


+ 10
- 8
code/espurna/wifi.ino View File

@ -182,14 +182,16 @@ void wifiSetup() {
#endif #endif
// Configure mDNS // Configure mDNS
if (code == MESSAGE_CONNECTED) {
if (MDNS.begin((char *) WiFi.hostname().c_str())) {
MDNS.addService("http", "tcp", 80);
DEBUG_MSG_P(PSTR("[MDNS] OK\n"));
} else {
DEBUG_MSG_P(PSTR("[MDNS] FAIL\n"));
}
}
#if ENABLE_MDNS
if (code == MESSAGE_CONNECTED) {
if (MDNS.begin((char *) WiFi.hostname().c_str())) {
MDNS.addService("http", "tcp", 80);
DEBUG_MSG_P(PSTR("[MDNS] OK\n"));
} else {
DEBUG_MSG_P(PSTR("[MDNS] FAIL\n"));
}
}
#endif
// Configure captive portal // Configure captive portal
#if ENABLE_CAPTIVE_PORTAL #if ENABLE_CAPTIVE_PORTAL


Loading…
Cancel
Save