|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Unit tests for fsw::time::BoardClockSync (pure, deterministic — no sockets, no real clock). More...
#include <BoardClockSync.hpp>
Classes | |
| struct | BoardStats |
| struct | BoardState |
Public Member Functions | |
| BoardClockSync (const TimeSyncConfig &cfg) | |
| std::vector< uint64_t > | stamp_packet (const std::string &board_key, uint64_t arrival_ns, const std::vector< uint32_t > &chunk_ms) |
| Stamp one packet's chunks for one board. | |
| BoardStats | stats (const std::string &board_key) const |
| Stats for one board (default-constructed if unknown). | |
| std::vector< std::string > | boards () const |
| All boards seen (for periodic diagnostics logging). | |
Private Member Functions | |
| void | resync (BoardState &s, uint32_t newest_raw_ms, uint64_t arrival_ns, bool count) |
Private Attributes | |
| TimeSyncConfig | cfg_ |
| std::map< std::string, BoardState > | boards_ |
Unit tests for fsw::time::BoardClockSync (pure, deterministic — no sockets, no real clock).
House style: plain main(), return 0 on pass / 1 on failure (see test_sequencer_elodin.cpp). Registered with CTest in lib/CMakeLists.txt.
Edge-case matrix (from the time-sync design):
Definition at line 61 of file BoardClockSync.hpp.
|
inlineexplicit |
Definition at line 63 of file BoardClockSync.hpp.
| std::vector< std::string > fsw::time::BoardClockSync::boards | ( | ) | const |
All boards seen (for periodic diagnostics logging).
Definition at line 158 of file BoardClockSync.cpp.
|
private |
Definition at line 26 of file BoardClockSync.cpp.
| std::vector< uint64_t > fsw::time::BoardClockSync::stamp_packet | ( | const std::string & | board_key, |
| uint64_t | arrival_ns, | ||
| const std::vector< uint32_t > & | chunk_ms ) |
Stamp one packet's chunks for one board.
| board_key | stable identity of the source board (source IP) |
| arrival_ns | server receive time of the packet (epoch ns) |
| chunk_ms | the packet's chunk timestamps in send order (board uint32 millis; may wrap mid-packet) |
Definition at line 42 of file BoardClockSync.cpp.
| BoardClockSync::BoardStats fsw::time::BoardClockSync::stats | ( | const std::string & | board_key | ) | const |
Stats for one board (default-constructed if unknown).
Definition at line 153 of file BoardClockSync.cpp.
|
private |
Definition at line 109 of file BoardClockSync.hpp.
Definition at line 108 of file BoardClockSync.hpp.