File tree 1 file changed +32
-0
lines changed
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
74
74
return &_netif;
75
75
}
76
76
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
+ }
77
86
IPAddress localIP () const
78
87
{
79
88
return IPAddress (ip4_addr_get_u32 (ip_2_ip4 (&_netif.ip_addr )));
@@ -86,6 +95,29 @@ class LwipIntfDev: public LwipIntf, public RawDev
86
95
{
87
96
return IPAddress (ip4_addr_get_u32 (ip_2_ip4 (&_netif.gw )));
88
97
}
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
+ }
89
121
90
122
// 1. Currently when no default is set, esp8266-Arduino uses the first
91
123
// DHCP client interface receiving a valid address and gateway to
You can’t perform that action at this time.
0 commit comments