From a7aef5d1e2d8dfec74e06373e53088eb9329e2f3 Mon Sep 17 00:00:00 2001 From: cziter15 Date: Wed, 19 Jun 2024 13:54:28 +0200 Subject: [PATCH] Bugfix --- src/ksf/comp/ksDevicePortal.cpp | 21 ++++++++++++--------- src/ksf/comp/ksMqttConfigProvider.cpp | 8 +++++--- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/ksf/comp/ksDevicePortal.cpp b/src/ksf/comp/ksDevicePortal.cpp index 48050ca..8565e56 100644 --- a/src/ksf/comp/ksDevicePortal.cpp +++ b/src/ksf/comp/ksDevicePortal.cpp @@ -14,22 +14,25 @@ #if defined(ESP32) || defined(ESP8266) #if ESP8266 - #include "flash_hal.h" - #include "ESP8266WiFi.h" - #include "WiFiClient.h" - #include "ESP8266WebServer.h" #define HARDWARE "ESP8266" + #include "flash_hal.h" + #include + #include + + using WebServerClass = ESP8266WebServer; + uint8_t ESP_getFlashVendor() { return ESP.getFlashChipVendorId(); } uint32_t ESP_getFlashSizeKB() { return ESP.getFlashChipRealSize()/1024; } #elif ESP32 - #include "WiFi.h" - #include "WiFiClient.h" - #include "WebServer.h" - #include "nvs_flash.h" - #define WebServerClass WebServer #define HARDWARE "ESP32" + #include + #include + #include "nvs_flash.h" + + using WebServerClass = WebServer; + extern uint32_t ESP_getFlashChipId(void); uint8_t ESP_getFlashVendor() { return ESP_getFlashChipId() & 0xFF; } uint32_t ESP_getFlashSizeKB() { return ESP.getFlashChipSize()/1024; } diff --git a/src/ksf/comp/ksMqttConfigProvider.cpp b/src/ksf/comp/ksMqttConfigProvider.cpp index cafcecd..afc8f94 100644 --- a/src/ksf/comp/ksMqttConfigProvider.cpp +++ b/src/ksf/comp/ksMqttConfigProvider.cpp @@ -28,13 +28,15 @@ namespace ksf::comps const char MQTT_BROKER_ADDRESS_TEXT[] PROGMEM {"MQTT Address"}; const char MQTT_BROKER_PORT_TEXT[] PROGMEM {"MQTT Port"}; - #ifdef ESP8266 + +#ifdef ESP8266 const auto MQTT_SSL_FP_LEN{40}; const char MQTT_BROKER_SSL_FINGERPRINT_TEXT[] PROGMEM {"MQTT SSL Fingerprint (SHA1)"}; - #else +#else const auto MQTT_SSL_FP_LEN{64}; const char MQTT_BROKER_SSL_FINGERPRINT_TEXT[] PROGMEM {"MQTT SSL Fingerprint (SHA256)"}; - #endif +#endif + const char MQTT_BROKER_USER_TEXT[] PROGMEM {"MQTT Username"}; const char MQTT_BROKER_PASSWORD_TEXT[] PROGMEM {"MQTT Password"}; const char MQTT_BROKER_PREFIX_TEXT[] PROGMEM {"MQTT Topic Prefix"};