Skip to content

Commit 099359f

Browse files
committed
WiFi: Periodically display the WiFi state
1 parent f1d3212 commit 099359f

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -756,15 +756,15 @@ bool wifiStationEnabled(const char ** reason)
756756
// Verify that at least one SSID value is set
757757
if (wifiStationSsidSet == false)
758758
{
759-
*reason = "SSID not available";
759+
*reason = ", SSID not available";
760760
break;
761761
}
762762

763763
// Determine if Wifi is begin restarted
764764
if (wifiStationRestart)
765765
{
766766
wifiStationRestart = false;
767-
*reason = "restart requested";
767+
*reason = ", restart requested";
768768
break;
769769
}
770770

@@ -778,19 +778,19 @@ bool wifiStationEnabled(const char ** reason)
778778
// Build the reason
779779
if (reasonBuffer)
780780
{
781-
sprintf(reasonBuffer,"is lower priority than %s", networkGetCurrentInterfaceName());
781+
sprintf(reasonBuffer,", is lower priority than %s", networkGetCurrentInterfaceName());
782782
*reason = reasonBuffer;
783783
}
784784

785785
// Allocation failed
786786
else
787-
*reason = "is lower priority";
787+
*reason = ", is lower priority";
788788
break;
789789
}
790790

791791
// WiFi should start and continue running
792792
enabled = true;
793-
*reason = "is enabled";
793+
*reason = ", is enabled";
794794
} while (0);
795795
return enabled;
796796
}
@@ -1056,6 +1056,14 @@ void wifiStationUpdate()
10561056
case WIFI_STATION_STATE_STABLE:
10571057
break;
10581058
}
1059+
1060+
// Periodically display the WiFi state
1061+
if (PERIODIC_DISPLAY(PD_WIFI_STATE))
1062+
{
1063+
systemPrintf("WiFi station state: %s%s\r\n",
1064+
wifiStationStateName[wifiStationState], reason);
1065+
PERIODIC_CLEAR(PD_WIFI_STATE);
1066+
}
10591067
}
10601068

10611069
//*********************************************************************

0 commit comments

Comments
 (0)