Add WiFi setup QR to ESP32 displays
This commit is contained in:
1 parent
8ef309a299
commit
1264f62e9d
11 files changed
+165
-3
No files matched your search
@@ -70,6 +70,7 @@ MultiSerialInterface interface_manager;
|
||||
#include <helpers/CompanionWiFiNtpPolicy.h>
|
||||
#include <helpers/ui/DisplayTextLayout.h>
|
||||
#include <helpers/ui/IndicatorRenderProfile.h>
|
||||
#include <helpers/ui/WiFiSetupQrDisplay.h>
|
||||
#include <helpers/esp32/SntpOperationCoordinator.h>
|
||||
#include <helpers/esp32/TlsClockValidity.h>
|
||||
#include <helpers/esp32/WiFiRadioPolicy.h>
|
||||
@@ -1286,6 +1287,11 @@ void halt() {
|
||||
char setup_ip[16] = {0};
|
||||
if (WebConfigServer::getSetupInfo(setup_ssid, sizeof(setup_ssid),
|
||||
setup_ip, sizeof(setup_ip))) {
|
||||
if (mesh::ui::drawWiFiSetupQr(
|
||||
*companion_setup_display, setup_ssid, setup_ip)) {
|
||||
companion_setup_display->endFrame();
|
||||
return;
|
||||
}
|
||||
if (hasLargeCompanionSetupDisplay()) {
|
||||
renderLargeCompanionSetupDisplay(
|
||||
"WebUI setup", "Join open WiFi:", setup_ssid, setup_ip, false);
|
||||
@@ -1749,7 +1755,11 @@ void setup() {
|
||||
}
|
||||
#if defined(ESP32) && defined(WIFI_SSID)
|
||||
companion_display_available = disp != NULL;
|
||||
#if defined(SENSECAP_INDICATOR_LORA)
|
||||
companion_display_begin_status = display.beginStatus();
|
||||
#else
|
||||
companion_display_begin_status = companion_display_available ? 1 : 0;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "target.h"
|
||||
#include <Arduino.h>
|
||||
#include <helpers/CommonCLI.h>
|
||||
#include <helpers/ui/WiFiSetupQrDisplay.h>
|
||||
|
||||
#ifdef DISPLAY_REDRAW_ON_CHANGE
|
||||
#include <helpers/ui/DisplayFrameSignature.h>
|
||||
@@ -175,6 +176,9 @@ void UITask::renderCurrScreen() {
|
||||
char wc_ssid[33], wc_ip[16];
|
||||
if (WebConfigServer::getSetupInfo(wc_ssid, sizeof(wc_ssid), wc_ip, sizeof(wc_ip))) {
|
||||
// setup portal active: show join instructions instead of the home screen
|
||||
if (mesh::ui::drawWiFiSetupQr(*_display, wc_ssid, wc_ip)) {
|
||||
return;
|
||||
}
|
||||
_display->setTextSize(1);
|
||||
_display->setColor(UIColor::corp_blue);
|
||||
_display->setCursor(0, 0);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#endif
|
||||
#include <Arduino.h>
|
||||
#include <helpers/CommonCLI.h>
|
||||
#include <helpers/ui/WiFiSetupQrDisplay.h>
|
||||
|
||||
#ifdef DISPLAY_REDRAW_ON_CHANGE
|
||||
#include <helpers/ui/DisplayFrameSignature.h>
|
||||
@@ -175,6 +176,9 @@ void UITask::renderCurrScreen() {
|
||||
char wc_ssid[33], wc_ip[16];
|
||||
if (WebConfigServer::getSetupInfo(wc_ssid, sizeof(wc_ssid), wc_ip, sizeof(wc_ip))) {
|
||||
// setup portal active: show join instructions instead of the home screen
|
||||
if (mesh::ui::drawWiFiSetupQr(*_display, wc_ssid, wc_ip)) {
|
||||
return;
|
||||
}
|
||||
_display->setTextSize(1);
|
||||
_display->setColor(UIColor::corp_blue);
|
||||
_display->setCursor(0, 0);
|
||||
|
||||
Reference in new issue
Block a user