Files
espresso_frame/firmware/main/frame_client.h
T
tfaour f74085cedf Add third button: "scan to manage" QR overlay on the current photo
Pressing the manage button (GPIO1) overlays a small QR code -- "SCAN TO
MANAGE" -- in the top-right corner of whatever photo is currently on
screen, linking to the server's config page, then reverts to the plain
photo after 30 seconds.

The overlay is spliced into the existing streaming fetch as chunks pass
through (frame_client.c's http_read_fn), rather than buffering the full
192,000-byte frame in RAM: only the small overlay rectangle itself
(~30KB) is ever held in memory, generated via new stride-parameterized
drawing helpers (epd_draw_*_ex in epd_draw.c) that let the existing
QR/text drawing code target an arbitrarily-sized buffer instead of a
full-frame one. epd7in3e.c is untouched -- it has no idea an overlay
exists.
2026-07-19 00:50:07 -04:00

34 lines
1.4 KiB
C

#pragma once
#include <stdbool.h>
#include "esp_err.h"
#include "wifi_provisioning.h"
/**
* Connects to the home WiFi network described by cfg, retrying up to
* CONFIG_FRAME_STA_CONNECT_MAX_RETRIES times with a per-attempt timeout of
* CONFIG_FRAME_STA_CONNECT_TIMEOUT_MS. Returns ESP_OK once an IP address
* has been obtained, ESP_FAIL if all retries are exhausted.
*/
esp_err_t frame_wifi_connect_sta(const frame_config_t *cfg);
/**
* Runs the frame's normal-operation cycle: fetch the current image from
* cfg->toolsserver, display it, and deep-sleep until the next refresh.
*
* If force_advance is true (the next-photo button was held), the fetch
* forces the server to skip ahead to the next photo immediately
* (POST /frame/advance) instead of the normal idempotent GET /frame/image
* -- the server decides on its own whether to advance in the normal case,
* based on its configured refresh interval, so a plain wake/reboot never
* skips a photo just by asking.
*
* If show_management_qr is true (the manage button was held), the
* displayed photo gets a small "scan to manage" QR overlay in the
* top-right corner linking to the server's config page, held for 30
* seconds (the device stays awake), then reverted back to the plain
* photo before proceeding to the normal sleep-interval logic.
*/
void frame_client_run(const frame_config_t *cfg, bool force_advance, bool show_management_qr);