|
Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
|
Parses the HUD's /commands text messages into typed commands (pure C++20, natively tested). More...
#include <cstdint>#include <string_view>Go to the source code of this file.
Classes | |
| struct | remote::Command |
| One parsed message. Only the fields matching kind are meaningful. More... | |
| class | remote::BaseRemoteSink |
| Receives parsed commands; implemented by the controller (device) and fakes (tests). More... | |
Enumerations | |
| enum class | remote::CommandKind : uint8_t { Poll , Move , Stop , Mode , Fire , Calibrate , Aim , Speed } |
| What a /commands message asks for. Poll is the keepalive and anything unrecognised. | |
| enum class | remote::RemoteMode : uint8_t { Ai , User } |
| Operating mode requested by the HUD. | |
| enum class | remote::CalAction : uint8_t { Start , Point , Cancel } |
| Calibration action requested by the HUD; same semantics as the physical button. More... | |
| enum class | remote::JogSpeed : uint8_t { Slow , Normal , Fast } |
| HUD jog magnitude setting. | |
Functions | |
| Command | remote::parse (std::string_view message) |
| Parses one message. | |
Parses the HUD's /commands text messages into typed commands (pure C++20, natively tested).
No Arduino or ESP-IDF headers and no heap use, so the parser runs on the host and in the httpd handler.
|
strong |
| Command remote::parse | ( | std::string_view | message | ) |
Parses one message.
Exact, case-sensitive match on the whole view (it need not be NUL-terminated, and the receive buffer is not). Anything unrecognised (empty, unknown text, trailing bytes) yields a Poll command. aim:<x>,<y> takes 1 to 3 plain decimal digits per number (no sign, spaces or extra bytes), x in 0..319 and y in 0..239; anything else is a Poll.