feat(firmware): honor server X-Interval-Ms instead of capping at 60s
The dev-only cap that forced every-1-min polling regardless of the app's schedule is removed. The device now sleeps for whatever X-Interval-Ms the server hands back (driven by rotationIntervalMinutes / wakeTimes), clamped to [30s, 25h] as a safety net against malformed values. Renamed FETCH_INTERVAL_MS to FETCH_INTERVAL_MS_FALLBACK — it's now *only* used when the header is absent (rare; rolling deploy / hand- crafted response). Added SLEEP_CLAMP_MIN/MAX for the bounds. Tests FW-09 and FW-10 flipped to lock the new behavior; added FW-10b covering sub-MIN clamping (battery protection if server sends 1000ms). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -8,7 +8,9 @@
|
||||
#define NVS_KEY_IMG_ID "img_id"
|
||||
#define NVS_KEY_DRAW_NEEDED "draw"
|
||||
#define IMAGE_PATH "/img.bin"
|
||||
#define FETCH_INTERVAL_MS 60000ULL
|
||||
#define FETCH_INTERVAL_MS_FALLBACK 60000ULL
|
||||
#define SLEEP_CLAMP_MIN_MS 30000ULL
|
||||
#define SLEEP_CLAMP_MAX_MS (25ULL * 60ULL * 60ULL * 1000ULL)
|
||||
#define WIFI_TIMEOUT_MS 30000
|
||||
#define RESET_HOLD_MS 5000
|
||||
#define AP_IP "192.168.4.1"
|
||||
|
||||
Reference in New Issue
Block a user