File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,15 @@ class LwipIntfDev: public LwipIntf, public RawDev
7474 return &_netif;
7575 }
7676
77+ uint8_t * macAddress (uint8_t * mac) // WiFi lib way
78+ {
79+ memcpy (mac, &_netif.hwaddr , 6 );
80+ return mac;
81+ }
82+ void MACAddress (uint8_t * mac) // Ethernet lib way
83+ {
84+ macAddress (mac);
85+ }
7786 IPAddress localIP () const
7887 {
7988 return IPAddress (ip4_addr_get_u32 (ip_2_ip4 (&_netif.ip_addr )));
@@ -86,6 +95,29 @@ class LwipIntfDev: public LwipIntf, public RawDev
8695 {
8796 return IPAddress (ip4_addr_get_u32 (ip_2_ip4 (&_netif.gw )));
8897 }
98+ IPAddress dnsIP (int n) const // WiFi lib way
99+ {
100+ return IPAddress (dns_getserver (n));
101+ }
102+ IPAddress dnsServerIP () const // Ethernet lib way
103+ {
104+ return dnsIP (0 );
105+ }
106+ void setDNS (IPAddress dns1, IPAddress dns2 = INADDR_ANY) // WiFi lib way
107+ {
108+ if (dns1.isSet ())
109+ {
110+ dns_setserver (0 , dns1);
111+ }
112+ if (dns2.isSet ())
113+ {
114+ dns_setserver (1 , dns2);
115+ }
116+ }
117+ void setDnsServerIP (const IPAddress dnsIP) // Ethernet lib way
118+ {
119+ setDNS (dnsIP);
120+ }
89121
90122 // 1. Currently when no default is set, esp8266-Arduino uses the first
91123 // DHCP client interface receiving a valid address and gateway to
You can’t perform that action at this time.
0 commit comments