Routes incoming BOARD_HEARTBEAT packets to Elodin DB.
On each heartbeat:
- Publishes a BoardHeartbeatElodinMessage to packet_id {0x10, board_id}.
- Tracks per-board last-seen time to detect reconnects and Setup re-entry.
- Returns a BoardEvent so the caller (daq_bridge_main) can gate SENSOR_CONFIG re-sends.
Definition at line 23 of file HeartbeatRouter.hpp.
| HeartbeatRouter::BoardEvent fsw::routing::HeartbeatRouter::process_heartbeat |
( |
const daq::PacketHeader & | header, |
|
|
const daq::BoardHeartbeatPacket & | heartbeat, |
|
|
uint8_t | board_type_wire, |
|
|
uint64_t | receive_ts_ns, |
|
|
int | elodin_board_id_if_known = -1 ) |
Process one BOARD_HEARTBEAT and publish to Elodin.
- Parameters
-
| header | Parsed packet header (for timestamp). |
| heartbeat | Parsed heartbeat body (DAQv2: firmware hash + id + states; no board_type on wire). |
| board_type_wire | Legacy wire enum byte for Elodin (from config when known, else 0). |
| receive_ts_ns | Monotonic receive timestamp (nanoseconds). |
| elodin_board_id_if_known | When >= 0 and <= 255, use this for Elodin packet_id {0x10, id} and for reconnect state keys — must match config.toml board_id so the thin backend boardsStatus and GUI stay aligned. Firmware often uses a slot index (1–8) while config uses composite IDs (e.g. 21 = PT board 1). Sensor streams still work via slot-based [0x20,…] IDs, so a wire/config mismatch only breaks board status / heartbeats UI unless overridden. |
Definition at line 15 of file HeartbeatRouter.cpp.
References board_states_, elodin_client_, NONE, RECONNECT_THRESHOLD, RECONNECTED, comms::CommsMessage< Fields >::setField(), daq::SETUP, SETUP_REENTRY, and state.
Referenced by main().