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