@@ -192,19 +192,26 @@ uint8_t WiFiClass::beginEnterprise(const char* ssid, const char* username, const
192192
193193void WiFiClass::config (IPAddress local_ip)
194194{
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);
196200}
197201
198202void WiFiClass::config (IPAddress local_ip, IPAddress dns_server)
199203{
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);
202209}
203210
204211void WiFiClass::config (IPAddress local_ip, IPAddress dns_server, IPAddress gateway)
205212{
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 );
208215}
209216
210217void WiFiClass::config (IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
0 commit comments