Skip to content

Commit 7709d9b

Browse files
committed
Rename MDNSResponder to WiFiMDNSResponder, apply consistent file naming scheme as well
1 parent 00c2d17 commit 7709d9b

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

CHANGELOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WiFi101 ??? - ???
88
* Fixed beginAP(...) channel off by one error
99
* Fixed WiFi.status() always returning WL_CONNECTED once connected, even if access point is disconnected later
1010
* Added beginMulti API for Multicast UDP support
11-
* Added MDNSResponder class and MDNS Web server example
11+
* Added WiFiMDNSResponder class and MDNS Web server example
1212

1313
WiFi101 0.8.0 - 2016.02.15
1414

examples/MDNS_WiFiWebServer/MDNS_WiFiWebServer.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#include <SPI.h>
3232
#include <WiFi101.h>
33-
#include <WifiMdns.h>
33+
#include <WiFiMDNSResponder.h>
3434

3535
char ssid[] = "yourNetwork"; // your network SSID (name)
3636
char pass[] = "secretPassword"; // your network password
@@ -44,7 +44,7 @@ char mdnsName[] = "wifi101"; // the MDNS name that the board will respond to
4444
int status = WL_IDLE_STATUS;
4545

4646
// Create a MDNS responder to listen and respond to MDNS name requests.
47-
MDNSResponder mdns;
47+
WiFiMDNSResponder mdnsResponder;
4848

4949
WiFiServer server(80);
5050

@@ -80,7 +80,7 @@ void setup() {
8080
// Setup the MDNS responder to listen to the configured name.
8181
// NOTE: You _must_ call this _after_ connecting to the WiFi network and
8282
// being assigned an IP address.
83-
if (!mdns.begin(mdnsName)) {
83+
if (!mdnsResponder.begin(mdnsName)) {
8484
Serial.println("Failed to start MDNS responder!");
8585
while(1);
8686
}
@@ -94,7 +94,7 @@ void setup() {
9494
void loop() {
9595
// Call the update() function on the MDNS responder every loop iteration to
9696
// make sure it can detect and respond to name requests.
97-
mdns.poll();
97+
mdnsResponder.poll();
9898

9999
// listen for incoming clients
100100
WiFiClient client = server.available();

keywords.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ poll KEYWORD2
4141
WiFiClient KEYWORD2
4242
WiFiServer KEYWORD2
4343
WiFiSSLClient KEYWORD2
44-
WifiMdns KEYWORD2
44+
WiFiMDNSResponder KEYWORD2
4545

4646
#######################################
4747
# Constants (LITERAL1)

src/WiFiMdns.cpp renamed to src/WiFiMdnsResponder.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <avr/pgmspace.h>
2525

2626
#include "Arduino.h"
27-
#include "WiFiMdns.h"
27+
#include "WiFiMdnsResponder.h"
2828

2929
// Important RFC's for reference:
3030
// - DNS request and response: http://www.ietf.org/rfc/rfc1035.txt
@@ -76,16 +76,16 @@ const uint8_t nsecRecord[] PROGMEM = {
7676

7777
const uint8_t domain[] PROGMEM = { 'l', 'o', 'c', 'a', 'l' };
7878

79-
MDNSResponder::MDNSResponder() :
79+
WiFiMDNSResponder::WiFiMDNSResponder() :
8080
expectedRequestLength(0)
8181
{
8282
}
8383

84-
MDNSResponder::~MDNSResponder()
84+
WiFiMDNSResponder::~WiFiMDNSResponder()
8585
{
8686
}
8787

88-
bool MDNSResponder::begin(const char* _name, uint32_t _ttlSeconds)
88+
bool WiFiMDNSResponder::begin(const char* _name, uint32_t _ttlSeconds)
8989
{
9090
int nameLength = strlen(_name);
9191

@@ -110,14 +110,14 @@ bool MDNSResponder::begin(const char* _name, uint32_t _ttlSeconds)
110110
return true;
111111
}
112112

113-
void MDNSResponder::poll()
113+
void WiFiMDNSResponder::poll()
114114
{
115115
if (parseRequest()) {
116116
replyToRequest();
117117
}
118118
}
119119

120-
bool MDNSResponder::parseRequest()
120+
bool WiFiMDNSResponder::parseRequest()
121121
{
122122
if (udpSocket.parsePacket()) {
123123
// check if parsed packet matches expected request length
@@ -164,7 +164,7 @@ bool MDNSResponder::parseRequest()
164164
return false;
165165
}
166166

167-
void MDNSResponder::replyToRequest()
167+
void WiFiMDNSResponder::replyToRequest()
168168
{
169169
int nameLength = name.length();
170170
int domainLength = sizeof(domain);

src/WiFiMdns.h renamed to src/WiFiMdnsResponder.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
// License along with this library; if not, write to the Free Software
2222
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323

24-
#ifndef WIFIMDNS_H
25-
#define WIFIMDNS_H
24+
#ifndef WIFIMDNSRESPONDER_H
25+
#define WIFIMDNSRESPONDER_H
2626

2727
#include "WiFi101.h"
2828
#include "WiFiUdp.h"
2929

30-
class MDNSResponder {
30+
class WiFiMDNSResponder {
3131
public:
32-
MDNSResponder();
33-
~MDNSResponder();
32+
WiFiMDNSResponder();
33+
~WiFiMDNSResponder();
3434
bool begin(const char* _name, uint32_t _ttlSeconds = 3600);
3535
void poll();
3636

0 commit comments

Comments
 (0)