Skip to content

Commit 4f515d0

Browse files
committed
Move AP_SET_IP_ADDR above setting SSID and PW
This mimics previous firmware
1 parent 1052e65 commit 4f515d0

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2785,6 +2785,21 @@ bool RTK_WIFI::stopStart(WIFI_ACTION_t stopping, WIFI_ACTION_t starting)
27852785
// Start the soft AP components
27862786
//****************************************
27872787

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+
27882803
// Set the soft AP SSID and password
27892804
if (starting & WIFI_AP_SET_SSID_PASSWORD)
27902805
{
@@ -2801,20 +2816,6 @@ bool RTK_WIFI::stopStart(WIFI_ACTION_t stopping, WIFI_ACTION_t starting)
28012816
_started = _started | WIFI_AP_SET_SSID_PASSWORD;
28022817
}
28032818

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-
28182819
// Get the soft AP MAC address
28192820
WiFi.AP.macAddress(_apMacAddress);
28202821

0 commit comments

Comments
 (0)