STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
CommandDedupe Class Reference

Drops a CalibrationCommand the service has already handled. More...

#include <CommandDedupe.hpp>

Collaboration diagram for CommandDedupe:
[legend]

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

Detailed Description

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.

Member Function Documentation

◆ seen()

bool fsw::calibration::CommandDedupe::seen ( const uint8_t * cmd)
inline

true if this exact command was already seen (drop it); otherwise records it.

Definition at line 29 of file CommandDedupe.hpp.

Member Data Documentation

◆ count_

std::size_t fsw::calibration::CommandDedupe::count_ = 0
private

Definition at line 43 of file CommandDedupe.hpp.

◆ kBytes

std::size_t fsw::calibration::CommandDedupe::kBytes = 16
staticconstexpr

Definition at line 25 of file CommandDedupe.hpp.

Referenced by make().

◆ kDepth

std::size_t fsw::calibration::CommandDedupe::kDepth = 32
staticconstexpr

Definition at line 26 of file CommandDedupe.hpp.

Referenced by main().

◆ next_

std::size_t fsw::calibration::CommandDedupe::next_ = 0
private

Definition at line 42 of file CommandDedupe.hpp.

◆ recent_

std::array<std::array<uint8_t, kBytes>, kDepth> fsw::calibration::CommandDedupe::recent_ {}
private

Definition at line 41 of file CommandDedupe.hpp.


The documentation for this class was generated from the following file: