@@ -2785,6 +2785,21 @@ bool RTK_WIFI::stopStart(WIFI_ACTION_t stopping, WIFI_ACTION_t starting)
2785
2785
// Start the soft AP components
2786
2786
// ****************************************
2787
2787
2788
+ // Set the soft AP subnet mask, IP, gateway, DNS, and first DHCP addresses
2789
+ if (starting & WIFI_AP_SET_IP_ADDR)
2790
+ {
2791
+ Serial.println (" \n\r Running softAP set IP" );
2792
+ if (!softApSetIpAddress (_apIpAddress.toString ().c_str (),
2793
+ _apSubnetMask.toString ().c_str (),
2794
+ _apGatewayAddress.toString ().c_str (),
2795
+ _apDnsAddress.toString ().c_str (),
2796
+ _apFirstDhcpAddress.toString ().c_str ()))
2797
+ {
2798
+ break ;
2799
+ }
2800
+ _started = _started | WIFI_AP_SET_IP_ADDR;
2801
+ }
2802
+
2788
2803
// Set the soft AP SSID and password
2789
2804
if (starting & WIFI_AP_SET_SSID_PASSWORD)
2790
2805
{
@@ -2801,20 +2816,6 @@ bool RTK_WIFI::stopStart(WIFI_ACTION_t stopping, WIFI_ACTION_t starting)
2801
2816
_started = _started | WIFI_AP_SET_SSID_PASSWORD;
2802
2817
}
2803
2818
2804
- // Set the soft AP subnet mask, IP, gateway, DNS, and first DHCP addresses
2805
- if (starting & WIFI_AP_SET_IP_ADDR)
2806
- {
2807
- if (!softApSetIpAddress (_apIpAddress.toString ().c_str (),
2808
- _apSubnetMask.toString ().c_str (),
2809
- _apGatewayAddress.toString ().c_str (),
2810
- _apDnsAddress.toString ().c_str (),
2811
- _apFirstDhcpAddress.toString ().c_str ()))
2812
- {
2813
- break ;
2814
- }
2815
- _started = _started | WIFI_AP_SET_IP_ADDR;
2816
- }
2817
-
2818
2819
// Get the soft AP MAC address
2819
2820
WiFi.AP .macAddress (_apMacAddress);
2820
2821
0 commit comments