ESP: first implementation; compiles fine; not tested with MCU
This commit is contained in:
1 parent
5bdcb51bff
commit
6bda641ce8
36 files changed
+6234
No files matched your search
@@ -0,0 +1,22 @@
|
||||
// commands.h — the WebUI -> device channel (SPEC C1).
|
||||
//
|
||||
// The device is never contacted directly. The WebUI writes a row into
|
||||
// `device_commands`; the endpoint attaches pending rows to the next
|
||||
// ingest/heartbeat response; this module executes them and acks.
|
||||
//
|
||||
// Deferred execution: some commands must not run inside the HTTP response
|
||||
// callback (OTA reboots, streaming blocks for a minute). Those are queued and
|
||||
// run from the main loop, which is also where sleep decisions are made.
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
// Pass this to apiIngest/apiHeartbeat. Parses and either executes immediately
|
||||
// or defers. Cheap commands ack from here; deferred ones ack on completion.
|
||||
void commandOnReceived(JsonObjectConst cmd);
|
||||
|
||||
// Run anything that was deferred. Call once per main-loop tick.
|
||||
void commandRunDeferred();
|
||||
|
||||
bool commandHasPending();
|
||||
Reference in new issue
Block a user