Move ssid check to iniSTA method

This commit is contained in:
lorow 2024-01-23 19:59:14 +01:00
parent 73780688b2
commit 24926853fe

View File

@ -42,8 +42,7 @@ void WiFiHandler::begin() {
// since networks may not have a password, we only need to check if we have an ssid
// bail if we don't
if (this->ssid != "" &&
this->iniSTA(
if (this->iniSTA(
this->ssid,
this->password,
this->channel,
@ -135,6 +134,12 @@ bool WiFiHandler::iniSTA(const std::string& ssid,
const std::string& password,
uint8_t channel,
wifi_power_t power) {
if (ssid == ""){
log_d("ssid missing, bailing");
return false;
}
unsigned long currentMillis = millis();
unsigned long startingMillis = currentMillis;
int connectionTimeout = 45000; // 30 seconds