1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 21:21:24 +01:00

Remove unued if

This commit is contained in:
Harald Barth 2021-01-30 18:19:25 +01:00
parent b6847419fc
commit 4bf44f0051

View File

@ -198,23 +198,16 @@ wifiSerialState WifiInterface::setup2(const __FlashStringHelper* SSid, const __F
// SSID was configured, so we assume station (client) mode.
if (oldCmd) {
// AT command early version supports CWJAP/CWSAP
if (SSid) { // why if SSid
StringFormatter::send(wifiStream, F("AT+CWJAP=\"%S\",\"%S\"\r\n"), SSid, password);
ipOK = checkForOK(WIFI_CONNECT_TIMEOUT, OK_SEARCH, true);
}
DIAG(F("\n**\n"));
} else {
// later version supports CWJAP_CUR
StringFormatter::send(wifiStream, F("AT+CWHOSTNAME=\"%S\"\r\n"), hostname); // Set Host name for Wifi Client
checkForOK(2000, OK_SEARCH, true); // dont care if not supported
if (SSid) { // why if SSid
StringFormatter::send(wifiStream, F("AT+CWJAP_CUR=\"%S\",\"%S\"\r\n"), SSid, password);
ipOK = checkForOK(WIFI_CONNECT_TIMEOUT, OK_SEARCH, true);
}
}
if (ipOK) {
// But we really only have the ESSID and password correct