Skip to content

Commit

Permalink
L-Band Keys: Limit WiFi connection attempts when no WiFi available
Browse files Browse the repository at this point in the history
Fix for issue #454
  • Loading branch information
nseidle committed May 5, 2023
1 parent fc7283c commit 5074c60
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Firmware/RTK_Surveyor/States.ino
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,11 @@ void updateSystemState()
else if (strlen(settings.pointPerfectCurrentKey) == 0 || strlen(settings.pointPerfectNextKey) == 0)
{
log_d("L_Band Keys starting WiFi");

//Temporarily limit WiFi connection attempts
wifiOriginalMaxConnectionAttempts = wifiMaxConnectionAttempts;
wifiMaxConnectionAttempts = 0; //Override setting during key retrieval. Give up after single failure.

wifiStart();
changeState(STATE_KEYS_PROVISION_WIFI_STARTED);
}
Expand Down Expand Up @@ -775,6 +780,11 @@ void updateSystemState()
if (online.rtc == false)
{
log_d("Keys Needed RTC off starting WiFi");

//Temporarily limit WiFi connection attempts
wifiOriginalMaxConnectionAttempts = wifiMaxConnectionAttempts;
wifiMaxConnectionAttempts = 0; //Override setting during key retrieval. Give up after single failure.

wifiStart();
changeState(STATE_KEYS_WIFI_STARTED); //If we can't check the RTC, continue
}
Expand Down

0 comments on commit 5074c60

Please sign in to comment.