@@ -643,17 +643,26 @@ uint32_t WiFiClass::provisioned()
643
643
644
644
void WiFiClass::config (IPAddress local_ip)
645
645
{
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);
647
651
}
648
652
649
653
void WiFiClass::config (IPAddress local_ip, IPAddress dns_server)
650
654
{
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);
652
660
}
653
661
654
662
void WiFiClass::config (IPAddress local_ip, IPAddress dns_server, IPAddress gateway)
655
663
{
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);
657
666
}
658
667
659
668
void WiFiClass::config (IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
0 commit comments