File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -643,16 +643,25 @@ 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
{
664
+ IPAddress subnet (255 , 255 , 255 , 0 );
656
665
config (local_ip, dns_server, gateway, (uint32_t )0 );
657
666
}
658
667
You can’t perform that action at this time.
0 commit comments