File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 22
22
#include " Ethernet.h"
23
23
#include " utility/w5100.h"
24
24
#include " Dhcp.h"
25
+ #include " Dns.h"
25
26
26
27
IPAddress EthernetClass::_dnsServerAddress;
27
28
DhcpClass* EthernetClass::_dhcp = NULL ;
@@ -224,6 +225,13 @@ void EthernetClass::setRetransmissionCount(uint8_t num)
224
225
SPI.endTransaction ();
225
226
}
226
227
228
+ int EthernetClass::hostByName (const char * hostname, IPAddress& result)
229
+ {
230
+ int ret = 0 ;
231
+ DNSClient dns;
232
+ dns.begin (_dnsServerAddress);
233
+ return dns.getHostByName (hostname, result);
234
+ }
227
235
228
236
229
237
Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ class EthernetClass {
105
105
void setRetransmissionTimeout (uint16_t milliseconds);
106
106
void setRetransmissionCount (uint8_t num);
107
107
108
+ int hostByName (const char * hostname, IPAddress& result);
109
+
108
110
friend class EthernetClient ;
109
111
friend class EthernetServer ;
110
112
friend class EthernetUDP ;
You can’t perform that action at this time.
0 commit comments