@@ -643,17 +643,26 @@ uint32_t WiFiClass::provisioned()
643643
644644void WiFiClass::config (IPAddress local_ip)
645645{
646- config (local_ip, (uint32_t )0 );
646+ // Assume the DNS server will be the machine on the same network as the local IP
647+ // but with last octet being '1'
648+ IPAddress dns = local_ip;
649+ dns[3 ] = 1 ;
650+ config (local_ip, dns);
647651}
648652
649653void WiFiClass::config (IPAddress local_ip, IPAddress dns_server)
650654{
651- config (local_ip, dns_server, (uint32_t )0 );
655+ // Assume the gateway will be the machine on the same network as the local IP
656+ // but with last octet being '1'
657+ IPAddress gateway = local_ip;
658+ gateway[3 ] = 1 ;
659+ config (local_ip, dns_server, gateway);
652660}
653661
654662void WiFiClass::config (IPAddress local_ip, IPAddress dns_server, IPAddress gateway)
655663{
656- config (local_ip, dns_server, gateway, (uint32_t )0 );
664+ IPAddress subnet (255 , 255 , 255 , 0 );
665+ config (local_ip, dns_server, gateway, subnet);
657666}
658667
659668void WiFiClass::config (IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
0 commit comments