Skip to content

Commit

Permalink
condition to wifi status
Browse files Browse the repository at this point in the history
  • Loading branch information
pr3y authored May 14, 2024
1 parent 8312845 commit c52c76b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/clients.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ void ssh_loop() {
}

void ssh_setup(){
if (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print("Connect to wifi before using wireguard");
displayRedStripe("CONNECT TO WIFI",TFT_WHITE, TFT_RED);
delay(5000);
return;
}
tft.fillScreen(BGCOLOR);
tft.setCursor(0, 0);
Serial.begin(115200); // Initialize serial communication for debugging
Expand Down Expand Up @@ -373,6 +380,13 @@ void telnet_loop() {
}

void telnet_setup() {
if (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print("Connect to wifi before using wireguard");
displayRedStripe("CONNECT TO WIFI",TFT_WHITE, TFT_RED);
delay(5000);
return;
}
tft.fillScreen(BGCOLOR);
tft.setCursor(0, 0);
Serial.begin(115200); // Initialize serial communication for debugging
Expand Down

0 comments on commit c52c76b

Please sign in to comment.