Skip to content

Commit

Permalink
All components of a DNS server are disabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jan 9, 2018
1 parent 427674f commit 984ed1f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions software/firmware/source/SoftRF/WiFiHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <ESP8266mDNS.h>
#include <FS.h>
#include <TimeLib.h>
#include <DNSServer.h>

#include "WiFiHelper.h"
#include "OTAHelper.h"
Expand All @@ -36,7 +35,7 @@ extern "C" {
#endif

String station_ssid = MY_ACCESSPOINT_SSID ;
String station_psk = MY_ACCESSPOINT_PSK ;
String station_psk = MY_ACCESSPOINT_PSK ;

String host_name = HOSTNAME;

Expand All @@ -50,9 +49,13 @@ IPAddress subnet(255,255,255,0);
*/
const char* ap_default_psk = "12345678"; ///< Default PSK.

#if defined(USE_DNS_SERVER)
#include <DNSServer.h>

const byte DNS_PORT = 53;
DNSServer dnsServer;
bool dns_active = false;
#endif

// A UDP instance to let us send and receive packets over UDP
WiFiUDP Uni_Udp;
Expand Down Expand Up @@ -253,7 +256,7 @@ void WiFi_setup()
Serial.print(F("Setting soft-AP ... "));
Serial.println(WiFi.softAP(host_name.c_str(), ap_default_psk) ?
F("Ready") : F("Failed!"));
#if 0
#if defined(USE_DNS_SERVER)
// if DNSServer is started with "*" for domain name, it will reply with
// provided IP to all DNS request
dnsServer.start(DNS_PORT, "*", WiFi.softAPIP());
Expand All @@ -270,9 +273,11 @@ void WiFi_setup()

void WiFi_loop()
{
#if defined(USE_DNS_SERVER)
if (dns_active) {
dnsServer.processNextRequest();
}
#endif
}

IPAddress WiFi_get_broadcast()
Expand Down

0 comments on commit 984ed1f

Please sign in to comment.