Skip to content

Commit 3d99fbe

Browse files
committed
Blink WiFi icon when no internet is available
1 parent d176b3c commit 3d99fbe

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Firmware/RTK_Everywhere/Display.ino

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ void setRadioIcons(std::vector<iconPropertyBlinking> *iconList)
664664
// ESP-Now + Bluetooth + WiFi
665665

666666
// Count the number of radios in use
667-
uint8_t numberOfRadios = 1; // Bluetooth always indicated. TODO don't count if BT radio type is OFF.
667+
uint8_t numberOfRadios = 1; // Bluetooth always indicated.
668668
if (wifiStationRunning || wifiSoftApRunning)
669669
numberOfRadios++;
670670
if (wifiEspNowRunning)
@@ -747,8 +747,22 @@ void setRadioIcons(std::vector<iconPropertyBlinking> *iconList)
747747
iconList->push_back(prop);
748748
}
749749

750-
if (wifiStationRunning || wifiSoftApRunning) // WiFi : Columns 34 - 46
750+
// WiFi : Columns 34 - 46
751+
if (wifiStationRunning && networkInterfaceHasInternet(NETWORK_WIFI_STATION))
752+
{
753+
//Display solid icon based on RSSI
754+
displayWiFiIcon(iconList, prop, ICON_POSITION_CENTER, 0b11111111);
755+
}
756+
else if (wifiStationRunning && (networkInterfaceHasInternet(NETWORK_WIFI_STATION) == false))
757+
{
758+
// We are not connected, blink icon
759+
displayWiFiFullIcon(iconList, prop, ICON_POSITION_CENTER, 0b00001111);
760+
}
761+
else if(wifiSoftApRunning)
762+
{
763+
// We are in AP mode, solid WiFi icon
751764
displayWiFiIcon(iconList, prop, ICON_POSITION_CENTER, 0b11111111);
765+
}
752766

753767
#ifdef COMPILE_CELLULAR
754768
// Cellular : Columns 49 - 61
@@ -1139,10 +1153,14 @@ void setWiFiIcon_TwoRadios(std::vector<iconPropertyBlinking> *iconList)
11391153
}
11401154
}
11411155
else
1156+
{
11421157
displayWiFiIcon(iconList, prop, ICON_POSITION_LEFT, 0b11111111);
1158+
}
11431159
}
11441160
else // We are not paired, blink icon
1161+
{
11451162
displayWiFiFullIcon(iconList, prop, ICON_POSITION_LEFT, 0b00001111);
1163+
}
11461164
#endif // COMPILE_WIFI
11471165
}
11481166

0 commit comments

Comments
 (0)