Add QR-code WiFi onboarding screen
Vendors two small MIT/BSD-3-Clause libraries rather than hand-rolling either: Nayuki's qrcodegen (QR matrix generation) and Waveshare's Font24 bitmap table from their e-Paper repo (same repo the epd7in3e driver came from) for rendering readable text on the panel. qr_onboarding_show() builds a standard WIFI:T:WPA;S:...;P:...;; payload, rasterizes the QR module matrix plus the SSID and password as plaintext underneath (for anyone provisioning from a device that can't scan a QR) onto a malloc'd frame buffer, and pushes it to the panel via epd_display_buffer(). The buffer is heap-allocated on demand rather than statically reserved, since 192KB held permanently in BSS would eat into the RAM budget the HTTP fetch path (task 6) is specifically trying to keep free. Wired into wifi_provisioning_start() before the softAP comes up, so the join instructions are already on-screen by the time the network is joinable.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
/**
|
||||
* Renders a WiFi-join QR code for the given AP SSID/password onto the
|
||||
* e-ink panel, with the password (and SSID) also printed as plaintext
|
||||
* underneath for anyone provisioning from a device that can't scan a QR
|
||||
* code. Call after epd_init() and before the softAP goes up, so the join
|
||||
* instructions are already on-screen by the time the network is joinable.
|
||||
*/
|
||||
esp_err_t qr_onboarding_show(const char *ssid, const char *password);
|
||||
Reference in New Issue
Block a user