modified by ohneta

Dependencies:   ESP8266

Dependents:   HelloESP8266Interface_mine

Fork of ESP8266Interface by NetworkSocketAPI

Revision:
30:fd77d067f5ab
Parent:
29:f2ae8f47729b
Child:
32:1d16668d116c
--- a/ESP8266Interface.cpp	Thu Aug 27 14:32:50 2015 +0000
+++ b/ESP8266Interface.cpp	Tue Nov 10 14:46:06 2015 +0000
@@ -20,6 +20,7 @@
 {
     uuidCounter = 0;
     std::fill_n(availableID, sizeof(availableID)/sizeof(int), -1);
+    preferred_dnsip = NULL;
 }
 
 int32_t ESP8266Interface::init(void)
@@ -143,10 +144,15 @@
 void ESP8266Interface::getHostByName(const char *name, char* hostIP)
 {
     SocketInterface* sock = this->allocateSocket(SOCK_UDP);
-    DnsQuery dns(sock, name, hostIP);
+    DnsQuery dns(sock, name, hostIP, this->preferred_dnsip);
     this->deallocateSocket(sock);
 }   
 
+void ESP8266Interface::setPreferredDns(const char *preferredDnsIP)
+{
+    this->preferred_dnsip = preferredDnsIP;
+}
+
 ESP8266Socket::ESP8266Socket(uint32_t handle, ESP8266 &driver, socket_protocol_t type, uint8_t id)
 {
     _handle = handle;