|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Drops a CalibrationCommand the service has already handled. More...
#include <CommandDedupe.hpp>
Public Member Functions | |
| bool | seen (const uint8_t *cmd) |
| true if this exact command was already seen (drop it); otherwise records it. | |
Static Public Attributes | |
| static constexpr std::size_t | kBytes = 16 |
| static constexpr std::size_t | kDepth = 32 |
Private Attributes | |
| std::array< std::array< uint8_t, kBytes >, kDepth > | recent_ {} |
| std::size_t | next_ = 0 |
| std::size_t | count_ = 0 |
Drops a CalibrationCommand the service has already handled.
elodin-db delivers a table once per subscription to it, and a second subscribe on the same connection is a second subscription: every packet then arrives twice. The service's "no packets for 5 s, re-subscribe" fallback does exactly that, and it re-adds the command table each time — so after it had fired once, every capture landed twice (CI, 2026-11-07: ten captures stored twenty points, and a load cell's single "linear" capture became a two-point line that streamed the reference instead of PENDING physics). After N firings it would be N+1.
The backend stamps every command with its own timestamp, so two commands with the same 16 bytes are one command delivered twice, whatever made the copy. Remembers the last kDepth.
Definition at line 23 of file CommandDedupe.hpp.
|
inline |
|
private |
Definition at line 43 of file CommandDedupe.hpp.
Referenced by seen().
|
staticconstexpr |
Definition at line 25 of file CommandDedupe.hpp.
Referenced by seen().
|
staticconstexpr |
Definition at line 26 of file CommandDedupe.hpp.
Referenced by seen().
|
private |
Definition at line 42 of file CommandDedupe.hpp.
Referenced by seen().
Definition at line 41 of file CommandDedupe.hpp.
Referenced by seen().