diff --git a/extras/test/CMakeLists.txt b/extras/test/CMakeLists.txt index a715ac5..920d3c7 100644 --- a/extras/test/CMakeLists.txt +++ b/extras/test/CMakeLists.txt @@ -23,7 +23,7 @@ include(FetchContent) FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG release-1.10.0 + GIT_TAG origin/master ) FetchContent_GetProperties(googletest) diff --git a/library.properties b/library.properties index f0b91c7..a1ac53d 100644 --- a/library.properties +++ b/library.properties @@ -5,7 +5,7 @@ sentence=Library enables you to connect the device to the SUPLA automation syste paragraph=It provides easy interface for adding various sensors, relays, buttons, roller shutters, etc. that can be controlled via SUPLA Cloud and application on mobile device. url=https://github.com/SUPLA/supla-arduino architectures=avr,esp32,esp8266 -version=2.3.4 +version=2.3.5 dependencies= core-dependencies=arduino (>=1.5.0) category=Communication diff --git a/src/SuplaDevice.cpp b/src/SuplaDevice.cpp index cc5566c..eafbd90 100644 --- a/src/SuplaDevice.cpp +++ b/src/SuplaDevice.cpp @@ -182,7 +182,7 @@ bool SuplaDeviceClass::begin(unsigned char version) { if (strnlen(Supla::Channel::reg_dev.SoftVer, SUPLA_SOFTVER_MAXSIZE) == 0) { setString(Supla::Channel::reg_dev.SoftVer, - "User SW, lib 2.3.4", + "User SW, lib 2.3.5", SUPLA_SOFTVER_MAXSIZE); } @@ -247,7 +247,7 @@ void SuplaDeviceClass::iterate(void) { if (!isInitialized(false)) return; unsigned long _millis = millis(); - unsigned long timeDiff = abs(_millis - lastIterateTime); + unsigned long timeDiff = _millis - lastIterateTime; uptime.iterate(_millis); diff --git a/src/SuplaDevice.h b/src/SuplaDevice.h index 8cd7580..cb8c8a4 100644 --- a/src/SuplaDevice.h +++ b/src/SuplaDevice.h @@ -95,7 +95,9 @@ class SuplaDeviceClass { bool begin(unsigned char version = 12); + // Use ASCII only in name void setName(const char *Name); + void setGUID(char GUID[SUPLA_GUID_SIZE]); void setAuthKey(char authkey[SUPLA_AUTHKEY_SIZE]); void setEmail(const char *email); diff --git a/src/supla/network/esp_wifi.h b/src/supla/network/esp_wifi.h index 18f2561..45bddf4 100644 --- a/src/supla/network/esp_wifi.h +++ b/src/supla/network/esp_wifi.h @@ -51,8 +51,7 @@ class ESPWifi : public Supla::Network { setSsid(wifiSsid); setPassword(wifiPassword); #ifdef ARDUINO_ARCH_ESP32 - enableSSL( - false); // current ESP32 WiFiClientSecure does not suport "setInsecure" + enableSSL(false); // ESP32 WiFiClientSecure does not suport "setInsecure" #endif } @@ -96,22 +95,19 @@ class ESPWifi : public Supla::Network { if (client == NULL) { if (isSecured) { message = "Secured connection"; - client = new WiFiClientSecure(); + auto clientSec = new WiFiClientSecure(); + client = clientSec; + +#ifdef ARDUINO_ARCH_ESP8266 + clientSec->setBufferSizes(2048, 512); // EXPERIMENTAL if (fingerprint.length() > 0) { message += " with certificate matching"; -#ifdef ARDUINO_ARCH_ESP8266 - ((WiFiClientSecure *)client)->setFingerprint(fingerprint.c_str()); -#else - message += " - NOT SUPPORTED ON ESP32 implmentation"; -#endif + clientSec->setFingerprint(fingerprint.c_str()); } else { message += " without certificate matching"; -#ifdef ARDUINO_ARCH_ESP8266 - ((WiFiClientSecure *)client)->setInsecure(); -#else - message += " - NOT SUPPORTED ON ESP32 implmentation"; -#endif + clientSec->setInsecure(); } +#endif } else { message = "unsecured connection"; client = new WiFiClient(); @@ -129,20 +125,8 @@ class ESPWifi : public Supla::Network { server, connectionPort); -#ifdef ARDUINO_ARCH_ESP8266 - static_cast(client)->setBufferSizes(2048, 512); // EXPERIMENTAL -#endif - bool result = client->connect(server, connectionPort); - if (result && isSecured) { - if (!((WiFiClientSecure *)client)->verify(fingerprint.c_str(), server)) { - supla_log(LOG_DEBUG, "Provided certificates doesn't match!"); - client->stop(); - return false; - } - }; - return result; }