Made some changes, +1 is a workarround

This commit is contained in:
CommanderRedYT
2022-02-26 16:56:40 +01:00
parent 5bba53bfb9
commit 86cae5d564
2 changed files with 4 additions and 4 deletions

View File

@ -21,11 +21,11 @@ public:
{ {
using namespace espgui; using namespace espgui;
QRCode qrcode; QRCode qrcode;
const auto ver = get_qrver_from_strlen(m_msg); const auto ver = get_qrver_from_strlen(m_msg) + 1;
uint8_t qrcodeBytes[qrcode_getBufferSize(ver)]; uint8_t qrcodeBytes[qrcode_getBufferSize(ver)];
qrcode_initText(&qrcode, qrcodeBytes, ver, ECC_MEDIUM, m_msg.data()); qrcode_initText(&qrcode, qrcodeBytes, ver, ECC_MEDIUM, m_msg.data());
const uint8_t multiplier = (tft.width() - 18) / qrcode.size; const uint8_t multiplier = (tft.width() - 9) / qrcode.size;
const uint8_t x_offset = (tft.width() - qrcode.size * multiplier) / 2; const uint8_t x_offset = (tft.width() - qrcode.size * multiplier) / 2;
const uint8_t y_offset = (tft.height() - qrcode.size * multiplier) / 2; const uint8_t y_offset = (tft.height() - qrcode.size * multiplier) / 2;

View File

@ -331,7 +331,7 @@ std::string get_wifi_security_string(wifi_auth_mode_t authMode)
switch (authMode) switch (authMode)
{ {
case WIFI_AUTH_OPEN: case WIFI_AUTH_OPEN:
return "nopass"; return "";
case WIFI_AUTH_WEP: case WIFI_AUTH_WEP:
return "WEP"; return "WEP";
case WIFI_AUTH_WPA_PSK: case WIFI_AUTH_WPA_PSK:
@ -339,7 +339,7 @@ std::string get_wifi_security_string(wifi_auth_mode_t authMode)
case WIFI_AUTH_WPA_WPA2_PSK: case WIFI_AUTH_WPA_WPA2_PSK:
return "WPA"; return "WPA";
default: default:
return "unknown"; return "";
} }
} }