Skip to content

Commit cdd0a64

Browse files
committed
rename local mDNS instance in example
1 parent 9047d2d commit cdd0a64

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock_v2/mDNS_Clock_v2.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
const char* ssid = STASSID;
8282
const char* password = STAPSK;
8383

84-
clsLEAMDNSHost MDNS; // MDNS responder
84+
clsLEAMDNSHost MDNSRESP; // MDNS responder
8585
bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain
8686
clsLEAMDNSHost::clsService* hMDNSService = 0; // The handle of the clock service in the MDNS responder
8787

@@ -144,7 +144,7 @@ bool setStationHostname(const char* p_pcHostname) {
144144
Add a dynamic MDNS TXT item 'ct' to the clock service.
145145
The callback function is called every time, the TXT items for the clock service
146146
are needed.
147-
This can be triggered by calling MDNS.announce().
147+
This can be triggered by calling MDNSRESP.announce().
148148
149149
*/
150150
void MDNSDynamicServiceTxtCallback(const clsLEAMDNSHost::hMDNSService& p_hService) {
@@ -223,7 +223,7 @@ void setup(void) {
223223

224224
// Setup MDNS responder
225225
// Init the (currently empty) host domain string with 'leamdnsv2'
226-
if (MDNS.begin("leamdnsv2",
226+
if (MDNSRESP.begin("leamdnsv2",
227227
[](clsLEAMDNSHost & p_rMDNSHost, const char* p_pcDomainName, bool p_bProbeResult)->void {
228228
if (p_bProbeResult) {
229229
Serial.printf("mDNSHost_AP::ProbeResultCallback: '%s' is %s\n", p_pcDomainName, (p_bProbeResult ? "FREE" : "USED!"));
@@ -233,7 +233,7 @@ void setup(void) {
233233
hMDNSService->setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallback);
234234
} else {
235235
// Change hostname, use '-' as divider between base name and index
236-
MDNS.setHostName(clsLEAMDNSHost::indexDomainName(p_pcDomainName, "-", 0));
236+
MDNSRESP.setHostName(clsLEAMDNSHost::indexDomainName(p_pcDomainName, "-", 0));
237237
}
238238
})) {
239239
Serial.println("mDNS-AP started");
@@ -255,7 +255,7 @@ void loop(void) {
255255
// Check if a request has come in
256256
server.handleClient();
257257
// Allow MDNS processing
258-
MDNS.update();
258+
MDNSRESP.update();
259259

260260
static esp8266::polledTimeout::periodicMs timeout(UPDATE_CYCLE);
261261
if (timeout.expired()) {
@@ -264,7 +264,7 @@ void loop(void) {
264264
// Just trigger a new MDNS announcement, this will lead to a call to
265265
// 'MDNSDynamicServiceTxtCallback', which will update the time TXT item
266266
Serial.printf("Announce trigger from user\n");
267-
MDNS.announce();
267+
MDNSRESP.announce();
268268
}
269269
}
270270

0 commit comments

Comments
 (0)