@@ -192,19 +192,26 @@ uint8_t WiFiClass::beginEnterprise(const char* ssid, const char* username, const
192
192
193
193
void WiFiClass::config (IPAddress local_ip)
194
194
{
195
- WiFiDrv::config (1 , (uint32_t )local_ip, 0 , 0 );
195
+ // Assume the DNS server will be the machine on the same network as the local IP
196
+ // but with last octet being '1'
197
+ IPAddress dns = local_ip;
198
+ dns[3 ] = 1 ;
199
+ config (local_ip, dns);
196
200
}
197
201
198
202
void WiFiClass::config (IPAddress local_ip, IPAddress dns_server)
199
203
{
200
- WiFiDrv::config (1 , (uint32_t )local_ip, 0 , 0 );
201
- WiFiDrv::setDNS (1 , (uint32_t )dns_server, 0 );
204
+ // Assume the gateway will be the machine on the same network as the local IP
205
+ // but with last octet being '1'
206
+ IPAddress gateway = local_ip;
207
+ gateway[3 ] = 1 ;
208
+ config (local_ip, dns_server, gateway);
202
209
}
203
210
204
211
void WiFiClass::config (IPAddress local_ip, IPAddress dns_server, IPAddress gateway)
205
212
{
206
- WiFiDrv::config ( 2 , ( uint32_t )local_ip, ( uint32_t )gateway , 0 );
207
- WiFiDrv::setDNS ( 1 , ( uint32_t ) dns_server, 0 );
213
+ IPAddress subnet ( 255 , 255 , 255 , 0 );
214
+ config (local_ip, dns_server, gateway, subnet );
208
215
}
209
216
210
217
void WiFiClass::config (IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
0 commit comments