Skip to content

Commit

Permalink
Merge pull request #10 from swilson/master
Browse files Browse the repository at this point in the history
#define debug statements
  • Loading branch information
mrdunk authored Apr 23, 2018
2 parents f5a8184 + c79ddfb commit b7c88fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mdns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ void PrintHex(const unsigned char data) {
}

void MDns::startUdpMulticast(){
#ifdef DEBUG_OUTPUT
Serial.println("Initializing Multicast.");
#endif
Udp.beginMulticast(WiFi.localIP(), IPAddress(224, 0, 0, 251), MDNS_TARGET_PORT);
}

Expand Down Expand Up @@ -300,8 +302,9 @@ bool MDns::AddAnswer(const Answer& answer) {
}

void MDns::Send() const {
#ifdef DEBUG_OUTPUT
Serial.println("Sending UDP multicast packet");

#endif
Udp.begin(MDNS_SOURCE_PORT);
Udp.beginPacketMulticast(IPAddress(224, 0, 0, 251), MDNS_TARGET_PORT, WiFi.localIP(), MDNS_TTL);
Udp.write(data_buffer, data_size);
Expand Down

0 comments on commit b7c88fd

Please sign in to comment.