SatCat5
switch_telemetry.h
1 // Copyright 2024-2025 The Aerospace Corporation.
3 // This file is a part of SatCat5, licensed under CERN-OHL-W v2 or later.
5 // Diagnostic telemetry for a SatCat5 switch
6 
7 #pragma once
8 
10 
11 // Enable this feature? (See types.h)
12 #if SATCAT5_CBOR_ENABLE
13 
14 namespace satcat5 {
15  namespace eth {
32  public:
38  satcat5::cfg::NetworkStats* stats = 0);
39 
41  inline void set_interval_cfg(unsigned interval_msec)
42  { m_tier1.set_interval(interval_msec); }
44  inline void set_interval_stats(unsigned interval_msec)
45  { m_tier2.set_interval(interval_msec); }
46 
47  protected:
48  // Required API from net::TelemetrySource.
49  void telem_event(u32 tier_id, satcat5::net::TelemetryCbor& cbor) override;
50 
51  // Internal state.
52  satcat5::eth::SwitchConfig* const m_cfg;
53  satcat5::cfg::NetworkStats* const m_stats;
56  };
57  }
58 }
59 
60 #endif // SATCAT5_CBOR_ENABLE
Traffic statistics polling.
Definition: cfgbus_stats.h:49
Management functions for a SatCat5 Ethernet switch.
Definition: switch_cfg.h:166
Diagnostic telemetry for a SatCat5 switch.
void set_interval_stats(unsigned interval_msec)
Adjust the reporting interval for Tier 2 telemetry.
SwitchTelemetry(satcat5::net::TelemetryAggregator *tlm, satcat5::eth::SwitchConfig *cfg, satcat5::cfg::NetworkStats *stats=0)
Constructor links to a specific data source.
void telem_event(u32 tier_id, satcat5::net::TelemetryCbor &cbor) override
User method for writing each telemetry message.
void set_interval_cfg(unsigned interval_msec)
Adjust the reporting interval for Tier 1 telemetry.
Protocol-agnostic handler for one or more TelemetryTier objects.
Legacy ephemeral wrapper class for the CBOR encoder.
User data sources must inherit from the TelemetrySource class.
Rate control for a particular telemetry "tier".
void set_interval(unsigned interval_msec)
Set the reporting interval for this tier, or zero to disable.
State-of-health telemetry using QCBOR.