22 lines
571 B
C++
22 lines
571 B
C++
#pragma once
|
|
#include <Arduino.h>
|
|
|
|
namespace CommandMgr {
|
|
|
|
struct Command {
|
|
long id = 0;
|
|
String type; // "lights","camera","sleep","ring_fence","custom"
|
|
String payload; // raw JSON payload
|
|
};
|
|
|
|
void configure(const String& baseUrl, const String& imei);
|
|
|
|
// Poll the server for queued commands and execute them.
|
|
void poll(uint32_t minIntervalMs = 30000);
|
|
|
|
// (Optional) simple handlers you can expand later.
|
|
bool handleLights(const String& payload);
|
|
bool handleSleep(const String& payload);
|
|
bool handleRingFence(const String& payload);
|
|
|
|
} |