Files
t-embed-insecam-widget/main/insecam.h
T
Juli d92a2e53cc On-device menu, persistent settings and 12 favourite slots
Hold the knob to open a six-row menu: save/remove the playing camera as
a favourite (12 NVS slots), play or forget favourites, choose the
source (random insecam or favourites), time per camera, listing,
screen and ring brightness, caption, and reboot into Wi-Fi setup.
Settings live in NVS and override the Kconfig first-boot defaults.
Camera URLs are stored with their COUNTER placeholder so favourites get
a fresh cache-buster on every visit.
2026-09-17 00:57:02 +02:00

22 lines
875 B
C

#pragma once
#include <stddef.h>
#include <stdint.h>
#include "esp_err.h"
typedef struct {
uint32_t id; // insecam view id
char url[300]; // direct camera URL as listed (may contain a COUNTER placeholder)
char place[64]; // "Imola, Italy" (ASCII-folded for the built-in font)
char maker[24]; // "Mobotix"
} cam_info_t;
typedef enum { INSECAM_BY_RATING, INSECAM_BY_NEW } insecam_listing_t;
// Copies the camera URL with any COUNTER placeholder replaced by a fresh random number.
void insecam_effective_url(const cam_info_t *cam, char *out, size_t cap);
// Downloads one listing page (six cameras) and parses it. total_pages is
// updated from the page's own paginator when found.
esp_err_t insecam_fetch_page(insecam_listing_t listing, int page, cam_info_t *out, int max,
int *count, int *total_pages);