Permalink
Browse files

Correct DNS error that relied on AVVISO_DEBUG to be set

  • Loading branch information...
1 parent 5e0e632 commit 5f112c03d85c77602ecebe5c962a4cd212ecac63 @colagrosso committed Aug 5, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 Arduino/libraries/Avviso/Avviso.cpp
@@ -47,15 +47,18 @@ void AvvisoClass::begin() {
dns.begin(Ethernet.dnsServerIP());
ret = dns.getHostByName(PROWL_API_HOST, remote_addr);
+ if (ret == 1) {
+ // Copy the DNS-resolved IPAddress bytes to prowlIpAddr
+ for (int i = 0; i < 4; i++) {
+ prowlIpAddr[i] = remote_addr[i];
+ }
+ }
if (AVVISO_DEBUG) {
if (ret == 1) {
Serial.print("The IP address of ");
Serial.print(PROWL_API_HOST);
Serial.print(" is: ");
remote_addr.printTo(Serial);
- for (int i = 0; i < 4; i++) {
- prowlIpAddr[i] = remote_addr[i];
- }
} else if (ret == -1) {
Serial.println("Timed out.");
} else {

0 comments on commit 5f112c0

Please sign in to comment.