diff --git a/src/BlinkerSimpleESP32_MQTT.h b/src/BlinkerSimpleESP32_MQTT.h index df1788a3..da5501ad 100644 --- a/src/BlinkerSimpleESP32_MQTT.h +++ b/src/BlinkerSimpleESP32_MQTT.h @@ -14,21 +14,21 @@ class BlinkerSimpleESP32_MQTT {} #if defined(BLINKER_ESP_SMARTCONFIG) - void begin(const char* auth) { + void begin(const char* _auth) { Base::begin(); smartconfig(); - this->conn.begin(auth); + this->conn.begin(_auth); BLINKER_LOG1("ESP32_MQTT Initialled..."); } #endif - void begin( const char* auth, - const char* ssid, - const char* pswd) + void begin( const char* _auth, + const char* _ssid, + const char* _pswd) { Base::begin(); - connectWiFi(ssid, pswd); - this->conn.begin(auth); + connectWiFi(_ssid, _pswd); + this->conn.begin(_auth); BLINKER_LOG1("ESP32_MQTT Initialled..."); } @@ -40,14 +40,14 @@ class BlinkerSimpleESP32_MQTT BLINKER_LOG1("Waiting for SmartConfig."); while (!WiFi.smartConfigDone()) { - delay(500); + ::delay(500); } BLINKER_LOG1("SmartConfig received."); BLINKER_LOG1("Waiting for WiFi"); while (WiFi.status() != WL_CONNECTED) { - delay(500); + ::delay(500); } BLINKER_LOG1("WiFi Connected."); @@ -59,17 +59,17 @@ class BlinkerSimpleESP32_MQTT } #endif - void connectWiFi(const char* ssid, const char* pswd) + void connectWiFi(const char* _ssid, const char* _pswd) { uint32_t connectTime = millis(); - BLINKER_LOG2(("Connecting to "), ssid); + BLINKER_LOG2(("Connecting to "), _ssid); WiFi.mode(WIFI_STA); - if (pswd && strlen(pswd)) { - WiFi.begin(ssid, pswd); + if (_pswd && strlen(_pswd)) { + WiFi.begin(_ssid, _pswd); } else { - WiFi.begin(ssid); + WiFi.begin(_ssid); } while (WiFi.status() != WL_CONNECTED) { diff --git a/src/BlinkerSimpleESP32_WS.h b/src/BlinkerSimpleESP32_WS.h index 187c9aa1..9d203d6f 100644 --- a/src/BlinkerSimpleESP32_WS.h +++ b/src/BlinkerSimpleESP32_WS.h @@ -23,11 +23,11 @@ class BlinkerSimpleESP32_WS } #endif - void begin(const char* ssid, - const char* pswd) + void begin(const char* _ssid, + const char* _pswd) { Base::begin(); - connectWiFi(ssid, pswd); + connectWiFi(_ssid, _pswd); BLINKER_LOG1("ESP32_WiFi Initialled..."); } @@ -74,17 +74,17 @@ class BlinkerSimpleESP32_WS this->conn.begin(macDeviceName()); } - void connectWiFi(const char* ssid, const char* pswd) + void connectWiFi(const char* _ssid, const char* _pswd) { uint32_t connectTime = millis(); - BLINKER_LOG2(BLINKER_F("Connecting to "), ssid); + BLINKER_LOG2(BLINKER_F("Connecting to "), _ssid); WiFi.mode(WIFI_STA); - if (pswd && strlen(pswd)) { - WiFi.begin(ssid, pswd); + if (_pswd && strlen(_pswd)) { + WiFi.begin(_ssid, _pswd); } else { - WiFi.begin(ssid); + WiFi.begin(_ssid); } while (WiFi.status() != WL_CONNECTED) { diff --git a/src/BlinkerSimpleESP8266_MQTT.h b/src/BlinkerSimpleESP8266_MQTT.h index 1c4cfb41..910af07d 100644 --- a/src/BlinkerSimpleESP8266_MQTT.h +++ b/src/BlinkerSimpleESP8266_MQTT.h @@ -2,7 +2,8 @@ #define BlinkerSimplerESP8266_MQTT_H #include "Adapters/BlinkerMQTT.h" -// #include +#include +#include class BlinkerSimpleESP8266_MQTT : public BlinkerProtocol @@ -15,40 +16,40 @@ class BlinkerSimpleESP8266_MQTT {} #if defined(BLINKER_ESP_SMARTCONFIG) - void begin(const char* auth) { + void begin(const char* _auth) { Base::begin(); smartconfig(); - this->conn.begin(auth); + this->conn.begin(_auth); BLINKER_LOG1("ESP8266_MQTT Initialled..."); } #endif - void begin( const char* auth, - const char* ssid, - const char* pswd) + void begin( const char* _auth, + const char* _ssid, + const char* _pswd) { Base::begin(); - connectWiFi(ssid, pswd); - this->conn.begin(auth); + connectWiFi(_ssid, _pswd); + this->conn.begin(_auth); BLINKER_LOG1("ESP8266_MQTT Initialled..."); } private : - #if defined(BLINKER_ESP_SMARTCONFIG) +#if defined(BLINKER_ESP_SMARTCONFIG) void smartconfig() { WiFi.mode(WIFI_STA); WiFi.beginSmartConfig(); BLINKER_LOG1("Waiting for SmartConfig."); while (!WiFi.smartConfigDone()) { - delay(500); + ::delay(500); } BLINKER_LOG1("SmartConfig received."); BLINKER_LOG1("Waiting for WiFi"); while (WiFi.status() != WL_CONNECTED) { - delay(500); + ::delay(500); } BLINKER_LOG1("WiFi Connected."); @@ -74,17 +75,17 @@ class BlinkerSimpleESP8266_MQTT // this->conn.begin(macDeviceName()); // } - void connectWiFi(const char* ssid, const char* pswd) + void connectWiFi(const char* _ssid, const char* _pswd) { uint32_t connectTime = millis(); - BLINKER_LOG2(("Connecting to "), ssid); + BLINKER_LOG2(("Connecting to "), _ssid); WiFi.mode(WIFI_STA); - if (pswd && strlen(pswd)) { - WiFi.begin(ssid, pswd); + if (_pswd && strlen(_pswd)) { + WiFi.begin(_ssid, _pswd); } else { - WiFi.begin(ssid); + WiFi.begin(_ssid); } while (WiFi.status() != WL_CONNECTED) { diff --git a/src/BlinkerSimpleESP8266_WS.h b/src/BlinkerSimpleESP8266_WS.h index 58cb4c36..b1433703 100644 --- a/src/BlinkerSimpleESP8266_WS.h +++ b/src/BlinkerSimpleESP8266_WS.h @@ -23,11 +23,11 @@ class BlinkerSimpleESP8266_WS } #endif - void begin(const char* ssid, - const char* pswd) + void begin(const char* _ssid, + const char* _pswd) { Base::begin(); - connectWiFi(ssid, pswd); + connectWiFi(_ssid, _pswd); BLINKER_LOG1("ESP8266_WiFi Initialled..."); } @@ -39,14 +39,14 @@ class BlinkerSimpleESP8266_WS BLINKER_LOG1("Waiting for SmartConfig."); while (!WiFi.smartConfigDone()) { - delay(500); + ::delay(500); } BLINKER_LOG1("SmartConfig received."); BLINKER_LOG1("Waiting for WiFi"); while (WiFi.status() != WL_CONNECTED) { - delay(500); + ::delay(500); } BLINKER_LOG1("WiFi Connected."); @@ -74,17 +74,17 @@ class BlinkerSimpleESP8266_WS this->conn.begin(macDeviceName()); } - void connectWiFi(const char* ssid, const char* pswd) + void connectWiFi(const char* _ssid, const char* _pswd) { uint32_t connectTime = millis(); - BLINKER_LOG2(BLINKER_F("Connecting to "), ssid); + BLINKER_LOG2(BLINKER_F("Connecting to "), _ssid); WiFi.mode(WIFI_STA); - if (pswd && strlen(pswd)) { - WiFi.begin(ssid, pswd); + if (_pswd && strlen(_pswd)) { + WiFi.begin(_ssid, _pswd); } else { - WiFi.begin(ssid); + WiFi.begin(_ssid); } while (WiFi.status() != WL_CONNECTED) {