From 4bf44f0051b8e8b06f354ba24b88cf41fb415102 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sat, 30 Jan 2021 18:19:25 +0100 Subject: [PATCH] Remove unued if --- WifiInterface.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/WifiInterface.cpp b/WifiInterface.cpp index 709d7dd..09a317e 100644 --- a/WifiInterface.cpp +++ b/WifiInterface.cpp @@ -198,22 +198,15 @@ 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")); - + StringFormatter::send(wifiStream, F("AT+CWJAP=\"%S\",\"%S\"\r\n"), SSid, password); + ipOK = checkForOK(WIFI_CONNECT_TIMEOUT, OK_SEARCH, true); } 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); - } + StringFormatter::send(wifiStream, F("AT+CWJAP_CUR=\"%S\",\"%S\"\r\n"), SSid, password); + ipOK = checkForOK(WIFI_CONNECT_TIMEOUT, OK_SEARCH, true); } if (ipOK) {