STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
fsw::time::BoardClockSync Class Reference

#include <BoardClockSync.hpp>

Collaboration diagram for fsw::time::BoardClockSync:
[legend]

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_

Detailed Description

Definition at line 61 of file BoardClockSync.hpp.

Constructor & Destructor Documentation

◆ BoardClockSync()

fsw::time::BoardClockSync::BoardClockSync ( const TimeSyncConfig & cfg)
inlineexplicit

Definition at line 63 of file BoardClockSync.hpp.

References cfg_.

Member Function Documentation

◆ boards()

std::vector< std::string > fsw::time::BoardClockSync::boards ( ) const

All boards seen (for periodic diagnostics logging).

Definition at line 158 of file BoardClockSync.cpp.

References boards_.

Referenced by main().

◆ resync()

◆ stamp_packet()

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.

Parameters
board_keystable identity of the source board (source IP)
arrival_nsserver receive time of the packet (epoch ns)
chunk_msthe packet's chunk timestamps in send order (board uint32 millis; may wrap mid-packet)
Returns
one epoch-ns timestamp per chunk, same order as chunk_ms

Definition at line 42 of file BoardClockSync.cpp.

References fsw::time::TimeSyncConfig::Arrival, boards_, cfg_, fsw::time::BoardClockSync::BoardStats::clamp_fallbacks, fsw::time::BoardClockSync::BoardStats::jitter_ms, fsw::time::BoardClockSync::BoardState::last_emitted_ns, fsw::time::BoardClockSync::BoardState::last_raw_ms, fsw::time::BoardClockSync::BoardState::last_unwrapped_ms, fsw::time::BoardClockSync::BoardState::locked, fsw::time::BoardClockSync::BoardStats::locked, fsw::time::BoardClockSync::BoardStats::offset_ms, fsw::time::BoardClockSync::BoardState::offset_ns, fsw::time::BoardClockSync::BoardStats::packets, resync(), fsw::time::BoardClockSync::BoardState::stats, and fsw::time::BoardClockSync::BoardState::window.

Referenced by main(), anonymous_namespace{test_board_clock_sync.cpp}::test_arrival_mode(), anonymous_namespace{test_board_clock_sync.cpp}::test_clamp_fallback(), anonymous_namespace{test_board_clock_sync.cpp}::test_drift(), anonymous_namespace{test_board_clock_sync.cpp}::test_fuzz_invariants(), anonymous_namespace{test_board_clock_sync.cpp}::test_min_filter_jitter(), anonymous_namespace{test_board_clock_sync.cpp}::test_monotonic_guard(), anonymous_namespace{test_board_clock_sync.cpp}::test_multi_board(), anonymous_namespace{test_board_clock_sync.cpp}::test_reboot(), anonymous_namespace{test_board_clock_sync.cpp}::test_spreading(), anonymous_namespace{test_board_clock_sync.cpp}::test_wrap_between_packets(), and anonymous_namespace{test_board_clock_sync.cpp}::test_wrap_mid_packet().

◆ stats()

Member Data Documentation

◆ boards_

std::map<std::string, BoardState> fsw::time::BoardClockSync::boards_
private

Definition at line 109 of file BoardClockSync.hpp.

Referenced by boards(), stamp_packet(), and stats().

◆ cfg_

TimeSyncConfig fsw::time::BoardClockSync::cfg_
private

Definition at line 108 of file BoardClockSync.hpp.

Referenced by BoardClockSync(), and stamp_packet().


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